How do I build a war file with Gradle using a copySpec containing filesMatching -
so, works:
war { filesmatching('**/index.jsp') { filter(org.apache.tools.ant.filters.replacetokens, tokens: [ 'version' : version, ]) } }
but not:
def webappfilter = project.copyspec { filesmatching('**/index.jsp') { filter(org.apache.tools.ant.filters.replacetokens, tokens: [ 'version' : version, ]) } } war { webappfilter }
obviously, i'm doing wrong, can't understand i'm missing. can help?
i had similar problems copyspecs gradle not using them. after having tried out many variants worked me when adding copy closure copyspec.
def cs = copyspec { copy { from("readme.txt") into("somefolder") filter{string line -> line.replaceall('a','b')} } } task mycopy (type: copy) { cs }
hope helps.
Comments
Post a Comment