Skip to content

Commit

Permalink
Fix the compile error shadowsocks#2930
Browse files Browse the repository at this point in the history
  • Loading branch information
dev4u committed Sep 17, 2022
1 parent 9f6b3a4 commit b20d1eb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,17 @@ cargo {
"aead-cipher-2022",
))
exec = { spec, toolchain ->
spec.environment("RUST_ANDROID_GRADLE_PYTHON_COMMAND", "python3")
spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py")
spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so")
run {
val process: Process = Runtime.getRuntime().exec("which python3 >/dev/null 2>&1 && echo python3 installed")
val output = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
if (output.contains("python3")) {
spec.environment("RUST_ANDROID_GRADLE_PYTHON_COMMAND", "python3")
} else {
spec.environment("RUST_ANDROID_GRADLE_PYTHON_COMMAND", "python")
}
spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py")
spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so")
}
}
}

Expand Down

0 comments on commit b20d1eb

Please sign in to comment.