Skip to content

Instantly share code, notes, and snippets.

@afshin-hoseini
Created February 23, 2017 05:56
Show Gist options
  • Save afshin-hoseini/80e40216c675296ec41d9ca5f0673093 to your computer and use it in GitHub Desktop.
Save afshin-hoseini/80e40216c675296ec41d9ca5f0673093 to your computer and use it in GitHub Desktop.
Change android output files in module level build gradle file
//Put this in android block
libraryVariants.all { variant ->
variant.outputs.each { output ->
println("---> Variant name: " + variant.getName())
println("---> Variant base name: " + variant.getBaseName())
println("---> Variant Assemble: " + variant.getAssemble())
def outputFile = output.outputFile
println("---> OUT PUT PARENT: " + outputFile.parent);
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "SpotBaseLib-${variant.getBaseName()}-${defaultConfig.versionName}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment