i have this task:
task plugin(type: Zip) {
baseName = project.name
version = project.version
def allExcluded = [];
from (configurations.compile) {
exclude(allExcluded)
into ('libs/')
}
from (sourceSets.main.output.classesDir) {
into ('classes/')
}
.....
doLast {
def excluded = ["org.intellimate.izou:izou"];
def recursiveAdd
recursiveAdd = { dep ->
allExcluded.add("${dep.module.id.name}-${dep.module.id.version}.jar".toString())
dep.children.each { childResolvedDep ->
if(dep in childResolvedDep.getParents() && childResolvedDep.getConfiguration() == 'compile'){
recursiveAdd(childResolvedDep);
}
}
}
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
if (excluded.contains("${dep.module.id.group}:${dep.module.id.name}".toString())) {
recursiveAdd(dep)
}
}
println allExcluded
}
}
i prints [izou-1.16.5.jar,...yamlbeans-1.09.jar]
, so the list gets populated, but somehow it does not exclude the files. is my usage of doLast causing this?