zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    ALV 填值返回更新屏幕
    alv 的几种形式 和 函数
    JS 截取字符串的空格
    codeigniter 轻量级架构知识初习
    之前的博客挂掉了
    在服务器上运行php文件来执行操作
    浏览器判断
    php 汉字判断
    web 套打方法实现打印机功能
    WIN8
  • 原文地址:https://www.cnblogs.com/GoAhead/p/4187640.html
Copyright © 2011-2022 走看看