Last active
August 29, 2018 09:26
-
-
Save nekocode/8165e406b1363892aa6b1a19df52199e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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