Skip to content

Commit da1c4c8

Browse files
committed
debugging swiftpm plugin + subprocess hangs
1 parent 3e7ae28 commit da1c4c8

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ let package = Package(
187187
.swiftLanguageMode(.v5),
188188
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"]),
189189
]
190-
// // FIXME: when the tool is run from plugin it hangs even if sandbox is disabled
191-
// ,
192-
// plugins: [
193-
// "SwiftJavaBootstrapJavaPlugin",
194-
// ]
190+
// FIXME: when the tool is run from plugin it hangs even if sandbox is disabled
191+
,
192+
plugins: [
193+
"SwiftJavaBootstrapJavaPlugin",
194+
]
195195
),
196196

197197
.target(

Samples/JavaDependencySampleApp/ci-validate.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,4 @@
33
set -e
44
set -x
55

6-
# TODO: this is a workaround for build plugins getting stuck running the bootstrap plugin
7-
cd ../../
8-
swift build --product SwiftJavaBootstrapJavaTool
9-
.build/debug/SwiftJavaBootstrapJavaTool --fetch Sources/JavaKitDependencyResolver/swift-java.config --module-name JavaKitDependencyResolver --output-directory .build/plugins/outputs/swift-java/JavaKitDependencyResolver/destination/SwiftJavaBootstrapJavaPlugin
10-
11-
cd -
126
swift run --disable-sandbox

Sources/SwiftJavaBootstrapJavaTool/SwiftJavaBootstrapJavaTool.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ final class SwiftJavaBootstrapJavaTool {
6767
"--rerun-tasks",
6868
// "--debug",
6969
// "\(localGradleProjectDependencyName):jar",
70-
"\(localGradleProjectDependencyName):\(printRuntimeClasspathTaskName)"
70+
"\(localGradleProjectDependencyName):\(printRuntimeClasspathTaskName)",
7171
]
72+
// ,
73+
// output: .writeTo(.open("/tmp/out.txt", .writeOnly), closeAfterSpawningProcess: true),
74+
// error: .writeTo(.open("/tmp/err.txt", .writeOnly), closeAfterSpawningProcess: true)
7275
)
7376

7477
let outString = String(
@@ -106,6 +109,7 @@ final class SwiftJavaBootstrapJavaTool {
106109
URL(fileURLWithPath: outputDirectoryPath)
107110
.appendingPathComponent("\(moduleName).swift-java.classpath", isDirectory: false)
108111

112+
// let classpathString = "MOCK"
109113
try! classpathString.write(to: classpathOutputURL, atomically: true, encoding: .utf8)
110114

111115
print("[swift-java-bootstrap] Done, written classpath to: \(classpathOutputURL)")

0 commit comments

Comments
 (0)