0
以下gradle这个构建脚本摇篮任务执行
task hello << {
println "task hello"
}
hello << {
println "th"
}
产生输出:
task hello
th
但一个人的顺序逆转造成的错误:
* What went wrong:
A problem occurred evaluating root project
> Could not find property 'hello' on root project
是什么样的错误?你能用Groovy的观点来解释吗?
当然,如果你真的只是交换这些代码段,那么第一个代码段就不会有任何“任务”。 – 2014-10-04 15:54:51