File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
63plugins {
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 {
You can’t perform that action at this time.
0 commit comments