mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
For the main source module, provide info on which dependencies are directly imported into the user program, explicitly ('import' statement) or implicitly (e.g. stdlib). Thist list does not include Swift overlay dependencies, cross-import dependencies, bridging header dependencies.
37 lines
1.4 KiB
Swift
37 lines
1.4 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: mkdir -p %t/clang-module-cache
|
|
// RUN: mkdir -p %t/Frameworks
|
|
// RUN: mkdir -p %t/Frameworks/Foo.framework/
|
|
// RUN: mkdir -p %t/Frameworks/Foo.framework/Modules
|
|
// RUN: mkdir -p %t/Frameworks/Foo.framework/Modules/Foo.swiftmodule
|
|
|
|
// Build a dependency into a binary module
|
|
// RUN: echo "public func foo() {}" >> %t/foo.swift
|
|
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Frameworks/Foo.framework/Modules/Foo.swiftmodule/%target-cpu.swiftmodule -module-cache-path %t.module-cache %t/foo.swift -module-name Foo
|
|
|
|
// Run the scan
|
|
// RUN: %target-swift-frontend -scan-dependencies %s -o %t/deps.json -F %t/Frameworks/ -sdk %t
|
|
// RUN: %validate-json %t/deps.json | %FileCheck %s
|
|
|
|
import Foo
|
|
|
|
// Appears as a dependency of the main module
|
|
// CHECK: "swiftPrebuiltExternal": "Foo"
|
|
|
|
// Appears as, specifically, a source-imported dependency of the main module
|
|
// CHECK: "swiftPrebuiltExternal": "Foo"
|
|
|
|
// Actual node in the dependency graph for module 'Foo'
|
|
// CHECK: "swiftPrebuiltExternal": "Foo"
|
|
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "modulePath":
|
|
// CHECK-NEXT: "directDependencies": [
|
|
// CHECK: "details": {
|
|
// CHECK-NEXT: "swiftPrebuiltExternal": {
|
|
// CHECK-NEXT: "compiledModulePath":
|
|
// CHECK-NEXT: "userModuleVersion":
|
|
// CHECK-NEXT: "isFramework": true
|
|
// CHECK-NEXT: }
|