gradle 用户指南

版权所有©2007-2017 Hans Dockter,Adam Murdoch
只要您不对这些副本收取任何费用,并且进一步规定,每个副本都包含本版权声明,无论是以印刷版还是电子版分发,本文档的副本可供您自己使用并分发给他人。

目录

一、关于Gradle

1、简介
2、概述

二、使用现有构建

3、安装Gradle

3.1 权限导致的问题:gradle Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().

4、使用Gradle命令行

5、Gradle控制台
6、Gradle包装器
7、渐层守护进程
8、依赖管理基础
9、多项目建设介绍
10、持续构建
11、复合构建
12、构建环境
13、故障排除
14、使用工具API嵌入Gradle
15、构建缓存

三、编写Gradle构建脚本

16、构建脚本基础
17、构建初始化插件
18、编写脚本
19、更多关于任务
20、使用文件
21、使用蚂蚁从Gradle
22、构建生命周期
23、包装插件
24、记录
25、依附管理
26、多项目建设
27、毕业插件
28、标准Gradle插件
29、项目报告插件
30、构建仪表板插件
31、比较建筑
32、发行文物
33、Maven插件
34、签名插件
35、常春藤出版社(新)
36、Maven Publishing(新)
37、分配插件
38、宣布插件

39、构建公告插件

四、扩展构建

40、编写自定义任务类
41、编写自定义插件
42、Java Gradle插件开发插件
43、组织建构逻辑
44、初始化脚本
45、Gradle TestKit

五、构建JVM项目

46、Java快速启动
47、Java插件
48、Java库插件
49、Web应用程序快速启动
50、War插件
51、Ear插件
52、应用程序插件
53、Java库分发插件
54、Groovy快速入门
55、Groovy插件
56、Scala插件
57、ANTLR插件
58、Checkstyle插件
59、CodeNarc插件
60、FindBugs插件
61、JDepend插件
62、PMD插件
63、JaCoCo插件
64、OSGi插件
65、Eclipse插件
66、IDEA插件

六、软件模型

67、基于规则的模型配置
68、软件模型概念
69、在插件中实现模型规则
70、构建Java库
71、建立播放应用程序
72、构建本地软件
73、扩展软件模型

七、附录

A、Gradle 样本
B、潜在陷阱
C、特征生命周期
D、格林指挥线
E、文件许可
词汇表

示例列表

4.1. Executing multiple tasks
4.2. Excluding tasks
4.3. Abbreviated task name
4.4. Abbreviated camel case task name
4.5. Selecting the project using a build file
4.6. Selecting the project using project directory
4.7. Forcing tasks to run
4.8. Obtaining information about projects
4.9. Providing a description for a project
4.10. Obtaining information about tasks
4.11. Changing the content of the task report
4.12. Obtaining more information about tasks
4.13. Obtaining detailed help for tasks
4.14. Obtaining information about dependencies
4.15. Filtering dependency report by configuration
4.16. Getting the insight into a particular dependency
4.17. Information about properties
6.1. Running the Wrapper task
6.2. Wrapper task
6.3. Wrapper generated files
6.4. Specifying the HTTP Basic Authentication credentials using system properties
6.5. Specifying the HTTP Basic Authentication credentials in distributionUrl
6.6. Generating a SHA-256 hash
6.7. Configuring SHA-256 checksum verification
8.1. Declaring dependencies
8.2. Definition of an external dependency
8.3. Shortcut definition of an external dependency
8.4. Usage of Maven central repository
8.5. Usage of JCenter repository
8.6. Usage of a remote Maven repository
8.7. Usage of a remote Ivy directory
8.8. Usage of a local Ivy directory
8.9. Publishing to an Ivy repository
8.10. Publishing to a Maven repository
9.1. Listing the projects in a build
11.1. Dependencies of my-app
11.2. Declaring a command-line composite
11.3. Declaring a separate composite
11.4. Depending on task from included build
11.5. Build that does not declare group attribute
11.6. Declaring the substitutions for an included build
11.7. Depending on a single task from an included build
11.8. Depending on a tasks with path in all included builds
12.1. Setting properties with a gradle.properties file
12.2. Configuring an HTTP proxy
12.3. Configuring an HTTPS proxy
14.1. Using the tooling API
15.1. Pull from HttpBuildCache
15.2. Recommended setup for CI push use case
15.3. Consistent setup for buildSrc and main build
15.4. Configure built-in build caches
16.1. Your first build script
16.2. Execution of a build script
16.3. A task definition shortcut
16.4. Using Groovy in Gradle's tasks
16.5. Using Groovy in Gradle's tasks
16.6. Declaration of task that depends on other task
16.7. Lazy dependsOn - the other task does not exist (yet)
16.8. Dynamic creation of a task
16.9. Accessing a task via API - adding a dependency
16.10. Accessing a task via API - adding behaviour
16.11. Accessing task as a property of the build script
16.12. Adding extra properties to a task
16.13. Using AntBuilder to execute ant.loadfile target
16.14. Using methods to organize your build logic
16.15. Defining a default task
16.16. Different outcomes of build depending on chosen tasks
18.1. Accessing property of the Project object
18.2. Using local variables
18.3. Using extra properties
18.4. Configuring arbitrary objects
18.5. Configuring arbitrary objects using a script
18.6. Groovy JDK methods
18.7. Property accessors
18.8. Method call without parentheses
18.9. List and map literals
18.10. Closure as method parameter
18.11. Closure delegates
19.1. Defining tasks
19.2. Defining tasks - using strings for task names
19.3. Defining tasks with alternative syntax
19.4. Accessing tasks as properties
19.5. Accessing tasks via tasks collection
19.6. Accessing tasks by path
19.7. Creating a copy task
19.8. Configuring a task - various ways
19.9. Configuring a task - with closure
19.10. Defining a task with closure
19.11. Adding dependency on task from another project
19.12. Adding dependency using task object
19.13. Adding dependency using closure
19.14. Adding a 'must run after' task ordering
19.15. Adding a 'should run after' task ordering
19.16. Task ordering does not imply task execution
19.17. A 'should run after' task ordering is ignored if it introduces an ordering cycle
19.18. Adding a description to a task
19.19. Overwriting a task
19.20. Skipping a task using a predicate
19.21. Skipping tasks with StopExecutionException
19.22. Enabling and disabling tasks
19.23. Custom task class
19.24. Ad-hoc task
19.25. Ad-hoc task declaring a destroyable
19.26. Using runtime API with custom task type
19.27. Using skipWhenEmpty() via the runtime API
19.28. Inferred task dependency via task outputs
19.29. Inferred task dependency via a task argument
19.30. Declaring a method to add task inputs
19.31. Declaring a method to add a task as an input
19.32. Failed attempt at setting up an inferred task dependency
19.33. Setting up an inferred task dependency between output dir and input files
19.34. Setting up an inferred task dependency with files()
19.35. Setting up an inferred task dependency with builtBy()
19.36. Ignoring up-to-date checks
19.37. Runtime classpath normalization
19.38. Task rule
19.39. Dependency on rule based tasks
19.40. Adding a task finalizer
19.41. Task finalizer for a failing task
20.1. Locating files
20.2. Creating a file collection
20.3. Using a file collection
20.4. Implementing a file collection
20.5. Creating a file tree
20.6. Using a file tree
20.7. Using an archive as a file tree
20.8. Specifying a set of files
20.9. Copying files using the copy task
20.10. Specifying copy task source files and destination directory
20.11. Selecting the files to copy
20.12. Copying files using the copy() method without up-to-date check
20.13. Copying files using the copy() method with up-to-date check
20.14. Renaming files as they are copied
20.15. Filtering files as they are copied
20.16. Nested copy specs
20.17. Using the Sync task to copy dependencies
20.18. Creating a ZIP archive
20.19. Creation of ZIP archive
20.20. Configuration of archive task - custom archive name
20.21. Configuration of archive task - appendix & classifier
20.22. Activating reproducible archives
21.1. Using an Ant task
21.2. Passing nested text to an Ant task
21.3. Passing nested elements to an Ant task
21.4. Using an Ant type
21.5. Using a custom Ant task
21.6. Declaring the classpath for a custom Ant task
21.7. Using a custom Ant task and dependency management together
21.8. Importing an Ant build
21.9. Task that depends on Ant target
21.10. Adding behaviour to an Ant target
21.11. Ant target that depends on Gradle task
21.12. Renaming imported Ant targets
21.13. Setting an Ant property
21.14. Getting an Ant property
21.15. Setting an Ant reference
21.16. Getting an Ant reference
21.17. Fine tuning Ant logging
22.1. Single project build
22.2. Hierarchical layout
22.3. Flat layout
22.4. Modification of elements of the project tree
22.5. Adding of test task to each project which has certain property set
22.6. Notifications
22.7. Setting of certain property to all tasks
22.8. Logging of start and end of each task execution
24.1. Using stdout to write log messages
24.2. Writing your own log messages
24.3. Using SLF4J to write log messages
24.4. Configuring standard output capture
24.5. Configuring standard output capture for a task
24.6. Customizing what Gradle logs
25.1. Definition of a configuration
25.2. Accessing a configuration
25.3. Configuration of a configuration
25.4. Module dependencies
25.5. Artifact only notation
25.6. Dependency with classifier
25.7. Iterating over a configuration
25.8. Client module dependencies - transitive dependencies
25.9. Project dependencies
25.10. File dependencies
25.11. Generated file dependencies
25.12. Gradle API dependencies
25.13. Gradle's Groovy dependencies
25.14. Excluding transitive dependencies
25.15. Optional attributes of dependencies
25.16. Collections and arrays of dependencies
25.17. Dependency configurations
25.18. Dependency configurations for project
25.19. Configuration.copy
25.20. Accessing declared dependencies
25.21. Configuration.files
25.22. Configuration.files with spec
25.23. Configuration.copy
25.24. Configuration.copy vs. Configuration.files
25.25. Adding central Maven repository
25.26. Adding Bintray's JCenter Maven repository
25.27. Using Bintrays's JCenter with HTTP
25.28. Adding Google Maven repository
25.29. Adding the local Maven cache as a repository
25.30. Adding custom Maven repository
25.31. Adding additional Maven repositories for JAR files
25.32. Accessing password protected Maven repository
25.33. Flat repository resolver
25.34. Ivy repository
25.35. Ivy repository with named layout
25.36. Ivy repository with pattern layout
25.37. Ivy repository with multiple custom patterns
25.38. Ivy repository with Maven compatible layout
25.39. Ivy repository
25.40. Declaring a Maven and Ivy repository
25.41. Providing credentials to a Maven and Ivy repository
25.42. Declaring a S3 backed Maven and Ivy repository
25.43. Declaring a S3 backed Maven and Ivy repository using IAM
25.44. Configure repository to use only digest authentication
25.45. Configure repository to use preemptive authentication
25.46. Accessing a repository
25.47. Configuration of a repository
25.48. Definition of a custom repository
25.49. Forcing consistent version for a group of libraries
25.50. Using a custom versioning scheme
25.51. Blacklisting a version with a replacement
25.52. Changing dependency group and/or name at the resolution
25.53. Substituting a module with a project
25.54. Substituting a project with a module
25.55. Conditionally substituting a dependency
25.56. Specifying default dependencies on a configuration
25.57. Enabling dynamic resolve mode
25.58. 'Latest' version selector
25.59. Custom status scheme
25.60. Custom status scheme by module
25.61. Ivy component metadata rule
25.62. Rule source component metadata rule
25.63. Component selection rule
25.64. Component selection rule with module target
25.65. Component selection rule with metadata
25.66. Component selection rule using a rule source object
25.67. Declaring module replacement
25.68. Dynamic version cache control
25.69. Changing module cache control
26.1. Multi-project tree - water & bluewhale projects
26.2. Build script of water (parent) project
26.3. Multi-project tree - water, bluewhale & krill projects
26.4. Water project build script
26.5. Defining common behavior of all projects and subprojects
26.6. Defining specific behaviour for particular project
26.7. Defining specific behaviour for project krill
26.8. Adding custom behaviour to some projects (filtered by project name)
26.9. Adding custom behaviour to some projects (filtered by project properties)
26.10. Running build from subproject
26.11. Evaluation and execution of projects
26.12. Evaluation and execution of projects
26.13. Running tasks by their absolute path
26.14. Dependencies and execution order
26.15. Dependencies and execution order
26.16. Dependencies and execution order
26.17. Declaring dependencies
26.18. Declaring dependencies
26.19. Cross project task dependencies
26.20. Configuration time dependencies
26.21. Configuration time dependencies - evaluationDependsOn
26.22. Configuration time dependencies
26.23. Dependencies - real life example - crossproject configuration
26.24. Project lib dependencies
26.25. Project lib dependencies
26.26. Fine grained control over dependencies
26.27. Build and Test Single Project
26.28. Partial Build and Test Single Project
26.29. Build and Test Depended On Projects
26.30. Build and Test Dependent Projects
27.1. Applying a script plugin
27.2. Applying a core plugin
27.3. Applying a community plugin
27.4. Applying plugins only on certain subprojects.
27.5. Using plugins from custom plugin repositories.
27.6. Plugin resolution strategy.
27.7. Complete Plugin Publishing Sample
27.8. Applying a binary plugin
27.9. Applying a binary plugin by type
27.10. Applying a plugin with the buildscript block
30.1. Using the Build Dashboard plugin
32.1. Defining an artifact using an archive task
32.2. Defining an artifact using a file
32.3. Customizing an artifact
32.4. Map syntax for defining an artifact using a file
32.5. Configuration of the upload task
33.1. Using the Maven plugin
33.2. Creating a stand alone pom.
33.3. Upload of file to remote Maven repository
33.4. Upload of file via SSH
33.5. Customization of pom
33.6. Builder style customization of pom
33.7. Modifying auto-generated content
33.8. Customization of Maven installer
33.9. Generation of multiple poms
33.10. Accessing a mapping configuration
34.1. Using the Signing plugin
34.2. Signing a configuration
34.3. Signing a configuration output
34.4. Signing a task
34.5. Signing a task output
34.6. Conditional signing
34.7. Signing a POM for deployment
35.1. Applying the “ivy-publish” plugin
35.2. Publishing a Java module to Ivy
35.3. Publishing additional artifact to Ivy
35.4. customizing the publication identity
35.5. Customizing the module descriptor file
35.6. Publishing multiple modules from a single project
35.7. Declaring repositories to publish to
35.8. Choosing a particular publication to publish
35.9. Publishing all publications via the “publish” lifecycle task
35.10. Generating the Ivy module descriptor file
35.11. Publishing a Java module
35.12. Example generated ivy.xml
36.1. Applying the 'maven-publish' plugin
36.2. Adding a MavenPublication for a Java component
36.3. Adding additional artifact to a MavenPublication
36.4. customizing the publication identity
36.5. Modifying the POM file
36.6. Publishing multiple modules from a single project
36.7. Declaring repositories to publish to
36.8. Publishing a project to a Maven repository
36.9. Publish a project to the Maven local repository
36.10. Generate a POM file without publishing
37.1. Using the distribution plugin
37.2. Adding extra distributions
37.3. Configuring the main distribution
37.4. publish main distribution
38.1. Using the announce plugin
38.2. Configure the announce plugin
38.3. Using the announce plugin
39.1. Using the build announcements plugin
39.2. Using the build announcements plugin from an init script
40.1. Defining a custom task
40.2. A hello world task
40.3. A customizable hello world task
40.4. A build for a custom task
40.5. A custom task
40.6. Using a custom task in another project
40.7. Testing a custom task
40.8. Defining an incremental task action
40.9. Running the incremental task for the first time
40.10. Running the incremental task with unchanged inputs
40.11. Running the incremental task with updated input files
40.12. Running the incremental task with an input file removed
40.13. Running the incremental task with an output file removed
40.14. Running the incremental task with an input property changed
41.1. A custom plugin
41.2. A custom plugin extension
41.3. A custom plugin with configuration closure
41.4. Evaluating file properties lazily
41.5. Mapping extension properties to task properties
41.6. A build for a custom plugin
41.7. Wiring for a custom plugin
41.8. Using a custom plugin in another project
41.9. Applying a community plugin with the plugins DSL
41.10. Testing a custom plugin
41.11. Using the Java Gradle Plugin Development plugin
41.12. Managing domain objects
42.1. Using the Java Gradle Plugin Development plugin
42.2. Using the gradlePlugin {} block.
43.1. Using inherited properties and methods
43.2. Using injected properties and methods
43.3. Configuring the project using an external build script
43.4. Custom buildSrc build script
43.5. Adding subprojects to the root buildSrc project
43.6. Running another build from a build
43.7. Declaring external dependencies for the build script
43.8. A build script with external dependencies
43.9. Ant optional dependencies
44.1. Using init script to perform extra configuration before projects are evaluated
44.2. Declaring external dependencies for an init script
44.3. An init script with external dependencies
44.4. Using plugins in init scripts
45.1. Declaring the TestKit dependency
45.2. Declaring the JUnit dependency
45.3. Using GradleRunner with JUnit
45.4. Using GradleRunner with Spock
45.5. Making the code under test classpath available to the tests
45.6. Injecting the code under test classes into test builds
45.7. Injecting the code under test classes into test builds for Gradle versions prior to 2.8
45.8. Using the Java Gradle Development plugin for generating the plugin metadata
45.9. Automatically injecting the code under test classes into test builds
45.10. Reconfiguring the classpath generation conventions of the Java Gradle Development plugin
45.11. Specifying a Gradle version for test execution
45.12. Testing cacheable tasks
46.1. Using the Java plugin
46.2. Building a Java project
46.3. Adding Maven repository
46.4. Adding dependencies
46.5. Customization of MANIFEST.MF
46.6. Adding a test system property
46.7. Publishing the JAR file
46.8. Eclipse plugin
46.9. Java example - complete build file
46.10. Multi-project build - hierarchical layout
46.11. Multi-project build - settings.gradle file
46.12. Multi-project build - common configuration
46.13. Multi-project build - dependencies between projects
46.14. Multi-project build - distribution file
47.1. Using the Java plugin
47.2. Custom Java source layout
47.3. Accessing a source set
47.4. Configuring the source directories of a source set
47.5. Defining a source set
47.6. Defining source set dependencies
47.7. Compiling a source set
47.8. Assembling a JAR for a source set
47.9. Generating the Javadoc for a source set
47.10. Running tests in a source set
47.11. Declaring annotation processors
47.12. Filtering tests in the build script
47.13. JUnit Categories
47.14. Grouping TestNG tests
47.15. Preserving order of TestNG tests
47.16. Grouping TestNG tests by instances
47.17. Creating a unit test report for subprojects
47.18. Customization of MANIFEST.MF
47.19. Creating a manifest object.
47.20. Separate MANIFEST.MF for a particular archive
47.21. Configure Java 6 build
48.1. Using the Java Library plugin
48.2. Declaring API and implementation dependencies
48.3. Making the difference between API and implementation
48.4. Declaring API and implementation dependencies
48.5. Configuring the Groovy plugin to work with Java Library
49.1. War plugin
49.2. Running web application with Gretty plugin
50.1. Using the War plugin
50.2. Customization of war plugin
51.1. Using the Ear plugin
51.2. Customization of ear plugin
52.1. Using the application plugin
52.2. Configure the application main class
52.3. Configure default JVM settings
52.4. Include output from other tasks in the application distribution
52.5. Automatically creating files for distribution
53.1. Using the Java library distribution plugin
53.2. Configure the distribution name
53.3. Include files in the distribution
54.1. Groovy plugin
54.2. Dependency on Groovy
54.3. Groovy example - complete build file
55.1. Using the Groovy plugin
55.2. Custom Groovy source layout
55.3. Configuration of Groovy dependency
55.4. Configuration of Groovy test dependency
55.5. Configuration of bundled Groovy dependency
55.6. Configuration of Groovy file dependency
55.7. Configure Java 6 build for Groovy
56.1. Using the Scala plugin
56.2. Custom Scala source layout
56.3. Declaring a Scala dependency for production code
56.4. Declaring a Scala dependency for test code
56.5. Declaring a version of the Zinc compiler to use
56.6. Forcing a scala-library dependency for all configurations
56.7. Forcing a scala-library dependency for the zinc configuration
56.8. Adjusting memory settings
56.9. Forcing all code to be compiled
56.10. Configure Java 6 build for Scala
56.11. Explicitly specify a target IntelliJ IDEA version
57.1. Using the ANTLR plugin
57.2. Declare ANTLR version
57.3. setting custom max heap size and extra arguments for ANTLR
58.1. Using the Checkstyle plugin
58.2. Using the config_loc property
58.3. Customizing the HTML report
59.1. Using the CodeNarc plugin
60.1. Using the FindBugs plugin
60.2. Customizing the HTML report
61.1. Using the JDepend plugin
62.1. Using the PMD plugin
63.1. Applying the JaCoCo plugin
63.2. Configuring JaCoCo plugin settings
63.3. Configuring test task
63.4. Configuring violation rules
63.5. Configuring test task
63.6. Using application plugin to generate code coverage data
63.7. Coverage reports generated by applicationCodeCoverageReport
64.1. Using the OSGi plugin
64.2. Configuration of OSGi MANIFEST.MF file
65.1. Using the Eclipse plugin
65.2. Using the Eclipse WTP plugin
65.3. Partial Overwrite for Classpath
65.4. Partial Overwrite for Project
65.5. Export Dependencies
65.6. Customizing the XML
66.1. Using the IDEA plugin
66.2. Partial Rewrite for Module
66.3. Partial Rewrite for Project
66.4. Export Dependencies
66.5. Customizing the XML
67.1. applying a rule source plugin
67.2. a model creation rule
67.3. a model mutation rule
67.4. creating a task
67.5. a managed type
67.6. a String property
67.7. a File property
67.8. a Long property
67.9. a boolean property
67.10. an int property
67.11. a managed property
67.12. an enumeration type property
67.13. a managed set
67.14. strongly modelling sources sets
67.15. a DSL example applying a rule to every element in a scope
67.16. DSL configuration rule
67.17. Configuration run when required
67.18. Configuration not run when not required
67.19. DSL creation rule
67.20. DSL creation rule without initialization
67.21. Initialization before configuration
67.22. Nested DSL creation rule
67.23. Nested DSL configuration rule
67.24. DSL configuration rule for each element in a map
67.25. Nested DSL property configuration
67.26. a DSL example showing type conversions
67.27. a DSL rule using inputs
67.28. model task output
70.1. Using the Java software plugins
70.2. Creating a java library
70.3. Configuring a source set
70.4. Creating a new source set
70.5. The components report
70.6. Declaring a dependency onto a library
70.7. Declaring a dependency onto a project with an explicit library
70.8. Declaring a dependency onto a project with an implicit library
70.9. Declaring a dependency onto a library published to a Maven repository
70.10. Declaring a module dependency using shorthand notation
70.11. Configuring repositories for dependency resolution
70.12. Specifying api packages
70.13. Specifying api dependencies
70.14. Main sources
70.15. Client component
70.16. Broken client component
70.17. Recompiling the client
70.18. Declaring target platforms
70.19. Declaring binary specific sources
70.20. Declaring target platforms
70.21. Using the JUnit plugin
70.22. Executing the test suite
70.23. Executing the test suite
70.24. Declaring a component under test
70.25. Declaring local Java installations
71.1. Using the Play plugin
71.2. The components report
71.3. Selecting a version of the Play Framework
71.4. Adding dependencies to a Play application
71.5. Adding extra source sets to a Play application
71.6. Configuring Scala compiler options
71.7. Configuring routes style
71.8. Configuring a custom asset pipeline
71.9. Configuring dependencies on Play subprojects
71.10. Add extra files to a Play application distribution
71.11. Applying both the Play and IDEA plugins
72.1. Defining a library component
72.2. Defining executable components
72.3. Sample build
72.4. Dependent components report
72.5. Dependent components report
72.6. Report of components that depends on the operators component
72.7. Report of components that depends on the operators component, including test suites
72.8. Assemble components that depends on the passing/static binary of the operators component
72.9. Build components that depends on the passing/static binary of the operators component
72.10. Adding a custom check task
72.11. Running checks for a given binary
72.12. The components report
72.13. The 'cpp' plugin
72.14. C++ source set
72.15. The 'c' plugin
72.16. C source set
72.17. The 'assembler' plugin
72.18. The 'objective-c' plugin
72.19. The 'objective-cpp' plugin
72.20. Settings that apply to all binaries
72.21. Settings that apply to all shared libraries
72.22. Settings that apply to all binaries produced for the 'main' executable component
72.23. Settings that apply only to shared libraries produced for the 'main' library component
72.24. The 'windows-resources' plugin
72.25. Configuring the location of Windows resource sources
72.26. Building a resource-only dll
72.27. Providing a library dependency to the source set
72.28. Providing a library dependency to the binary
72.29. Declaring project dependencies
72.30. Creating a precompiled header file
72.31. Including a precompiled header file in a source file
72.32. Configuring a precompiled header
72.33. Defining build types
72.34. Configuring debug binaries
72.35. Defining platforms
72.36. Defining flavors
72.37. Targeting a component at particular platforms
72.38. Building all possible variants
72.39. Defining tool chains
72.40. Reconfigure tool arguments
72.41. Defining target platforms
72.42. Registering CUnit tests
72.43. Running CUnit tests
72.44. Registering GoogleTest tests
73.1. an example of using a custom software model
73.2. Declare a custom component
73.3. Register a custom component
73.4. Declare a custom binary
73.5. Register a custom binary
73.6. Declare a custom source set
73.7. Register a custom source set
73.8. Generates documentation binaries
73.9. Generates tasks for text source sets
73.10. Register a custom source set
73.11. an example of using a custom software model
73.12. components report
73.13. public type and internal view declaration
73.14. type registration
73.15. public and internal data mutation
73.16. example build script and model report output
B.1. Variables scope: local and script wide
B.2. Distinct configuration and execution phase

原文:https://docs.gradle.org/current/userguide/userguide.html

04-17 13:36