I currently have a Gradle project making use of processResources
in order to expand certain identifiers in a file. The problem is, said file contains references to a couple of Java classes by package location, and one of these happens to be a static subclass.
my processResources
block is as follows:
processResources {
inputs.property "version", project.version
filesMatching("info.json") {
expand "version": project.version
}
}
The file info.json
contains the following:
{
"schemaVersion": 1,
...
"version": "${version}",
...
"entrypoints": {
"main": ["com.example.Entrypoint"],
"client": ["com.example.Entrypoint$Client"],
...
}
When attempting to build using these, Gradle has problems dealing with the subclass reference as it mistakes it for a Groovy template expansion and hence cannot find a Client
property to expand with.
How might this be worked around such that the subclass reference can be kept? My first instinct would be to try to exclude a certain line from being processed/expanded, though I’m open to suggestions on a more sustainable approach than that.