Created
October 27, 2014 19:45
-
-
Save pdegand/bb24517024189ffc47b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
variant.outputs.each { output -> | |
task("handle${variant.name.capitalize()}WearDesc") << { | |
def apkFileName = "wear-${variant.flavorName}-${variant.buildType.name}.apk" | |
File wearDescFile = file("${output.processResources.resDir}/xml/wear_desc.xml") | |
String content = wearDescFile.getText('UTF-8') | |
content = content.replaceAll(/APPICATION_ID/, "${variant.mergedFlavor.applicationId}") | |
content = content.replaceAll(/VERSION_CODE/, "${variant.mergedFlavor.versionCode}") | |
content = content.replaceAll(/VERSION_NAME/, "${variant.mergedFlavor.versionName}") | |
content = content.replaceAll(/WEAR_BUILD/, apkFileName) | |
wearDescFile.write(content, 'UTF-8') | |
} | |
} | |
output.processManifest.dependsOn("handle${variant.name.capitalize()}WearDesc") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment