Tower Guide
02/10/2022, 12:24 PMTower Guide
02/10/2022, 12:31 PMmobile-android/app/newrelic.properties
how can i employ gradle to create this file in the correct location with the required environment token?rekire
02/10/2022, 12:36 PMno
02/10/2022, 12:45 PMTower Guide
02/10/2022, 12:45 PMproductFlavors {
development {
dimension "default"
buildConfigField 'String', 'NEW_RELIC_TOKEN', '"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-YYYYY"'
}
staging {
dimension "default"
buildConfigField 'String', 'NEW_RELIC_TOKEN', '"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ-YYYYY"'
}
production {
dimension "default"
buildConfigField 'String', 'NEW_RELIC_TOKEN', '"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH-YYYYY"'
}
}
when i build for either of the three defined "flavours" the correct token is used
however I also need to use the correct token in the flat file documented above
does gradle support dynamically populating a file or dynamically creating a file within my project structureTower Guide
02/10/2022, 12:46 PMrekire
02/10/2022, 12:49 PMTower Guide
02/10/2022, 12:50 PMrekire
02/10/2022, 12:52 PMrekire
02/10/2022, 12:54 PMVampire
02/10/2022, 1:31 PMmobile-android/app/newrelic.properties
in src/main/resources
with a placeholder for the value, then you configure the processResources
task to filter
the file content where one filter is to replace such placeholders.
I just don't know how it is with Android in the play, whether you can configure the task according to the flavor, or whether there are different tasks or whatever as I don't do any Android.rekire
02/10/2022, 1:33 PM