Separate companion

This commit is contained in:
Nullptr
2023-02-08 20:17:56 +08:00
parent f75d15c6f6
commit 291599ffc8
10 changed files with 190 additions and 105 deletions

View File

@@ -3,6 +3,9 @@ plugins {
id("org.mozilla.rust-android-gradle.rust-android")
}
val verName: String by rootProject.extra
val verCode: Int by rootProject.extra
android.buildFeatures {
androidResources = false
buildConfig = false
@@ -16,4 +19,8 @@ cargo {
targetDirectory = "build/intermediates/rust"
val isDebug = gradle.startParameter.taskNames.any { it.toLowerCase().contains("debug") }
profile = if (isDebug) "debug" else "release"
exec = { spec, _ ->
spec.environment("VERSION_CODE", verCode)
spec.environment("VERSION_NAME", verName)
}
}