avatar

在gradle中设置打包秘钥及输出apk名称

在gradle中设置打包秘钥及输出apk名称

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def projectName = "projectName"
android {
signingConfigs {
debug {
storeFile file("./debug.keystore")
storePassword '123456'
keyAlias 'key0'
keyPassword '123456'
}
release {
storeFile file("./debug.keystore")
storePassword '123456'
keyAlias 'key0'
keyPassword '123456'
}
}
applicationVariants.all { variant ->
variant.outputs.all {
String fileName = projectName + defaultConfig.versionName + buildType.name + ".apk"
println "fileName:" + fileName
outputFileName = fileName;
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
文章作者: pengweifu
文章链接: https://www.pengwf.com/2019/11/26/android/ANDROID-gradle/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 麦子的博客
打赏
  • 微信
    微信
  • 支付宝
    支付宝

评论