Gradle basic
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的更多相关文章
- 读懂 Gradle 的 DSL
现在 Android 开发免不了要和 Gradle 打交道,所有的 Android 开发肯定都知道这么在 build.gradle 中添加依赖,或者添加配置批量打包,但是真正理解这些脚本的人恐怕很少. ...
- 错误异常 (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 ...
- 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 ...
- Gradle Android Studio basic
1. change gradle version in gradle/wrapper/gradle-wrapper.properties change distributionUrl=http\:/ ...
- gradle中使用嵌入式(embedded) tomcat, debug 启动
在gradle项目中使用embedded tomcat. 最开始部署项目需要手动将web项目打成war包,然后手动上传到tomcat的webapp下,然后启动tomcat来部署项目.这种手动工作通常还 ...
- Set up gradle HiveMind
HiveMind is a comprehensive ERP application for service organizations. It includes a project managem ...
- [转]-Gradle使用手册(一):为什么要用Gradle?
原文地址:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1. ...
- gradle gradlew 的使用
jcenter() 仓库比 mavenCentral() 仓库快,因此最好将jcenter 放前面,这样下载速度最快. 使用本地软件仓库:repositories { flatDir { dirs ' ...
- Gradle使用手册(一):为什么要用Gradle?
原文地址:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1. ...
随机推荐
- vi编辑器使用相关
一.vi的使用 1.vi一共分为3种模式,分别是一般模式.编辑模式和命令行模式 2.一般模式:以vi打开一个文件就直接进入一般模式(也是默认的模式). 在这个模式下可以使用上下左右移动光标,还可以删除 ...
- Unable to create a constant value of type 'Closure type'
使用Linq to Entities的时候发生如下异常: Unable to create a constant value of type 'Closure type'. Only primitiv ...
- Nginx php-fpm php mysql
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm ...
- eclipse 设置默认编码为Utf-8
Window->Preferences->General ->Content Type->Text->JSP 最下面设置为UTF-8 Window->Prefere ...
- perl读取文件
1)文件读取的3中方法 按行读,存入标量 while (<FILE>) { print; } 按行读,存入数组 @array = <FILE>; 读入整个文件 ,存入标量 ...
- windows下用一台机器配置分布式redis(主从服务器)
目录1.Replication的工作原理2.如何配置Redis主从复制 1.Replication的工作原理在Slave启动并连接到Master之后,它将主动发送一条SYNC命令.此后Master将启 ...
- My Package
一.新建一文件夹,名称为MyBase,存放Java的基本类. 二.在MyBase包中创建基本类Base.java. package MyBase; public class Base { public ...
- PHP发送请求头和接收打印请求头
一.发送请求头 //发送地址 $url = 'http://127.0.0.1/2.php'; //请求头内容 $headers = array( 'Authorization: '.$basic, ...
- 不是技术牛人,如何拿到国内IT巨头的Offer(转载)
转载的文章,中间有几段需要去学习. byvoid 面阿里星计划的面试结果截图泄漏,引起无数IT屌丝的羡慕敬仰.看看这些牛人,NOI金牌,开源社区名人,三年级开始写Basic-在跪拜之余我们不禁要想,和 ...
- 4. read命令
4.1 作用 从标准输入中读取一行. 4.2 参数 -p 允许在read命令行中直接指定一个提示. -t 给用户的输入作限时规定. -n 规定read后变量所接收的字符的个数. -s 使得read命令 ...