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.

最新文章

  1. 航旅事业群面试(li)
  2. 网站跨站点脚本,Sql注入等攻击的处理
  3. [原创]在Linux系统Ubuntu14.04上安装部署docker。
  4. ASP.NET应用中会话状态丢失及解决策略
  5. Android_按两次返回键退出程序和长按返回键退出程序
  6. lintcode:二叉树的中序遍历
  7. Oracle 动态视图1 V$LOCK
  8. jsp中&lt;c:if&gt;与&lt;s:if&gt;的区别
  9. 【spring-boot】spring aop 面向切面编程初接触--切点表达式
  10. Python开发【第八篇】:网络编程
  11. Axure自动备份功能!让意外不在可怕!
  12. UML简单梳理类图
  13. PHP常用函数(一):数组常用函数
  14. webstorm破解版
  15. 转:Delta3D Editor编译成功
  16. [javaSE] 集合框架(共性方法)
  17. ---web模型 --mvc和模型--struts2 入门
  18. C# Winform backgroundWorker组件使用
  19. 简单实现MemCachedUtil
  20. 【转】获取Windows系统明文密码神器

热门文章

  1. ajax实现菜单联动显示信息(当选择单位的时候,动态关联出人员信息)
  2. 二 Channel
  3. ioc autofac简单示例
  4. 表格 滚动条 (tbody部分滚动)
  5. eayui grid 每一页的行号都是从1开始
  6. (C# 正则表达式)判断匹配, 提取字符串或数值
  7. ImageNet download
  8. 【活动】畅想云端加油站,赢iPad
  9. viirtualBox显示不了Ip并且无法上网的解决方式
  10. Eclipse 无法编译,提示“错误: 找不到或无法加载主类”