Browse Source

[New]修改安卓打包脚本

zhipeng 1 year ago
parent
commit
0ce16c8f59
1 changed files with 11 additions and 0 deletions
  1. 11 0
      android/app/build.gradle

+ 11 - 0
android/app/build.gradle

@@ -95,6 +95,17 @@ android {
         dataBinding true
         dataBinding true
     }
     }
 
 
+    applicationVariants.configureEach { variant ->
+        def date = new Date().format("YYMMddHHmmss")
+        variant.outputs.configureEach {
+            def fileName = "${defaultConfig.applicationId}" +
+                    "-v${defaultConfig.versionName}" +
+                    "-${variant.buildType.name}" +
+                    "-${date}" +
+                    ".apk"
+            outputFileName = fileName
+        }
+    }
 }
 }
 
 
 dependencies {
 dependencies {