Commit 55a8084e authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 911fc445
...@@ -10,17 +10,17 @@ apply plugin: 'kotlin-allopen' ...@@ -10,17 +10,17 @@ apply plugin: 'kotlin-allopen'
def buildVersion def buildVersion
android { android {
File versionPropsFile = file('./version.properties') // File versionPropsFile = file('./version.properties')
//
Properties versionProps = new Properties() // Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile)) // versionProps.load(new FileInputStream(versionPropsFile))
//
buildVersion = versionProps['VERSION_BUILD'].toLong() + 1 // buildVersion = versionProps['VERSION_BUILD'].toLong() + 1
versionProps['VERSION_BUILD'] = buildVersion.toString() // versionProps['VERSION_BUILD'] = buildVersion.toString()
versionProps.store(versionPropsFile.newWriter(), null) // versionProps.store(versionPropsFile.newWriter(), null)
//
defaultConfig { defaultConfig {
buildConfigField ("int","BUILD_VERSION","${buildVersion}") // buildConfigField ("int","BUILD_VERSION","${buildVersion}")
} }
noArg { noArg {
......
#Sat Jul 10 14:13:39 CST 2021 #Sat Jul 10 14:10:09 CST 2021
VERSION_BUILD=2725 VERSION_BUILD=2725
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment