Skip to content

Commit fbb9bd8

Browse files
committed
add comment
1 parent 7f1353f commit fbb9bd8

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

Sources/SwiftJavaTool/Commands/JavaCallbacksBuildCommand.swift

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ import System
2222
@preconcurrency import SystemPackage
2323
#endif
2424

25-
/// Builds Swift-Java callbacks in a single command:
26-
/// 1. Building SwiftKitCore with Gradle
27-
/// 2. Compiling extracted Java sources with javac
28-
/// 3. Running `swift-java configure` to produce a swift-java.config
29-
/// 4. Running `swift-java wrap-java` to generate Swift wrappers
30-
///
31-
/// This command is used by ``JExtractSwiftPlugin`` to consolidate all of the above
32-
/// into a single build command that declares only a Swift file as its output,
33-
/// avoiding SPM treating intermediate Java artifacts (compiled classes, config files,
34-
/// Gradle output directories) as module resources, which would trigger
35-
/// resource_bundle_accessor.swift generation and pull Foundation.Bundle into the binary.
3625
extension SwiftJava {
26+
/// Builds Swift-Java callbacks in a single command:
27+
/// 1. Building SwiftKitCore with Gradle
28+
/// 2. Compiling extracted Java sources with javac
29+
/// 3. Running `swift-java configure` to produce a swift-java.config
30+
/// 4. Running `swift-java wrap-java` to generate Swift wrappers
31+
///
32+
/// **WORKAROUND**: rdar://172649681 if we invoke commands one by one with java outputs SwiftPM will link Foundation
33+
///
34+
/// This command is used by ``JExtractSwiftPlugin`` to consolidate all of the above
35+
/// into a single build command that declares only a Swift file as its output,
36+
/// avoiding SPM treating intermediate Java artifacts (compiled classes, config files,
37+
/// Gradle output directories) as module resources, which would trigger
38+
/// resource_bundle_accessor.swift generation and pull Foundation.Bundle into the binary.
3739
struct JavaCallbacksBuildCommand: AsyncParsableCommand {
3840

3941
static let configuration = CommandConfiguration(

0 commit comments

Comments
 (0)