AndroidManifest.xml versionCode is now automatically updated (required for pushing to F-droid)
This commit is contained in:
parent
a3e72283f8
commit
d91740c222
2 changed files with 18 additions and 1 deletions
|
|
@ -60,3 +60,12 @@ ext.getDebugVersion = { ->
|
|||
ext.getReleaseVersion = { ->
|
||||
return "${generateVersionName()} (${getCurrentGitHash()})"
|
||||
}
|
||||
|
||||
ext.updateManifestVersion = { currentVersion ->
|
||||
def manifestFile = file("src/main/AndroidManifest.xml")
|
||||
def pattern = ~"versionCode=\"([^\"]+)\""
|
||||
def matcher = pattern.matcher(manifestFile.getText())
|
||||
matcher.find()
|
||||
def newManifest = matcher.replaceAll("versionCode=\"" + (currentVersion + 1) + "\"")
|
||||
manifestFile.write(newManifest)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue