File tree Expand file tree Collapse file tree 4 files changed +32
-8
lines changed
BuildLogic/src/main/kotlin
src/main/groovy/org/swift/swiftkit/gradle Expand file tree Collapse file tree 4 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,24 @@ tasks.withType(JavaCompile::class).forEach {
43
43
}
44
44
45
45
46
+ // FIXME: cannot share definition with 'buildSrc' so we duplicated the impl here
46
47
fun javaLibraryPaths (): List <String > {
47
48
val osName = System .getProperty(" os.name" )
48
49
val osArch = System .getProperty(" os.arch" )
49
50
val isLinux = osName.lowercase(Locale .getDefault()).contains(" linux" )
50
51
51
52
return listOf (
52
- if (osName.lowercase(Locale .getDefault()).contains(" linux" )) {
53
- """ $rootDir /.build/$osArch -unknown-linux-gnu/debug/"""
53
+ if (isLinux) {
54
+ if (osArch.equals(" x86_64" ) || osArch.equals(" amd64" )) {
55
+ " $rootDir /.build/x86_64-unknown-linux-gnu/debug/"
56
+ } else {
57
+ " $rootDir /.build/$osArch -unknown-linux-gnu/debug/"
58
+ }
54
59
} else {
55
60
if (osArch.equals(" aarch64" )) {
56
- """ $rootDir /.build/arm64-apple-macosx/debug/"" "
61
+ " $rootDir /.build/arm64-apple-macosx/debug/"
57
62
} else {
58
- """ $rootDir /.build/$osArch -apple-macosx/debug/"" "
63
+ " $rootDir /.build/$osArch -apple-macosx/debug/"
59
64
}
60
65
},
61
66
if (isLinux) {
Original file line number Diff line number Diff line change
1
+ buildSrc are shared "build library code" that is available to all sub-projects of the primary build.
Original file line number Diff line number Diff line change
1
+ // ===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2024 Apple Inc. and the Swift.org project authors
6
+ // Licensed under Apache License v2.0
7
+ //
8
+ // See LICENSE.txt for license information
9
+ // See CONTRIBUTORS.txt for the list of Swift.org project authors
10
+ //
11
+ // SPDX-License-Identifier: Apache-2.0
12
+ //
13
+ // ===----------------------------------------------------------------------===//
14
+
1
15
repositories {
2
16
mavenCentral()
3
17
}
Original file line number Diff line number Diff line change 15
15
package org.swift.swiftkit.gradle
16
16
17
17
final class BuildUtils {
18
+
19
+ // / Find library paths for 'java.library.path' when running or testing projects inside this build.
18
20
static def javaLibraryPaths (File rootDir ) {
19
21
def osName = System . getProperty(" os.name" )
20
22
def osArch = System . getProperty(" os.arch" )
21
23
def isLinux = osName. toLowerCase(Locale . getDefault()). contains(" linux" )
22
24
23
25
return [
24
- osName. toLowerCase(Locale . getDefault()). contains(" linux" ) ?
25
- " ${ rootDir} /.build/${ osArch} -unknown-linux-gnu/debug/" :
26
- osArch == " aarch64" ?
26
+ isLinux ?
27
+ /* Linux */ (osArch == " amd64" || osArch == " amd64" ?
28
+ " ${ rootDir} /.build/x86_64-unknown-linux-gnu/debug/" :
29
+ " ${ rootDir} /.build/${ osArch} -unknown-linux-gnu/debug/" ) :
30
+ /* macOS */ (osArch == " aarch64" ?
27
31
" ${ rootDir} /.build/arm64-apple-macosx/debug/" :
28
- " ${ rootDir} /.build/${ osArch} -apple-macosx/debug/" ,
32
+ " ${ rootDir} /.build/${ osArch} -apple-macosx/debug/" ) ,
29
33
isLinux ?
30
34
" /usr/lib/swift/linux" :
31
35
// assume macOS
You can’t perform that action at this time.
0 commit comments