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 14
14
15
15
package org.swift.swiftkit.gradle
16
16
17
+ import groovy.json.JsonSlurper
18
+
17
19
final class BuildUtils {
18
20
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
+
19
32
// / Find library paths for 'java.library.path' when running or testing projects inside this build.
20
33
static def javaLibraryPaths (File rootDir ) {
21
34
def osName = System . getProperty(" os.name" )
@@ -40,19 +53,8 @@ final class BuildUtils {
40
53
" ${ base} ../../.build/${ osArch} -apple-macosx/debug/" ),
41
54
]
42
55
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
57
59
}
58
60
}
You can’t perform that action at this time.
0 commit comments