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 ...
随机推荐
- jq中的isArray方法分析,如何判断对象是否是数组
<!DOCTYPE html> <html> <head> <title>jq中的isArray方法分析</title> <meta ...
- JavaWeb学习总结(三):Servlet开发(一)
一.Servlet简介 Servlet是sun公司提供的一门用于开发动态web资源的技术. Sun公司在其API中提供了一个servlet接口,用户若想用发一个动态web资源(即开发一个Java程序向 ...
- Java常见异常类
NullpointException(空指针异常)ClassNotFoundException(类找不到异常)ClassCastException(类型转换异常)IllegalArgumentExce ...
- Python power spectral 功率谱
You can also use scipy.signal.welch to estimate the power spectral density using Welch’s method. Her ...
- 03_netty实现聊天室功能
[概述] 聊天室主要由两块组成:聊天服务器端(ChatRoomServer)和聊天客户端(ChatClient). [ 聊天服务器(ChatRoomServer)功能概述 ] 1.监听所有客户端的接入 ...
- ArcGIS 地类净面积计算工具
地类净面积计算工具可以自己定义图层.字段.地类代码计算任意图层的椭球面积.线状地物扣除.零星扣除和其他扣除,计算地类净面积计算:可以用于二调数据图斑地类.规划地块和基本农田等等需要计算净面积的都可以. ...
- [iOS] UIFont 设置字体
label.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:24]; 字体名如下: Font Family: Amer ...
- 自学git心得-5
标签管理也是git里面比较重要的一部分内容,我们下载软件的时候经常看到诸如v2.0.v2.3.0这样的版本号,在git里也是一样,有时为了避免分支的名称五花八门而发生混淆的情况,我们常常会 给分支贴上 ...
- Shell 编程备忘
变量使用 1. 定义变量: a=1 变量名=值 等号两端不能有空格 2. 变量值为数字或字符串,字符串 "this is adeom" 'this is a demo',双引号中可 ...
- 算法之杨辉三角形(Java语言)
杨辉三角形, 又称贾宪三角形.帕斯卡三角形. 前9层写出来如下: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 ...