Skip to content

Instantly share code, notes, and snippets.

@AlexKorovyansky
Created October 15, 2014 07:12
Show Gist options
  • Save AlexKorovyansky/a334c9a758b2944e673c to your computer and use it in GitHub Desktop.
Save AlexKorovyansky/a334c9a758b2944e673c to your computer and use it in GitHub Desktop.
Hook newrelic.properties for auto switch between debug and release builds.
android.applicationVariants.all { variant ->
task ("prepareNewRelicProperties${variant.name.capitalize()}"){
doLast {
copy {
from variant.buildType.debuggable ? "${project.projectDir}/src/debug/newrelic.properties" : "${project.projectDir}/src/release/newrelic.properties"
into "${project.projectDir}"
}
}
}
tasks.getByName("prepare${variant.name.capitalize()}Dependencies").dependsOn("prepareNewRelicProperties${variant.name.capitalize()}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment