|
|
@ -19,22 +19,23 @@ if (flutterVersionCode == null) {
|
|
|
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
|
|
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
|
|
|
if (flutterVersionName == null) {
|
|
|
|
if (flutterVersionName == null) {
|
|
|
|
flutterVersionName = '1.0'
|
|
|
|
flutterVersionName = '1.0'
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//截取版本号最后一段数字
|
|
|
|
|
|
|
|
def tem1=Integer.parseInt(flutterVersionName.substring(flutterVersionName.lastIndexof(".")+1,flutterVersionName.length()))
|
|
|
|
|
|
|
|
tem1++
|
|
|
|
|
|
|
|
//组成新的版本号,并更新localProperties对象和fluttervarsionName变量
|
|
|
|
|
|
|
|
def newVersionName=flutterVersionName.substring(0,flutterVersionName.lastIndexof(".")+1)+tem1
|
|
|
|
|
|
|
|
localProperties.setProperty("flutter.versionName",newVersionName)
|
|
|
|
|
|
|
|
flutterVersionName=newVersionName
|
|
|
|
|
|
|
|
//localproperyies对象转换成string,并更新local.properties文件
|
|
|
|
|
|
|
|
def newLocalProperties=localProperties.toString()
|
|
|
|
|
|
|
|
newLocalProperties =newLocalProperties.replace(",","\n")
|
|
|
|
|
|
|
|
newLocalProperties =newLocalProperties.replace("{","")
|
|
|
|
|
|
|
|
newLocalProperties =newLocalProperties.replace("}","")
|
|
|
|
|
|
|
|
localPropertiesFile.write(newLocalProperties)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//else{
|
|
|
|
|
|
|
|
// //截取版本号最后一段数字
|
|
|
|
|
|
|
|
// def tem1=Integer.parseInt(flutterVersionName.substring(flutterVersionName.lastIndexof(".")+1,flutterVersionName.length()))
|
|
|
|
|
|
|
|
// tem1++
|
|
|
|
|
|
|
|
// //组成新的版本号,并更新localProperties对象和fluttervarsionName变量
|
|
|
|
|
|
|
|
// def newVersionName=flutterVersionName.substring(0,flutterVersionName.lastIndexof(".")+1)+tem1
|
|
|
|
|
|
|
|
// localProperties.setProperty("flutter.versionName",newVersionName)
|
|
|
|
|
|
|
|
// flutterVersionName=newVersionName
|
|
|
|
|
|
|
|
// //localproperyies对象转换成string,并更新local.properties文件
|
|
|
|
|
|
|
|
// def newLocalProperties=localProperties.toString()
|
|
|
|
|
|
|
|
// newLocalProperties =newLocalProperties.replace(",","\n")
|
|
|
|
|
|
|
|
// newLocalProperties =newLocalProperties.replace("{","")
|
|
|
|
|
|
|
|
// newLocalProperties =newLocalProperties.replace("}","")
|
|
|
|
|
|
|
|
// localPropertiesFile.write(newLocalProperties)
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
|
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
|
@ -74,7 +75,15 @@ android {
|
|
|
|
// JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
|
|
|
// JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
|
|
|
// ]
|
|
|
|
// ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// productFlavors {
|
|
|
|
|
|
|
|
// demo {
|
|
|
|
|
|
|
|
// //...
|
|
|
|
|
|
|
|
// versionName "1.1-demo"
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// full {
|
|
|
|
|
|
|
|
// //...
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
signingConfigs {
|
|
|
|
signingConfigs {
|
|
|
|
release {
|
|
|
|
release {
|
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|