Gradle, in one word

build script

Everything in Gradle sits on top of two basic concepts: projects and tasks.

  • Every Gradle build is made up of one or more projects.
  • Each project is made up of one or more tasks.

project

  • There is a one-to-one relationship between a Project and a build.gradle file
  • 创建setting实例,根据settings.gradle来决定project的层级关系
  • 执行projects根据广度遍历规则

build.gradle

automatically looks for this file as the build script

plugin

  • Plugins bundle additional tasks into Gradle that focus on a specific functionality.

  • Plugins can be used to modularise and reuse project configuration.

task

A project is essentially a collection of Task objects

run gradle

  • gradle command looks for a file called build.gradle
  • gradle -b

gradle -q

忽略Gradle的log信息,只显示task的结果


doFirst doLast

将一个action头插入或者尾插入action list中。action list是按照顺序执行的

Build Variant

The combination of Build Type and Flavor is known as Build Variant.

Build Type

Build Type refers to build and packaging settings like signing configuration for a project.

  • debug
  • release

Flavour

A flavor is used to specify custom features, minimum and target API levels, device and API requirements like layout, drawable and custom code (for example, if production code is slightly different than development code).

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,486评论 0 10
  • 三衢道中 曾几(宋) 梅子黄时日日晴, 小溪泛尽却山行。 绿阴不减来时路, 添得黄鹂四五声。 注解: ①三衢(qú...
    天天读童书阅读 618评论 0 0
  • 家长:我们这么辛辛苦苦的供你上学,就是希望你把念好,成绩才是一切的根本。 父母的眼里只有成绩,只要是有了成绩,他们...
    七月失神阅读 333评论 0 2
  • 今天可以说是人生中颇值得纪念的一天,纠结犹豫了好久,终于下定决心带女儿去院检查了眼睛的情况。 斜视,这是不容置疑的...
    无面客阅读 371评论 0 0
  • 还有一天就是我的二十岁。 这一年的自己还在大一,晚上翘了课去健身房,空间不大的健身房人很多,喘着粗气一脸认真的模样...
    封二一阅读 471评论 0 1