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 << printTaskNameAction
5.
6.
task second(dependsOn: first) << printTaskNameAction
7.
8.
task third(dependsOn: [first, second]) << printTaskNameAction
To 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 SKIPPED
BUILD SUCCESSFUL
Total 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 ...
随机推荐
- Java温故而知新(4)类String字符串
字符串是由字符组成,在Java中,字符串是对象,是描述字符的基本数据结构.String类可以用来保存一个字符串,本类是最终类,不允许继承: 1.String对象的创建 初始化 由于String对象特别 ...
- Java接口和抽象类理解(New)
一. 抽象类和接口的特点 包含抽象方法的类称为抽象类,但并不意味着抽象类中只能有抽象方法,它和普通类一样,同样可以拥有成员变量和普通的成员方法.注意,抽象类和普通类的主要有三点区别: 1)抽象方法必 ...
- CRLF与LF解析
window和mac的同学合作开发项目,会出现git提交/拉取时换行符不一致导致,提示 "the text is identical, but the files do not match, ...
- vue支付密码
从网上搜索了好多都很麻烦,花了点事件自己做了个,简单轻便,老少皆宜 <template> <section class="pay-mask" @click=&qu ...
- Java jsp 自定义标签
1 自定义标签 1.1 引入 需求: 向浏览器输出当前客户的IP地址 (只能使用jsp标签) 1.2 第一个自定义标签开发步骤 1)编写一个普通的java类,继承SimpleTagSupport类,叫 ...
- 解决Maven 报 Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE. 的错误
最近在搭建公司的基础框架,业务需求用到elasticsearch,所以需要整合到基础框架里,供各业务线使用同时也便于管理,但在整合的过程中,出现了莫名的问题,同时maven的提示也不够明确. 我的版本 ...
- Shared Project
从VS2015开始支持Shared Project,挺好的,省去了单独引用的麻烦.
- ToolBar 简单使用
ToolBar 简单使用 ToolBar 是在 android 5.0之后推出的一款用来替代 ActionBar 的 View.ActionBar 是Activity的一部分,不能用在其他视图层次上( ...
- 基于容器微服务的PaaS云平台设计(一) 实现容器微服务和持续集成
版权声明:本文为博主原创文章,欢迎转载,转载请注明作者.原文超链接 ,博主地址:http://www.cnblogs.com/SuperXJ/ 前言:关于什么是容器微服务PaaS和容器微服务PaaS的 ...
- tpcc-mysql安装测试与使用生成对比图
1:下载tpcc-mysql的压缩包,从下面的网站进行下载 https://github.com/Percona-Lab/tpcc-mysql 也可直接从叶总博客直接下载: http://imysql ...