gradle - How to run multiple filters on various file types in processResources -


i'm trying processing on source before moving build directory. specifically, files .template name, replace instances of @timestamp@ timestamp variable i've defined. additionally, .jsp files, remove whitespace between tags.

the first part of this, replacing timestamp works. replacing whitespace in jsps not.

processresources {     def timestamp = long.tostring(system.currenttimemillis())     ('../src/resources/webapp') {         include '**/*.template'         filter {             it.replace('@timestamp@', timestamp)         }         rename '(.*)\\.template', '$1'     }     ('../src/resources/webapp') {         include '**/*.jsp'         filter {             it.replace('>\\s+<', '><')         }     } } 

previous using processresources, had done minification:

task minifyjsps(type: copy) {     ('../src/resources/webapp') {         include '**/*.jsp'         filter {             it.replace('>\\s+<', '><')         }     }     'gbuild' } 

filtering files using copy worked, however, noticed wasn't able copy location -- file end empty. meant had copy files 1 intermediate directory another, applying filter @ each step.

i want able apply various transformations source in 1 step. how can fix processresources task?


Comments