Gradle Goodness: Display Available Tasks
To see which tasks are available for our build we can run Gradle with the command-line option -t or --tasks. Gradle outputs the available tasks from our build script. By default only the tasks which are dependencies on other tasks are shown. To see all tasks we must add the command-line option --all.
00.3.times { counter ->01.task "lib$counter" {02.description = "Build lib$counter"03.if (counter > 0) {04.dependsOn = ["lib${counter - 1}"]05.}06.}07.} 08. 09.task compile {10.dependsOn { 11.project.tasks.findAll { 12.it.name.startsWith('lib')13.}14.}15.description = "Compile sources"16.}$ gradle -q -t------------------------------------------------------------Root Project------------------------------------------------------------Tasks-----:compile - Compile sources$ gradle -q --tasks -all------------------------------------------------------------Root Project------------------------------------------------------------Tasks-----:compile - Compile sources:lib0 - Build lib0:lib1 - Build lib1:lib2 - Build lib2But if we add our tasks to a group, we get even more verbose output. Gradle will group the tasks together and without the --all option we get to see all tasks belonging to the group, even those that are dependency tasks. And with the --all option we see for each task on which tasks it depends on. So by setting the group property on the task we get much better output when we ask Gradle about the available tasks.
00.3.times { counter ->01.task "lib$counter" {02.description = "Build lib$counter"03.if (counter > 0) {04.dependsOn = ["lib${counter - 1}"]05.}06.}07.} 08. 09.task compile {10.dependsOn { 11.project.tasks.findAll { 12.it.name.startsWith('lib')13.}14.}15.description = "Compile sources"16.}17. 18.tasks*.group = 'Compile'$ gradle -q -t------------------------------------------------------------Root Project------------------------------------------------------------Compile tasks-------------:compile - Compile sources:lib0 - Build lib0:lib1 - Build lib1:lib2 - Build lib2$ gradle -q --tasks -all------------------------------------------------------------Root Project------------------------------------------------------------Compile tasks-------------:compile - Compile sources [:lib0, :lib1, :lib2]:lib0 - Build lib0:lib1 - Build lib1 [:lib0]:lib2 - Build lib2 [:lib1]Gradle Goodness: Display Available Tasks的更多相关文章
- 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 ...
- Gradle Goodness: Automatic Clean Tasks
Gradle adds the task rule clean<Taskname> to our projects when we apply the base plugin. This ...
- 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: 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. ...
- Gradle Goodness: Copy Files with Filtering
Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filterin ...
- 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 ...
- 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: 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 ...
随机推荐
- CF235C Cyclical Quest
题意 给定一个长度为\(n\)的母串 \(q\)组询问 这个串可以旋转(就是把最后一位丢到最前面这样子) 问这个串以及其旋转的串在给定的串中出现了多少次 Sol 旋转就把它复制一遍接在后面 然后就在\ ...
- luogu P3065 first——trie树相关
题目描述 Bessie has been playing with strings again. She found that by changing the order of the alphabe ...
- HTML contenteditable 属性
contenteditable 属性是 HTML5 中的新属性,所有的主流浏览器都支持 contenteditable 属性. contenteditable 属性规定了元素内容是否可编辑. * 如果 ...
- 利用Ogr将Kml转为Shape【1】
最近在研究Kml怎么转化为Shape文件,因为客户中很多在原来采集了一部分数据都是在google Earth中,而我们的应用中特别需要这份数据,所以打算先在GE中把这份数据导出为Kml或Kmz文件,然 ...
- 已注册成Portal联合服务器的Server,如何修改机器名?
1.产品版本 ArcGIS for Server 10.2.2 2.修改说明 本环境中,Portal for ArcGIS和ArcGIS for Server两个产品安装在同一台机器上.安装前已将完全 ...
- 新手,再来1个 vue2入门的教程,有源码参考
在这之前有入门的,作者写的不错的, 照着来一下,也收益颇多,上个例子是基于 "dependencies": { "vue": "^2.2.6&qu ...
- 如何在Ubuntu上安装gcc-6.3
装显卡驱动推荐 gcc 6.3 版本,其实linux上多个版本的gcc是可以共存的,需要的的时候切换就好,参加之前的博客 https://www.cnblogs.com/jins-note/p/951 ...
- AutoCAD LoadLibrary Failed with error 126 Message
LoadLibrary Failed with error 126 Message BY C3DISH ON 26 MAY, 2013 · ADD COMMENT I wanted to post a ...
- Vue.js双向绑定原理
Vue.js最核心的功能有两个,一个是响应式的数据绑定系统,另一个是组件系统.本文仅仅探究双向绑定是怎样实现的.先讲涉及的知识点,再用简化的代码实现一个简单的hello world示例. 一.访问器属 ...
- Selenium之TestNG安装
一.在Eclipse中安装TestNG 1.打开eclipse-->help-->Install New Software-->Add,输入Name和Location后,点击OK. ...