1. execute default file (build.gradle)

gradlew

2. execute another file

gradlew -b [filename]

3.  basic task

task ta {
println "from task ta"
}

another way to define task

task tc
tc.doLast{println "from task tc"}

4. task with left shift

will not be execute like this

gradlew

only execute when call task name

gradlew ta
task ta <<{
println "from task ta"
}

equal to

task ta {
doLast {
println "from task ta"
}
}

5. dependsOn

do before the task

task putOnSocks {
doLast {
println "Putting on Socks."
}
} task putOnShoes {
dependsOn "putOnSocks"
doLast {
println "Putting on Shoes."
}
}

6. finalizedBy

do after the task

task eatBreakfast {
finalizedBy "brushYourTeeth"
doLast{
println "Om nom nom breakfast!"
}
} task brushYourTeeth {
doLast {
println "Brushie Brushie Brushie."
}
}

7. copy task

task copyJpegs(type: Copy) {
from 'images'
include '*.jpg'
into 'build'
}

8. define a task type

// type definition
class HelloNameTask extends DefaultTask {
String firstName @TaskAction
void doAction() {
println "Hello, $firstName"
}
} // create a task with type
task helloName(type: HelloNameTask) {
firstName = 'Jeremy'
}

Gradle basic的更多相关文章

  1. 读懂 Gradle 的 DSL

    现在 Android 开发免不了要和 Gradle 打交道,所有的 Android 开发肯定都知道这么在 build.gradle 中添加依赖,或者添加配置批量打包,但是真正理解这些脚本的人恐怕很少. ...

  2. 错误异常 (1)Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly

    [已解决]Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) wil ...

  3. Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly

    Android Studio中出现提示: Gradle project sync failed. Basic functionality (eg. editing, debugging) will n ...

  4. Gradle Android Studio basic

    1. change gradle version in gradle/wrapper/gradle-wrapper.properties  change distributionUrl=http\:/ ...

  5. gradle中使用嵌入式(embedded) tomcat, debug 启动

    在gradle项目中使用embedded tomcat. 最开始部署项目需要手动将web项目打成war包,然后手动上传到tomcat的webapp下,然后启动tomcat来部署项目.这种手动工作通常还 ...

  6. Set up gradle HiveMind

    HiveMind is a comprehensive ERP application for service organizations. It includes a project managem ...

  7. [转]-Gradle使用手册(一):为什么要用Gradle?

    原文地址:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1. ...

  8. gradle gradlew 的使用

    jcenter() 仓库比 mavenCentral() 仓库快,因此最好将jcenter 放前面,这样下载速度最快. 使用本地软件仓库:repositories { flatDir { dirs ' ...

  9. Gradle使用手册(一):为什么要用Gradle?

    原文地址:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1. ...

随机推荐

  1. 大道至简---软件工程实践者的思想------------java伪代码形式读后感第一章

    import.java.大道至简.*; 1.编程的精义----愚公移山 /* 原始需求的产生:惩山北之塞,出入之迂 项目沟通的基本方式:聚室而谋曰 项目的目标:毕力平险,指通豫南,达于汉阴 技术方案: ...

  2. Nginx-uri、request_uri、document_uri之间的区别

    在nginx中有几个关于uri的变量,包括$uri.$request_uri.$document_uri,下面看一下他们的区别 :$request_uri: /stat.php?id=1585378& ...

  3. mvc 4 razor语法讲解和使用

    1.这里的  @{Layout="文件路径";}  代码块指定了整个项目默认所使用的布局文件(如图:) @RenderBody()对于所有的页面默认的情况下都会使用这个布局(Web ...

  4. Docker之Web-UI

    DockerUI 不支持多主机Command: docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock dock ...

  5. hbase shell基础和常用命令详解(转)

    HBase shell的基本用法 hbase提供了一个shell的终端给用户交互.使用命令hbase shell进入命令界面.通过执行 help可以看到命令的帮助信息. 以网上的一个学生成绩表的例子来 ...

  6. union select

    union select 联合查询 ,即合并(取交集,结果中没有重复行)前后两个查询:前提是前后查询视图必须拥有相同数量的列,列也必需拥有相同的数据类型. union all select 则取的是两 ...

  7. C#微信json结构接收参数 转载

    http://blog.csdn.net/u010773333/article/details/48524155 发素材的时间要上传资源故此要用json格式数据,需要转化. 微信服务器交互基本上都是j ...

  8. 便捷的php操作mysql库MysqliDb

    github 地址:https://github.com/joshcam/PHP-MySQLi-Database-Class MysqliDb -- Simple MySQLi wrapper and ...

  9. poj 2513 Colored Sticks trie树+欧拉图+并查集

    点击打开链接 Colored Sticks Time Limit: 5000MS   Memory Limit: 128000K Total Submissions: 27955   Accepted ...

  10. ORACLE 创建作业JOB例子

    --1.plsql中学习job   --学习job  --建表  create table test_job(para_date date);  commit;    insert into test ...