I'm converting a build from Maven to Gradle, and in it, we do some resource filtering. Specifically, we have a block that looks like this:
<build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<filters>
<filter>/path/to/more/resources.properties</filter>
<filter>/path/to/more/resources.properties</filter>
<filter>/path/to/more/resources.properties</filter>
</filters>
</build>
...and we want to get something similar in Gradle.
The documentation for the Copy tasks with filter in them aren't that complete and don't describe what specific problem(s) I'm attempting to solve:
- Filtering out specific resource files
- Keeping the POM style of variables in use (
${example.property}
) - Ensuring that the artifact makes its way into my WAR
How would I go about doing this?