Gradle User Guide
Version 4.0-milestone-1
Copyright © 2007-2017 Hans Dockter, Adam Murdoch
Copies of this document may be made for your own use and for distribution to others, provided that you do not
charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether
distributed in print or electronically.
Table of Contents
I. ABOUT GRADLE
1. Introduction
2. Overview
II. WORKING WITH EXISTING BUILDS
3. Installing Gradle
4. Using the Gradle Command-Line
5. The Gradle Wrapper
6. The Gradle Daemon
7. Dependency Management Basics
8. Introduction to multi-project builds
9. Continuous build
10. Composite builds
11. The Build Environment
12. Troubleshooting
13. Embedding Gradle using the Tooling API
14. Build Cache
III. WRITING GRADLE BUILD SCRIPTS
15. Build Script Basics
16. Build Init Plugin
17. Writing Build Scripts
18. More about Tasks
19. Working With Files
20. Using Ant from Gradle
21. The Build Lifecycle
22. Wrapper Plugin
23. Logging
24. Dependency Management
25. Multi-project Builds
26. Gradle Plugins
27. Standard Gradle plugins
28. The Project Report Plugin
29. The Build Dashboard Plugin
30. Comparing Builds
31. Publishing artifacts
32. The Maven Plugin
33. The Signing Plugin
34. Ivy Publishing (new)
35. Maven Publishing (new)
36. The Distribution Plugin
37. The Announce Plugin
38. The Build Announcements Plugin
IV. EXTENDING THE BUILD
39. Writing Custom Task Classes
40. Writing Custom Plugins
41. The Java Gradle Plugin Development Plugin
42. Organizing Build Logic
43. Initialization Scripts
44. The Gradle TestKit
V. BUILDING JVM PROJECTS
45. Java Quickstart
46. The Java Plugin
47. The Java Library Plugin
48. Web Application Quickstart
49. The War Plugin
50. The Ear Plugin
51. The Application Plugin
52. The Java Library Distribution Plugin
53. Groovy Quickstart
54. The Groovy Plugin
55. The Scala Plugin
56. The ANTLR Plugin
57. The Checkstyle Plugin
58. The CodeNarc Plugin
59. The FindBugs Plugin
60. The JDepend Plugin
61. The PMD Plugin
62. The JaCoCo Plugin
63. The OSGi Plugin
64. The Eclipse Plugins
65. The IDEA Plugin
VI. THE SOFTWARE MODEL
66. Rule based model configuration
67. Software model concepts
68. Implementing model rules in a plugin
69. Building Java Libraries
70. Building Play applications
71. Building native software
72. Extending the software model
VII. APPENDIX
A. Gradle Samples
B. Potential Traps
C. The Feature Lifecycle
D. Gradle Command Line
E. Documentation licenses
Glossary
List of Examples
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
5.1. Running the Wrapper task
5.2. Wrapper task
5.3. Wrapper generated files
5.4. Specifying the HTTP Basic Authentication credentials using system properties
5.5. Specifying the HTTP Basic Authentication credentials in distributionUrl
5.6. Generating a SHA-256 hash
5.7. Configuring SHA-256 checksum verification
7.1. Declaring dependencies
7.2. Definition of an external dependency
7.3. Shortcut definition of an external dependency
7.4. Usage of Maven central repository
7.5. Usage of JCenter repository
7.6. Usage of a remote Maven repository
7.7. Usage of a remote Ivy directory
7.8. Usage of a local Ivy directory
7.9. Publishing to an Ivy repository
7.10. Publishing to a Maven repository
8.1. Listing the projects in a build
10.1. Dependencies of my-app
10.2. Declaring a command-line composite
10.3. Declaring a separate composite
10.4. Depending on task from included build
10.5. Build that does not declare group attribute
10.6. Declaring the substitutions for an included build
10.7. Depending on a single task from an included build
10.8. Depending on a tasks with path in all included builds
11.1. Setting properties with a gradle.properties file
11.2. Configuring an HTTP proxy
11.3. Configuring an HTTPS proxy
13.1. Using the tooling API
14.1. Pull from HttpBuildCache
14.2. Recommended setup for CI push use case
14.3. Consistent setup for buildSrc and main build
14.4. Configure built-in build caches
15.1. Your first build script
15.2. Execution of a build script
15.3. A task definition shortcut
15.4. Using Groovy in Gradle's tasks
15.5. Using Groovy in Gradle's tasks
15.6. Declaration of task that depends on other task
15.7. Lazy dependsOn - the other task does not exist (yet)
15.8. Dynamic creation of a task
- 1
- 2
- 3
- 4
- 5
前往页