build(gradle): expose cargo bin path to rust task
Gradle's exec environment does not inherit the user's interactive shell PATH, so cargo-ndk could not find cargo even when it lived in ~/.cargo/bin. Prepend ~/.cargo/bin to PATH for buildRustCertgen so the Rust toolchain resolves reliably from any shell.
This commit is contained in:
@@ -98,6 +98,7 @@ val buildRustCertgen by tasks.registering(Exec::class) {
|
||||
outputs.dir(rootProject.projectDir.resolve("app/src/main/jniLibs"))
|
||||
|
||||
environment("ANDROID_NDK_HOME", android.ndkDirectory.absolutePath)
|
||||
environment("PATH", "${System.getProperty("user.home")}/.cargo/bin:${System.getenv("PATH") ?: ""}")
|
||||
}
|
||||
|
||||
// AGP auto-detects jniLibs/ as an input to mergeJniLibFolders — wire the dependency
|
||||
|
||||
Reference in New Issue
Block a user