I'm trying to upload to Crittercism on build, and I put this at the bottom of my gradle file. However, it doesn't seem to be working when I build debug. What am I doing wrong?
task uploadMappingToProd() << {
def critterAppId = "abcde"
def appVersionName = "1.0.1"
def appVersionCode = "DEBUG"
def critterKey = "12345"
commandLine 'curl',
"https://app.crittercism.com/api_beta/proguard/$critterAppId",
'-F', 'proguard=@build/outputs/mapping/production/release/mapping.txt',
'-F', "app_version=$appVersionName-$appVersionCode",
'-F', "key=$critterKey"
type Exec
dependsOn 'assembleDebug'
}
The way you've done it, the task that you have defined,
uploadMappingToProd, will if invoked by some reason also invokeassembleDebug. Because you have askeduploadMappingToProdto depend onassembleDebug- not the reverse. ThereforeassembleDebugwill happily finish without getting anywhere close touploadMappingToProd.If you want the reverse dependency i.e.
assembleDebugto depend onuploadMappingToProdthen you need to add this line after defining your task.This will guarantee
uploadMappingToProdis invoked everytime and beforeassembleDebugis invoked.