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 的特殊字符转换转义符,的两种方法。
HTML 的特殊字符转换转义符,的两种方法. 方法一: function htmlEscape(str) { return String(str) .replace(/&/g, '&' ...
- OFDM正交频分复用---基础入门图示
@(162 - 信号处理) 整理转载自:给小白图示讲解OFDM 下面以图示为主讲解OFDM,以"易懂"为第一要义. 注:下面的讨论如果不做说明,均假设为理想信道. *** 一张原理 ...
- Android碎笔录1——基本布局
刚开始学Android开发的时候,没有H5的基础总是分不清android布局文件的用法,真正要学会android布局还是得实战一次,下面不多说,直接上代码. 这是一个登陆界面,LinerLayout嵌 ...
- Linux 虚拟机配置-network is unreachable
配置虚拟机时,遇到network is unreachable,根据网上找来的方法处理,最终自己试过,成功修改的方法在这里记录一下: 修改虚拟机的网络适配器:桥接,复制物理机网络 vim /etc/s ...
- C#跨线程调用窗体控件(比如TextBox)引发的线程安全问题
如何:对 Windows 窗体控件进行线程安全调用 访问 Windows 窗体控件本质上不是线程安全的. 如果有两个或多个线程操作某一控件的状态,则可能会迫使该控件进入一种不一致的状态. 还可能会出现 ...
- winform基础控件-例子学习
1.如图实现整数计算器 ComboBox控件: Items属性:添加集合中的项. this.comoper.Items.AddRange(new object[] { "+", & ...
- escape,encodeURI,encodeURIComponent, URLEncode, RawURLEncode, HTMLEntity, AddSlash, JSON Encode
online tooling: http://www.the-art-of-web.com/javascript/escape/ input : {user:{id:59,innerhtml:&quo ...
- 数据库常用SQL用法
查找某列数据包含某一字符串: SELECT * FROM table WHERE column LIKE '%string%' 查找某列数据以某些字符串开头: SELECT * FROM table ...
- sql语句 查询分组后的每组的第一条或最后一条数据
select * from(select row_number() over(partition by IDCARD order by DATATM desc) as rownum,* from (S ...
- MVC Controller的激活
各Controller的继承关系 Controller最重要的是对Execute方法的调用,当目标Controller对象被激活后,对请求的后续处理和最终响应均是通过执行这个Execute方法来完成. ...