def crtateDir = {
path ->
File dir =new File(path);
if (!dir.exists()) {
dir.mkdir();
}
};
task makeJavaDir() {
def paths = ['src/main/java','src/main/resources','src/test/java','src/test/resources'];
doLast{
paths.forEach(crtateDir);
}
}
你可以看看 闭包中的path 是什么! 不调试就直接问