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:
Enginex0
2026-05-19 03:24:11 +01:00
parent 051a003b33
commit 85eef8054d
+1
View File
@@ -98,6 +98,7 @@ val buildRustCertgen by tasks.registering(Exec::class) {
outputs.dir(rootProject.projectDir.resolve("app/src/main/jniLibs")) outputs.dir(rootProject.projectDir.resolve("app/src/main/jniLibs"))
environment("ANDROID_NDK_HOME", android.ndkDirectory.absolutePath) 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 // AGP auto-detects jniLibs/ as an input to mergeJniLibFolders — wire the dependency