I have an archiving task which selects a file like this:
into(‘META-INF’) {
from ‘deployment’, {
include ‘applicationContext.xml’
rename { fn -> 'jboss-spring.xml" }
}
}
Before this file is included in the archive, I’d like to apply a patch file to it, ideally something like this:
into(‘META-INF’) {
from ‘deployment’, {
include ‘applicationContext.xml’
rename { fn -> ‘jboss-spring.xml’ }
patch ‘local/applicationContext.xml.patch’
}
}
This, of course, doesn’t work - but what I want it to do is to apply the patch found in /local/applicationContext.xml.patch to the included file before putting it in the archive.
I could manually copy the input file to a temp location, apply the patch file to the copy (using ant.patch or something else) and then include the patched copy instead, but I’m wondering if there’s a “better” (shorter and more idiomatic) way of doing this.