In the example below, the tasks “war” and “expandedWar” both have the same configuration (from…). Is it possible to reuse that configuration (which is shown as the unused closure “operations”), to avoid having to duplicate it in the two tasks?
def operations = {
from ("src/iknowbase/libs/jquery/") {
include "jquery-${jqueryVersion}*"
into "iknowbase/libs/jquery"
rename { String fileName ->
fileName.replace("-${jqueryVersion}", '-latest')
}
}
}
war {
from ("src/iknowbase/libs/jquery/") {
include "jquery-${jqueryVersion}*"
into "iknowbase/libs/jquery"
rename { String fileName ->
fileName.replace("-${jqueryVersion}", '-latest')
}
}
}
task expandedWar (type:Copy) {
from "src"
into "target/build"
from ("src/iknowbase/libs/jquery/") {
include "jquery-${jqueryVersion}*"
into "iknowbase/libs/jquery"
rename { String fileName ->
fileName.replace("-${jqueryVersion}", '-latest')
}
}
}
