Skip to content
Snippets Groups Projects
Commit f0c05a28 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Process output filename at build time

It was executed at configuration time
parent bba58dcb
No related branches found
No related tags found
No related merge requests found
......@@ -138,19 +138,21 @@ android {
// make per-variant version code
applicationVariants.all { variant ->
def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
// get the version code of each flavor
def vlcVersion = manifestParser.getVersionName()
def abiVersion = variant.productFlavors.get(0).versionCode
// set the composite code
variant.mergedFlavor.versionCode = 10000000 + manifestParser.versionCode + abiVersion
variant.mergedFlavor.versionName = vlcVersion
//Custom APK name
variant.outputs.each { output ->
def outputName = "VLC-Android-" + vlcVersion + "-" + variant.productFlavors.get(0).name + ".apk"
output.outputFile = new File(output.outputFile.parentFile, outputName);
variant.getGenerateBuildConfig().doLast {
def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
// get the version code of each flavor
def vlcVersion = manifestParser.getVersionName()
def abiVersion = variant.productFlavors.get(0).versionCode
// set the composite code
variant.mergedFlavor.versionCode = 10000000 + manifestParser.versionCode + abiVersion
variant.mergedFlavor.versionName = vlcVersion
//Custom APK name
variant.outputs.each { output ->
def outputName = "VLC-Android-" + vlcVersion + "-" + variant.productFlavors.get(0).name + ".apk"
output.outputFile = new File(output.outputFile.parentFile, outputName);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment