Gradle Goodness: Excluding Tasks for Execution
In Gradle we can create dependencies between tasks. But we can also exclude certain tasks from those dependencies. We use the command-line option -x or --exclude-task and specify the name of task we don't want to execute. Any dependencies of this task are also excluded from execution. Unless another task depends on the same task and is executed. Let's see how this works with an example:
00.task copySources << {01.println 'Copy sources.'02.}03. 04.task copyResources(dependsOn: copySources) << {05.println 'Copy resources.'06.}07. 08.task jar(dependsOn: [copySources, copyResources]) << {09.println 'Create JAR.'10.}11. 12.task deploy(dependsOn: [copySources, jar]) << {13.println 'Deploy it.'14.}We execute the deploy task:
$ gradle -q deploy Copy sources.Copy resources.Create JAR.Deploy it.Now we exclude the jar task. Notice how the copySources task is still executed because of the dependency in the deploy task:
$ gradle -q deploy -x jarCopy sources.Deploy it.Gradle Goodness: Excluding Tasks for Execution的更多相关文章
- Gradle Goodness: Adding Tasks to a Predefined Group
In Gradle we can group related tasks using the group property of a task. We provide the name of our ...
- 打包APK出现org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:lintVitalRelease'.
AndroidS Studio打包APK时出现问题:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':a ...
- Gradle Goodness: Task Output Annotations Create Directory Automatically
Gradle Goodness: Task Output Annotations Create Directory Automatically One of the great features of ...
- 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. ...
- org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
转载请注明出处:http://www.cnblogs.com/cnwutianhao/p/6709758.html Android Studio导入项目报错: org.gradle.api.inter ...
- Android studio Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to
http://blog.csdn.net/FlyRabbit_1/article/details/74536317 Error:org.gradle.api.internal.tasks.Defaul ...
- Gradle Goodness: Copy Files with Filtering
Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filterin ...
- Gradle Goodness: Continue Build Even with Failed Tasks
If we run a Gradle build and one of the tasks fails, the whole build stops immediately. So we have f ...
- Gradle Goodness: Group Similar Tasks
In Gradle we can assign a task to a group. Gradle uses the group for example in the output of $ grad ...
随机推荐
- ThreeJS文字作为纹理贴图
文字作为纹理贴图 From:http://www.linhongxu.com/post/view?id=222 这里可以使用canvas作为纹理贴图,Three为我们提供里CanvasTexture ...
- CSS3字体火焰燃烧效果
动画的CSS: // fire @keyframes fireDiv { 0% { text-shadow: 0 0 4px white, 0 -5px 4px #ff3, 2px -10px 6px ...
- 计算fibonacci数(多种方法)
#include <iostream> using namespace std; //计算fibonacci数 //方法一:二分递归法,时间复杂度为O(2^n),额外空间复杂度为常数 in ...
- ActiveMQ queue 代码示例
生产者: package com.111.activemq; import javax.jms.Connection; import javax.jms.ConnectionFactory; impo ...
- Asp.Net MVC4 系列-- 进阶篇之路由
原文 http://blog.csdn.net/lan_liang/article/details/22993839 创建一个路由 打开 RouteConfig.cs ,发现已经创建了一个默认路由 ...
- 以太网的 MAC 层
一.MAC 层的硬件地址 在局域网中,主机的硬件地址又称为物理地址,或 MAC 地址.6个字节. IEEE 的注册管理机构 RA 负责向厂家分配地址字段的前三个字节(即高位 24 位,组织唯一标识符O ...
- python 实现插入排序、冒泡排序、归并排序
def InsertSort(A): '''插入排序算法:传入一个list,对list中的数字进行排序''' print('插入排序前list元素顺序:',A) length=len(A) for i ...
- Qt中限制IP输入的正则表达式:
这个例子中,是使用QLineEdit加入正则表达式来实现ip地址的输入功能的,不符合规范的数据将不能输入: QRegExp regExpIP("((25[0-5]|2[0-4][0-9]|1 ...
- HTML5 拖放、交换位置
设置元素为可拖放 draggable 属性设置为 true: <img draggable="true" /> 拖动什么 - ondragstart 和 setData ...
- 对Java中的异常的理解
1.What is exception in Java? Java使用异常描述程序中可能出现的不正常情况.这个不正常可以是java认为的不正常,也可以是你主观上的出乎意料(自定义异常).总而言之,异常 ...