qianhuis-Mac-mini:1225 qianhui$ touch build.gradle
vi build.gradle
定义了一个任务hello,在该任务执行完后打印Hello world!
执行任务
qianhuis-Mac-mini:1225 qianhui$ gradle -q upper Original:mY_nAmE Upper case:MY_NAME qianhuis-Mac-mini:1225 qianhui$
执行
qianhuis-Mac-mini:1225 qianhui$ gradle -q count 0 1 2 3
执行
qianhuis-Mac-mini:1225 qianhui$ gradle -q intro Hello world! I'm Gradle
qianhuis-Mac-mini:1225 qianhui$ gradle -q taskX taskY taskX
4.times { counter->task "task$counter" << { println "I'm task number $counter" } }
qianhuis-Mac-mini:1225 qianhui$ gradle -q task1 I'm task number 1
4.times { counter->task "task$counter" << { println "I'm task number $counter" } } task0.dependsOn task1,task2
qianhuis-Mac-mini:1225 qianhui$ gradle -q task0 I'm task number 1 I'm task number 2 I'm task number 0
task hello << { println 'Hello world!' } hello.doFirst{ println 'Hello Venus' } hello.doLast{ println 'Hello Mars' } hello << { println 'Hello Jupiter' }