Skip to content

Commit a589a9d

Browse files
authored
Merge pull request #78 from rosuH/dev
🔧 [Update] - Remove multi flavor.
2 parents 3e53583 + f273260 commit a589a9d

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

app/build.gradle.kts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import ProductFlavors.coolApk
2-
import ProductFlavors.github
3-
import ProductFlavors.googlePlay
4-
import ProductFlavors.others
1+
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
52

63
plugins {
74
id("com.android.application")
@@ -19,6 +16,7 @@ android {
1916
versionCode = 20200
2017
versionName = "2.2.0"
2118
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19+
setProperty("archivesBaseName", "${applicationId}-v${versionName}(${versionCode})")
2220
}
2321

2422
buildTypes {
@@ -37,14 +35,6 @@ android {
3735
"coroutines.pro", "proguard-rules.pro"
3836
)
3937
}
40-
41-
productFlavors {
42-
flavorDimensions.add("version")
43-
create(googlePlay)
44-
create(github)
45-
create(coolApk)
46-
create(others)
47-
}
4838
}
4939

5040

@@ -53,13 +43,12 @@ android {
5343
targetCompatibility(JavaVersion.VERSION_11)
5444
}
5545

46+
// change output apk name
5647
applicationVariants.all {
57-
val variant = this
58-
variant.outputs
59-
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
60-
.forEach { output ->
61-
output.outputFileName = "ewm-v${variant.versionName}.apk"
62-
}
48+
outputs.all {
49+
(this as? BaseVariantOutputImpl)?.outputFileName =
50+
"${applicationId}-v${versionName}(${versionCode}).apk"
51+
}
6352
}
6453

6554
packagingOptions {

0 commit comments

Comments
 (0)