Gradle Goodness: Check Task Dependencies With a Dry Run
We can run a Gradle build without any of the task actions being executed. This is a so-called dry run of our build. We can use the dry run of a build to see if the task dependencies we have defined or are defined in a plugin are defined properly. Because all tasks and task dependencies are resolved if we use the dry run mode we can see in the output which tasks are executed.
We define a simple build file with three tasks and some task dependencies:
0.def printTaskNameAction = {1.println "Running ${it.name}"2.}3. 4.task first << printTaskNameAction5. 6.task second(dependsOn: first) << printTaskNameAction7. 8.task third(dependsOn: [first, second]) << printTaskNameActionTo run a Gradle build as a dry run we can use the command line option -m or --dry-run. So let's execute the task third with the dry run command line option:
$ gradle -m third:first SKIPPED:second SKIPPED:third SKIPPEDBUILD SUCCESSFULTotal time: 2.242 secs$ And we see in the output none of the tasks are really executed, because SKIPPED is shown, but we do see the task names of the tasks that are resolved.
Written with Gradle 2.2.
Gradle Goodness: Check Task Dependencies With a Dry Run的更多相关文章
- Gradle Goodness: Skip Building Project Dependencies
If we use Gradle in a multi-module project we can define project dependencies between modules. Gradl ...
- Gradle Goodness: Working with Live Task Collection
Gradle support the definition of so called live collections. These collections are mostly created ba ...
- Gradle Goodness: Task Output Annotations Create Directory Automatically
Gradle Goodness: Task Output Annotations Create Directory Automatically One of the great features of ...
- Gradle Goodness: Excluding Tasks for Execution
In Gradle we can create dependencies between tasks. But we can also exclude certain tasks from those ...
- Gradle Goodness: Copy Files with Filtering
Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filterin ...
- Gradle Goodness: Init Script for Adding Extra Plugins to Existing Projects
Gradle Goodness: Init Script for Adding Extra Plugins to Existing Projects Gradle is very flexible. ...
- Gradle Goodness: Using and Working with Gradle Version
To get the current Gradle version we can use the gradleVersion property of the Gradle object. This r ...
- Gradle Goodness: Automatic Clean Tasks
Gradle adds the task rule clean<Taskname> to our projects when we apply the base plugin. This ...
- Gradle Goodness: Changing Name of Default Build File
Gradle uses the name build.gradle as the default name for a build file. If we write our build code i ...
随机推荐
- div 居中方法汇总
本文是从简书复制的, markdown语法可能有些出入, 想看"正版"和更多内容请关注 简书: 小贤笔记 情况一: 父子容器宽高已知 方法一 html <div class= ...
- VS.Net开发必备,让您的代码自动收缩,如何实现!
一年前,不知在哪里看到这个开发辅助插件,就装上了,之后一直不知不觉得用着,有一天重装了系统,这插件不见了,再也记不起他的名字, 在网上搜索"自动收缩代码","VS开发必备 ...
- Windows操作系统下给文件夹右键命令菜单添加启动命令行的选项
在命令行中或按下[WIN]+[R]键启动运行对话框的情况下,输入regedit命令启动注册表编辑器,在HKEY_CLASSES_ROOT\Folder\shell下增加一个“CMD”(此处名字可以随便 ...
- *p++、*++p、(*p)++区别
关于数组指针的谜题 假设 p 是指向数组 arr 中第 n 个元素的指针,那么 *p++.*++p.(*p)++ 分别是什么意思呢? *p++ 等价于 *(p++),表示先取得第 n 个元素的值,再将 ...
- Netty入门2之----手动搭建HttpServer
在上一章中我们认识了netty,他有三大优点:并发高,传输快,封装好.在这一章我们来用Netty搭建一个HttpServer,从实际开发中了解netty框架的一些特性和概念. netty.png 认识 ...
- SQL点点滴滴_DELETE小计
惨痛的教训: 某次在执行delete时,一时疏忽忘记写where条件了, 1.删除tb_mobile_cust_micromsg中的内容,前提是c_customer这个字段的值与#datamod表中c ...
- Stack vs Heap
http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html Table of Contents Stack vs Heap The Stac ...
- [python错误]UnicodeDecodeError: 'gbk' codec can't decode byte...
出现此错误的原因是使用'gbk'解码时报错,存在一些字符不能使用gbk来解码. 首先,简体中文字符编码(ASCII扩展字符集)有下列几种:GB2312.GBK.GB18030. GB2312: 中国国 ...
- php大文件上传失败的原因及解决方法
为什么上传大文件总是失败,上传小文件就没有问题.关于PHP大文件上传失败的原因及解决方法如下: 第1种情况:文件上传时存放文件的临时目录必须是开启的并且是 PHP 进程所有者用户可写的目录.如果未指定 ...
- 获取所有权windows目录所有权
Takeown /r /f 盘符:\目录\目录 例如: Takeown /r /f C:\Windows\CSC