Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import groovy.json.JsonOutput
import com.google.common.io.Files
android.applicationVariants.all { variant ->
variant.assemble.doLast {
variant.outputs.each { output ->
def apkInfo = [
apk: output.outputFile.absolutePath,
versionCode: variant.versionCode,
versionName: variant.versionName
]
println apkInfo
def outFile = new File(project.getRootDir(), "${variant.name}.json")
Files.createParentDirs(outFile)
outFile.write(JsonOutput.toJson(apkInfo))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.