In Gradle we can assign a task to a group. Gradle uses the group for example in the output of $ gradle -t to output all the tasks of the same group together. We only have to set the group property with a value and our task belongs to a group.

In the following sample we add the tasks hello and bye to the group Greeting:

00.def GREETING_GROUP = 'Greeting'
01. 
02.task hello << {
03.println 'Hello Gradle!'
04.}
05.hello.group = GREETING_GROUP
06.hello.description = 'Say hello.'
07. 
08.task bye {
09.description= 'Say goodbye.'
10.group = GREETING_GROUP
11.}
12.bye << {
13.println 'Goodbye.'
14.}

If we run $ gradle -t we get the following output:

:tasks
 
------------------------------------------------------------
Root Project
------------------------------------------------------------
 
Greeting tasks
--------------
bye - Say goodbye.
hello - Say hello.
 
Help tasks
----------
dependencies - Displays a list of the dependencies of root project 'taskgroup'.
help - Displays a help message
projects - Displays a list of the sub-projects of root project 'taskgroup'.
properties - Displays a list of the properties of root project 'taskgroup'.
tasks - Displays a list of the tasks in root project 'taskgroup'.
 
To see all tasks and more detail, run with --all.

最新文章

  1. Linux下搭建DNS服务器
  2. vim 分屏显示
  3. 世界国家 的数据库sql
  4. Mac OS X双系统变回虚拟机
  5. HDU 5442 后缀自动机+kmp
  6. STL笔记(1)map
  7. C#用串口接收事件接不全数据的处理
  8. Zend-MVC intro
  9. wince和window mobile winphone
  10. process launch failed : failed to get the task for process xxx
  11. iPhone开发之全局变量的使用
  12. 【Win7】【磁盘管理】删除相似“33fbc1d57e9aaf1ea88e6f08”缓存目录
  13. C# 垃圾回收机制(转)
  14. Docker 构建 RabbitMQ 集群
  15. 如何定位那些SQL产生了大量的redo日志
  16. excel 设置的函数在打开的时候不会自动执行
  17. 通用jsonp跨域技术获取天气数据
  18. oracle 如何创建只有查询权限的用户
  19. javascript 判断是否移动客户端 userAgent isMobile
  20. 基于 Java Web 的毕业设计选题管理平台--测试报告与用户手册

热门文章

  1. Eclipse设置虚拟机参数 (转 构建内存溢出)
  2. HEOI2017 游记
  3. python模拟登陆豆瓣——简单方法
  4. Chromebook 阿里云ECS 配置 jupyter Notebook
  5. unity对象物体闪烁
  6. RAP, 高效前后端联调框架,接口文档管理工具
  7. C#使用yield关键字构建迭代器
  8. ExpressRoute 概述
  9. Asp.Net MVC4 系列-- 进阶篇之路由
  10. [tools]notepad++当前文件路径不是工作路径