Skip to content

Commit 9e9eee5

Browse files
committed
Refine release build process
1 parent 8e56341 commit 9e9eee5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ allprojects {
3131
tasks.register<Delete>("clean") {
3232
delete(rootProject.buildDir)
3333
}
34+
35+
// skip uploading the mapping to Crashlytics
36+
subprojects {
37+
tasks.whenTaskAdded {
38+
if(name.contains("uploadCrashlyticsMappingFileRelease")) {
39+
enabled = false
40+
}
41+
}
42+
}

buildSrc/src/main/kotlin/Helpers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const val lifecycleVersion = "2.2.0"
1515

1616
private val Project.android get() = extensions.getByName<BaseExtension>("android")
1717

18-
private val flavorRegex = "(assemble|generate)\\w*(Release|Debug)".toRegex()
18+
private val flavorRegex = ".*(assemble|generate)\\w*(Release|Debug).*".toRegex()
1919
val Project.currentFlavor get() = gradle.startParameter.taskRequests.toString().let { task ->
2020
flavorRegex.matchEntire(task)?.groupValues?.get(2)?.toLowerCase(Locale.ROOT) ?: "debug".also {
2121
println("Warning: No match found for $task")

core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cargo {
3838
module = "src/main/rust/shadowsocks-rust"
3939
libname = "sslocal"
4040
targets = listOf("arm", "arm64", "x86", "x86_64")
41-
profile = findProperty("CARGO_PROFILE")?.toString() ?: "release"
41+
profile = findProperty("CARGO_PROFILE")?.toString() ?: currentFlavor
4242
extraCargoBuildArguments = listOf("--bin", libname!!)
4343
featureSpec.noDefaultBut(arrayOf(
4444
"sodium",

0 commit comments

Comments
 (0)