首页 > 代码库 > 动态任务

动态任务

所谓动态任务,就是动态生成task,举例如下

4.times{counter->    task "hello6$counter"<<{        println("Hello World6$counter")    }}
zhangliuningdeMacBook-Pro:learning-gradle-demo01 sherry$ gradle -q hello61Hello World61zhangliuningdeMacBook-Pro:learning-gradle-demo01 sherry$ gradle -q hello62Hello World62

上述就生成了四个task任务

动态任务