mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Combine buildTypes blocks
This commit is contained in:
parent
e0998db4ab
commit
f240e66c94
1 changed files with 27 additions and 41 deletions
|
|
@ -49,18 +49,44 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = false
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro",
|
"proguard-rules.pro",
|
||||||
)
|
)
|
||||||
isDebuggable = false
|
isDebuggable = false
|
||||||
|
if (shouldSign) {
|
||||||
|
signingConfig = signingConfigs.getByName("ci")
|
||||||
|
} else {
|
||||||
|
val localPropertiesFile = project.rootProject.file("local.properties")
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
val properties = Properties()
|
||||||
|
properties.load(localPropertiesFile.inputStream())
|
||||||
|
val signingConfigName = properties["release.signing.config"]?.toString()
|
||||||
|
if (signingConfigName != null) {
|
||||||
|
signingConfig = signingConfigs.getByName(signingConfigName)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = false
|
||||||
isDebuggable = true
|
isDebuggable = true
|
||||||
applicationIdSuffix = ".debug"
|
applicationIdSuffix = ".debug"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applicationVariants.all {
|
||||||
|
val variant = this
|
||||||
|
variant.outputs
|
||||||
|
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
|
||||||
|
.forEach { output ->
|
||||||
|
val abi = output.getFilter("ABI").let { if (it != null) "-$it" else "" }
|
||||||
|
val outputFileName =
|
||||||
|
"Wholphin-${variant.baseName}-${variant.versionName}-${variant.versionCode}$abi.apk"
|
||||||
|
output.outputFileName = outputFileName
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
|
@ -98,46 +124,6 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
|
|
||||||
proguardFiles(
|
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
"proguard-rules.pro",
|
|
||||||
)
|
|
||||||
if (shouldSign) {
|
|
||||||
signingConfig = signingConfigs.getByName("ci")
|
|
||||||
} else {
|
|
||||||
val localPropertiesFile = project.rootProject.file("local.properties")
|
|
||||||
if (localPropertiesFile.exists()) {
|
|
||||||
val properties = Properties()
|
|
||||||
properties.load(localPropertiesFile.inputStream())
|
|
||||||
val signingConfigName = properties["release.signing.config"]?.toString()
|
|
||||||
if (signingConfigName != null) {
|
|
||||||
signingConfig = signingConfigs.getByName(signingConfigName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
debug {
|
|
||||||
if (shouldSign) {
|
|
||||||
signingConfig = signingConfigs.getByName("ci")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationVariants.all {
|
|
||||||
val variant = this
|
|
||||||
variant.outputs
|
|
||||||
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
|
|
||||||
.forEach { output ->
|
|
||||||
val abi = output.getFilter("ABI").let { if (it != null) "-$it" else "" }
|
|
||||||
val outputFileName =
|
|
||||||
"Wholphin-${variant.baseName}-${variant.versionName}-${variant.versionCode}$abi.apk"
|
|
||||||
output.outputFileName = outputFileName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue