Files
swift-mirror/test/ScanDependencies/binary_framework_dependency.swift
Artem Chikin f0518f64ec [Dependency Scanning] Add a field of source-imported dependencies
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.
2025-04-30 10:17:45 -07:00

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: }