Gradle Share

1.gradle概念
groovy基本语法
gradle、project、task
gradlew gradle wrapper
插件 plugin 概念、作用

2.gradle命令
clean
bulid
tasks(Android Studio查看)

https://github.com/tfnico/vim-gradle
让vim能识别gradle语法

feature
1.Executing multiple tasks 执行多个task,每个只执行一次
gradle task1 task2
2.Excluding tasks 可以排除某个task不执行
gradle task2 -x task1
task2 dependent task1
3.Continuing the build when a failure occurs 忽略错误继续执行
可能出现其它问题
4.Task name abbreviation
gradle本身可以识别缩写
如执行task wangzuliang
gradle wzl
5.Selecting which build to execute
可以把文件当成参数传递
gradle -b zuliangwang/file1 task1
6.Forcing tasks to execute
自带增量编译 gradle sdk里提供的task大部分都能增量编译
每次 gradle task1 只编译增量部分
7.gradle自带一些编译时工具帮助分析
详细
https://docs.gradle.org/current/userguide/project_reports_plugin.html

  1. Dry Run
    类似打Log观察生命周期,不执行task中的代码,仅显示执行顺序
    gradle -m task1

3.build.gradle setting.gralde
常见属性分析
看懂Android Projecct中的build.gradle
Porject:settings.gradle和build.gradle
task的执行顺序

4.
gradle脚本书写
task simpleTask << {

}

gradle blog
http://www.infoq.com/cn/articles/android-in-depth-gradle?utm_source=infoq&utm_medium=related_content_link&utm_campaign=relatedContent_articles_clk

https://segmentfault.com/a/1190000004234712?_ea=538654

gradle官方文档
https://docs.gradle.org/current/userguide/overview.html
不仅仅是android
web js java app
核心 build your project

Groovy
Gradle’s build scripts are written in Groovy, not XML. But unlike other approaches this is not for simply exposing the raw scripting power of a dynamic language. That would just lead to a very difficult to maintain build. The whole design of Gradle is oriented towards being used as a language, not as a rigid framework. And Groovy is our glue that allows you to tell your individual story with the abstractions Gradle (or you) provide. Gradle provides some standard stories but they are not privileged in any form. This is for us a major distinguishing feature compared to other declarative build systems. Our Groovy support is not just sugar coating. The whole Gradle API is fully Groovy-ized. Adding Groovy results in an enjoyable and productive experience.

groovy API手册
http://docs.groovy-lang.org/latest/html/groovy-jdk/index-all.html