Created
October 15, 2014 07:12
-
-
Save AlexKorovyansky/a334c9a758b2944e673c to your computer and use it in GitHub Desktop.
Hook newrelic.properties for auto switch between debug and release builds.
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
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