Browse Source

1.版本1.0.9打包

20241218TB223FC(测试jar包)
wangwanlei 7 months ago
parent
commit
f6726de2a4
1 changed files with 15 additions and 16 deletions
  1. 15
    16
      app/build.gradle.kts

+ 15
- 16
app/build.gradle.kts View File

17
         applicationId = "com.xhkjedu.manageapp"
17
         applicationId = "com.xhkjedu.manageapp"
18
         minSdk = 24
18
         minSdk = 24
19
         targetSdk = 30
19
         targetSdk = 30
20
-        versionCode = 9
21
-        versionName = "1.0.8"
20
+        versionCode = 10
21
+        versionName = "1.0.9"
22
 
22
 
23
         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23
         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
24
         vectorDrawables {
24
         vectorDrawables {
95
         return dateFormat.format(Date())
95
         return dateFormat.format(Date())
96
     }
96
     }
97
 
97
 
98
-  /*  android.applicationVariants.all {variant->
99
-       variant.outputs.all {output->
100
-           val versionName = variant.versionName
101
-           val versionCode = variant.versionCode
102
-           val variantName = variant.name
103
-           val apkName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
104
-          *//* output.outputFile.renameTo(File(output.outputFile.parentFile,apkName))*//*
105
-           val outputImpl = output as com.android.build.gradle.internal.api.BaseVariantOutputImpl
106
-           outputImpl.outputFileName=apkName
107
-           true
108
-       }
109
-    }*/
110
-    applicationVariants.all(
98
+    applicationVariants.all{
99
+        val versionName = this.versionName
100
+        val versionCode = this.versionCode
101
+        val variantName = this.name
102
+        outputs.all {
103
+            if (this is com.android.build.gradle.internal.api.ApkVariantOutputImpl){
104
+                val fileName =  "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
105
+                this.outputFileName=fileName
106
+            }
107
+        }
108
+    }
109
+  /*  applicationVariants.all(
111
         object : Action<com.android.build.gradle.api.ApplicationVariant> {
110
         object : Action<com.android.build.gradle.api.ApplicationVariant> {
112
             override fun execute(variant: com.android.build.gradle.api.ApplicationVariant) {
111
             override fun execute(variant: com.android.build.gradle.api.ApplicationVariant) {
113
                 println("variant: $variant")
112
                 println("variant: $variant")
128
                 )
127
                 )
129
             }
128
             }
130
         }
129
         }
131
-    )
130
+    )*/
132
 }
131
 }
133
 
132
 
134
 dependencies {
133
 dependencies {

Loading…
Cancel
Save