diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/app/build.gradle.kts | 3 | ||||
| -rw-r--r-- | android/buildSrc/src/main/kotlin/Utils.kt | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 26db17f1bb..0e1f9ffa62 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -291,6 +291,9 @@ cargo { add("--locked") } } + exec = { spec, _ -> + spec.environment("RUSTFLAGS", generateRemapArguments()) + } } tasks.register<Exec>("generateRelayList") { diff --git a/android/buildSrc/src/main/kotlin/Utils.kt b/android/buildSrc/src/main/kotlin/Utils.kt index ffea7ce51f..af00586bea 100644 --- a/android/buildSrc/src/main/kotlin/Utils.kt +++ b/android/buildSrc/src/main/kotlin/Utils.kt @@ -1,7 +1,5 @@ -import java.io.ByteArrayOutputStream import java.util.* import org.gradle.api.Project -import org.gradle.process.ExecSpec fun Project.generateVersionCode(localProperties: Properties): Int { return localProperties.getProperty("OVERRIDE_VERSION_CODE")?.toIntOrNull() @@ -12,6 +10,11 @@ fun Project.generateVersionName(localProperties: Properties): String { return localProperties.getProperty("OVERRIDE_VERSION_NAME") ?: execVersionNameCargoCommand() } +fun Project.generateRemapArguments(): String { + val script = "${projectDir.parent}/../building/rustc-remap-path-prefix.sh" + return providers.exec { commandLine(script) }.standardOutput.asText.get().trim() +} + private fun Project.execVersionCodeCargoCommand() = providers.exec { commandLine("cargo", "run", "-q", "--bin", "mullvad-version", "versionCode") |
