@@ -22,7 +22,11 @@ import SwiftJavaLib
2222import JavaKitConfigurationShared
2323import JavaKitShared
2424import _Subprocess
25+ #if canImport(System)
2526import System
27+ #else
28+ @preconcurrency import SystemPackage
29+ #endif
2630
2731typealias Configuration = JavaKitConfigurationShared . Configuration
2832
@@ -58,31 +62,10 @@ extension SwiftJava.ResolveCommand {
5862 var printRuntimeClasspathTaskName : String { " printRuntimeClasspath " }
5963
6064 mutating func runSwiftJavaCommand( config: inout Configuration ) async throws {
61- // Form a class path from all of our input sources:
62- let classpathOptionEntries : [ String ] = self . classpathEntries
63- let classpathFromEnv = self . classpathEnvEntries
64- let classpathFromConfig : [ String ] = config. classpath? . split ( separator: " : " ) . map ( String . init) ?? [ ]
65- print ( " [debug][swift-java] Base classpath from config: \( classpathFromConfig) " )
66-
67- var classpathEntries : [ String ] = classpathFromConfig
68-
69- let classPathFilesSearchDirectory = self . effectiveSwiftModuleURL. absoluteString
70- print ( " [debug][swift-java] Search *.swift-java.classpath in: \( classPathFilesSearchDirectory) " )
71- let swiftJavaCachedModuleClasspath = findSwiftJavaClasspaths ( in: classPathFilesSearchDirectory)
72-
73- print ( " [debug][swift-java] Classpath from *.swift-java.classpath files: \( swiftJavaCachedModuleClasspath) " )
74- classpathEntries += swiftJavaCachedModuleClasspath
75-
76- if logLevel >= . debug {
77- let classpathString = classpathEntries. joined ( separator: " : " )
78- print ( " [debug][swift-java] Initialize JVM with classpath: \( classpathString) " )
79- }
80- let jvm = try JavaVirtualMachine . shared ( classpath: classpathEntries)
81-
8265 var dependenciesToResolve : [ JavaDependencyDescriptor ] = [ ]
8366 if let input, let inputDependencies = parseDependencyDescriptor ( input) {
8467 dependenciesToResolve. append ( inputDependencies)
85- }
68+ }
8669 if let dependencies = config. dependencies {
8770 dependenciesToResolve += dependencies
8871 }
@@ -148,7 +131,7 @@ extension SwiftJava.ResolveCommand {
148131 " --rerun-tasks " ,
149132 " \( printRuntimeClasspathTaskName) " ,
150133 ] ,
151- workingDirectory: FilePath ( resolverDir. path) ,
134+ workingDirectory: Optional ( FilePath ( resolverDir. path) ) ,
152135 // TODO: we could move to stream processing the outputs
153136 output: . string( limit: Int . max, encoding: UTF8 . self) , // Don't limit output, we know it will be reasonable size
154137 error: . string( limit: Int . max, encoding: UTF8 . self) // Don't limit output, we know it will be reasonable size
0 commit comments