max
08/14/2018, 12:59 AMprocessResources
correctly. What I’m trying to do is: I have a file: src/main/res/xml/file.xml
which has a string like <external-path name="my_images" path="Android/data/{$appId}/files/Pictures/" />
. Now I’m trying to replace appId token in gradle build script as follows:
tasks {
withType<ProcessResources> {
filesMatching("${projectDir}/src/main/res/xml/file.xml") {
val tokens = mapOf("appId" to "myApplicationId")
expand(tokens)
}
outputs.upToDateWhen { false }
}
}
But that seems not working. Build finishes without errors, but if I open that xml file after artifact is produced, the template is not fulfilled. I spend on this a almost a day, please help me understand what’s wrong here.trevjones
08/14/2018, 3:25 AM${applicationId}
in any xml res file or does that only work in the manifest?max
08/14/2018, 6:11 PMsrc/res
not in src/resources
) will this task be useful at all? I can probably use from
method of this task for this?trevjones
08/14/2018, 6:13 PM