File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
buildSrc/src/main/groovy/org/swift/swiftkit/gradle Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 1414
1515package org.swift.swiftkit.gradle
1616
17+ import groovy.json.JsonSlurper
18+
1719final class BuildUtils {
1820
21+ static List<String > getSwiftRuntimeLibraryPaths () {
22+ def process = [' swiftc' , ' -print-target-info' ]. execute()
23+ def output = new StringWriter ()
24+ process. consumeProcessOutput(output, System . err)
25+ process. waitFor()
26+
27+ def json = new JsonSlurper (). parseText(output. toString())
28+ def runtimeLibraryPaths = json. paths. runtimeLibraryPaths
29+ return runtimeLibraryPaths
30+ }
31+
1932 // / Find library paths for 'java.library.path' when running or testing projects inside this build.
2033 static def javaLibraryPaths (File rootDir ) {
2134 def osName = System . getProperty(" os.name" )
@@ -40,19 +53,8 @@ final class BuildUtils {
4053 " ${ base} ../../.build/${ osArch} -apple-macosx/debug/" ),
4154 ]
4255 def releasePaths = debugPaths. collect { it. replaceAll(" debug" , " release" ) }
43- def systemPaths =
44- // system paths
45- isLinux ?
46- [
47- " /usr/lib/swift/linux" ,
48- // TODO: should we be Swiftly aware and then use the currently used path?
49- System . getProperty(" user.home" ) + " /.local/share/swiftly/toolchains/6.0.2/usr/lib/swift/linux"
50- ] :
51- [
52- // assume macOS
53- " /usr/lib/swift/"
54- ]
55-
56- return releasePaths + debugPaths + systemPaths
56+ def swiftRuntimePaths = getSwiftRuntimeLibraryPaths()
57+
58+ return releasePaths + debugPaths + swiftRuntimePaths
5759 }
5860}
You can’t perform that action at this time.
0 commit comments