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 {
4343}
4444
4545
46+ // FIXME: cannot share definition with 'buildSrc' so we duplicated the impl here
4647fun javaLibraryPaths (): List <String > {
4748 val osName = System .getProperty(" os.name" )
4849 val osArch = System .getProperty(" os.arch" )
4950 val isLinux = osName.lowercase(Locale .getDefault()).contains(" linux" )
5051
5152 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+ }
5459 } else {
5560 if (osArch.equals(" aarch64" )) {
56- """ $rootDir /.build/arm64-apple-macosx/debug/"" "
61+ " $rootDir /.build/arm64-apple-macosx/debug/"
5762 } else {
58- """ $rootDir /.build/$osArch -apple-macosx/debug/"" "
63+ " $rootDir /.build/$osArch -apple-macosx/debug/"
5964 }
6065 },
6166 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+
115repositories {
216 mavenCentral()
317}
Original file line number Diff line number Diff line change 1515package org.swift.swiftkit.gradle
1616
1717final class BuildUtils {
18+
19+ // / Find library paths for 'java.library.path' when running or testing projects inside this build.
1820 static def javaLibraryPaths (File rootDir ) {
1921 def osName = System . getProperty(" os.name" )
2022 def osArch = System . getProperty(" os.arch" )
2123 def isLinux = osName. toLowerCase(Locale . getDefault()). contains(" linux" )
2224
2325 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" ?
2731 " ${ rootDir} /.build/arm64-apple-macosx/debug/" :
28- " ${ rootDir} /.build/${ osArch} -apple-macosx/debug/" ,
32+ " ${ rootDir} /.build/${ osArch} -apple-macosx/debug/" ) ,
2933 isLinux ?
3034 " /usr/lib/swift/linux" :
3135 // assume macOS
You can’t perform that action at this time.
0 commit comments