Skip to content

Commit

Permalink
Fixed symlink add features
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Dec 6, 2024
1 parent 7ecf272 commit 23e5bc5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,17 @@ junitPlatform {
}

cargo {
val isReleaseBuild = isReleaseBuild()
module = repoRootPath
libname = "mullvad-jni"
// All available targets:
// https://github.com/mozilla/rust-android-gradle/tree/master?tab=readme-ov-file#targets
targets = gradleLocalProperties(rootProject.projectDir, providers)
.getProperty("CARGO_TARGETS")?.split(",") ?: listOf("arm", "arm64", "x86", "x86_64")
targets =
gradleLocalProperties(rootProject.projectDir, providers)
.getProperty("CARGO_TARGETS")
?.split(",") ?: listOf("arm", "arm64", "x86", "x86_64")
profile =
if (isReleaseBuild()) {
if (isReleaseBuild) {
"release"
} else {
"debug"
Expand All @@ -270,8 +273,21 @@ cargo {
// Set this if you get a cargo not found error
// rustcCommand = ""
// cargoCommand = ""
targetIncludes = listOf("libmullvad_jni.so").toTypedArray()
extraCargoBuildArguments = listOf("--package=mullvad-jni")
features {
if (!isReleaseBuild) {
defaultAnd(arrayOf("api-override"))
}
}
targetIncludes = arrayOf("libmullvad_jni.so")
extraCargoBuildArguments = buildList {
add("--package=mullvad-jni")
if (isReleaseBuild) {
add("--locked")
}
}
exec = { spec, toolchain ->
println(spec.commandLine)
}
}

tasks.register<Exec>("generateRelayList") {
Expand All @@ -281,9 +297,7 @@ tasks.register<Exec>("generateRelayList") {
// Set this if you get a cargo not found error
// environment =

onlyIf {
isReleaseBuild() || !relayListPath.exists()
}
onlyIf { isReleaseBuild() || !relayListPath.exists() }

commandLine("cargo", "run", "--bin", "relay_list")

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/assets/maybenot_machines

0 comments on commit 23e5bc5

Please sign in to comment.