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 ...
随机推荐
- HTML标签类型
标签分类: 一.块标签:块标签是指本身属性为display:block;的元素. 1.默认占一行可以设置宽高, 2.在不设置宽度的情况下,块级元素的宽度是它父级元素内容的宽度 3.在不设置高度的情况下 ...
- Mac Iterm 或者自带终端 bogon:~ username$
mac 在用Iterm2 遇到命令行前缀自带 bogon:~ username$ 太长问题.有代码洁癖的我,终于找到了解决办法. 具体问题见下图: 而我想要的结果是: 解决办法:是安装 Oh My Z ...
- ajax异步上传图片三种方案
转自:http://www.jb51.net/article/51180.htm 注:自己尝试了前两种,都可用: 目前常用的异步文件上传功能有几种,比较多见的如使用iframe框架形式,ajax功能效 ...
- ant-design里为了清空Modal中的值, modal 中值有缓存 ....
处理列表中的编辑功能,发现有点爽,看的都是上次编辑后内容, 搜文档 也没说具体怎么清空旧的状态 网上搜了下,说给 moal 设置一个不同的key 试了,用这方式可以解决问题, 只要这个key是全新的 ...
- Android LinkedList和ArrayList的区别
LinkedeList和ArrayList都实现了List接口,但是它们的工作原理却不一样.它们之间最主要的区别在于ArrayList是可改变大小的数组,而LinkedList是双向链接串列(doub ...
- C#模拟HTTP POST 请求
GET请求: /// <summary> /// 获取accessToken /// </summary> /// <param name="corpid&qu ...
- INFA Transformation组件
RouterRouter和Filter很相似,Router可以用一或多个Filter来取代,不同的是用Router来生成多个组时输入数据只需处理一次,所以效率更高:Router 由一个输入组,一到多个 ...
- xml php 解析
JSON作为数据交换可以说已经成为了一种事实上的标准,但是前几年和它对应的xml虽然说用的越来越少,但是我感觉还是有他可以应用的地方. json更偏重于程序员来使用和解读,而xml则更适合用户来使用和 ...
- DOM介绍
什么是DOM DOM:文档对象模型.DOM 为文档提供了结构化表示,并定义了如何通过脚本来访问文档结构.目的其实就是为了能让js操作html元素而制定的一个规范. DOM就是由节点组成的. 解析过程 ...
- Python学习---django多对多自定义第三方表180206
案例一: # version: python3.2.5 # author: 'FTL1012' # time: 2018/2/6 16:25 from django.db import models ...