@@ -22,7 +22,11 @@ import SwiftJavaLib
22
22
import JavaKitConfigurationShared
23
23
import JavaKitShared
24
24
import _Subprocess
25
+ #if canImport(System)
25
26
import System
27
+ #else
28
+ @preconcurrency import SystemPackage
29
+ #endif
26
30
27
31
typealias Configuration = JavaKitConfigurationShared . Configuration
28
32
@@ -58,31 +62,10 @@ extension SwiftJava.ResolveCommand {
58
62
var printRuntimeClasspathTaskName : String { " printRuntimeClasspath " }
59
63
60
64
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
-
82
65
var dependenciesToResolve : [ JavaDependencyDescriptor ] = [ ]
83
66
if let input, let inputDependencies = parseDependencyDescriptor ( input) {
84
67
dependenciesToResolve. append ( inputDependencies)
85
- }
68
+ }
86
69
if let dependencies = config. dependencies {
87
70
dependenciesToResolve += dependencies
88
71
}
@@ -148,7 +131,7 @@ extension SwiftJava.ResolveCommand {
148
131
" --rerun-tasks " ,
149
132
" \( printRuntimeClasspathTaskName) " ,
150
133
] ,
151
- workingDirectory: FilePath ( resolverDir. path) ,
134
+ workingDirectory: Optional ( FilePath ( resolverDir. path) ) ,
152
135
// TODO: we could move to stream processing the outputs
153
136
output: . string( limit: Int . max, encoding: UTF8 . self) , // Don't limit output, we know it will be reasonable size
154
137
error: . string( limit: Int . max, encoding: UTF8 . self) // Don't limit output, we know it will be reasonable size
0 commit comments