mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-19 13:55:40 -04:00
Fix mobile core not building on non-darwin machines (#1388)
* find `llvm-ranlib` for linux and windows systems * simplify the exec block * fix path not recognizing `darwin`
This commit is contained in:
@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
|
||||
group = 'com.spacedrive.core'
|
||||
version = '0.0.1'
|
||||
|
||||
@@ -101,21 +102,23 @@ if (System.getenv('SPACEDRIVE_CI') != "1") {
|
||||
}
|
||||
|
||||
cargo {
|
||||
final String osName = System.getProperty("os.name").toLowerCase();
|
||||
|
||||
module = "./crate"
|
||||
libname = "sd_mobile_android"
|
||||
pythonCommand = 'python3'
|
||||
profile = 'release' // 'debug'
|
||||
targets = cargoTargets
|
||||
targetDirectory = "../../../../../target" // Monorepo moment
|
||||
|
||||
exec { spec, toolchain ->
|
||||
def dir = "${android.ndkDirectory}/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib"
|
||||
|
||||
spec.environment("RANLIB_armv7-linux-androideabi", "${dir}")
|
||||
spec.environment("RANLIB_aarch64-linux-android", "${dir}")
|
||||
spec.environment("RANLIB_i686-linux-android", "${dir}")
|
||||
spec.environment("RANLIB_x86_64-linux-android", "${dir}")
|
||||
}
|
||||
def dir = "${android.ndkDirectory}/toolchains/llvm/prebuilt/${osName.contains("mac") ? "darwin" : osName}-x86_64/bin/llvm-ranlib"
|
||||
|
||||
spec.environment("RANLIB_armv7-linux-androideabi", "${dir}")
|
||||
spec.environment("RANLIB_aarch64-linux-android", "${dir}")
|
||||
spec.environment("RANLIB_i686-linux-android", "${dir}")
|
||||
spec.environment("RANLIB_x86_64-linux-android", "${dir}")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.whenTaskAdded { task ->
|
||||
|
||||
Reference in New Issue
Block a user