Gradle

A build system

Version 0.6.1

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

1. Introduction
2. Overview
2.1. Features
2.2. Why Groovy?
2.3. Missing Features
3. Getting Started
3.1. Prerequisites
3.2. Unpacking
3.3. Environment variables
3.4. Running and testing your installation
3.5. JVM Options
4. Build Script Basics
4.1. Hello World
4.2. Build scripts are code
4.3. Task dependencies
4.4. Dynamic tasks
4.5. Manipulating existing tasks
4.6. Shortcut notations
4.7. Dynamic Task Properties
4.8. Ant
4.9. Using methods
4.10. Default Tasks
4.11. Configure By DAG
4.12. Summary
5. Artifact Basics
5.1. Artifact Configurations
5.2. Repositories
5.3. External Dependencies
5.4. Artifact Publishing
5.5. API
6. Java Quickstart
6.1. A Basic Java Project
6.2. Multi-project Java Build
6.3. Summary
7. Groovy Quickstart
7.1. A basic Groovy project
7.2. Summary
8. Web Application Quickstart
8.1. Building A WAR file
8.2. Running Your Web Application
8.3. Summary
9. Using the Gradle Command-Line
9.1. Executing multiple tasks
9.2. Selecting which build to execute
10. Tutorial - 'This and That'
10.1. Skipping Tasks
10.2. Obtaining Information About Your Build
10.3. Directory Creation
10.4. Gradle Properties and System Properties
10.5. Accessing the web via a proxy
10.6. Caching
10.7. Configuring Arbitrary Objects
11. The Project and Task API
11.1. Project API
11.2. Task API
11.3. Summary
12. More about Tasks
12.1. Defining Tasks
12.2. Locating Tasks
12.3. Configuring Tasks
12.4. Adding Dependencies to Tasks
12.5. Adding a description to a task
12.6. Replacing Tasks
12.7. Task Rules
12.8. Summary
13. Logging
13.1. Choosing a log level
13.2. External Tools and Standard Output
13.3. Sending your own log messages
14. Plugins
14.1. Declaring Plugins
14.2. Configuration
14.3. Summary
15. The Java Plugin
15.1. Tasks
15.2. Project Layout
15.3. Configurations
15.4. Convention Properties
15.5. Init
15.6. Javadoc
15.7. Clean
15.8. Resources
15.9. Compile
15.10. Test
15.11. Jar
15.12. Adding archives
15.13. Uploading
15.14. Eclipse
16. The Groovy Plugin
16.1. Tasks
16.2. Project Layout
16.3. Configurations
16.4. Convention Properties
16.5. Compile
16.6. Test
17. The War Plugin
17.1. Tasks
17.2. Project Layout
17.3. Configurations
17.4. Convention Properties
17.5. War
17.6. Customizing
17.7. Eclipse WTP
18. The Jetty Plugin
18.1. Tasks
18.2. Project Layout
18.3. Configurations
18.4. Convention Properties
19. The OSGi Plugin
19.1. Tasks
19.2. Project Layout
19.3. Configurations
19.4. Convention Properties
20. The Project Report Plugin
20.1. Tasks
20.2. Project Layout
20.3. Configurations
20.4. Convention Properties
21. Dependency Management
21.1. Introduction
21.2. Dependency management overview
21.3. How to declare your dependencies
21.4. Repositories
21.5. Strategies of transitive dependency management
22. Artifact Management
22.1. Introduction
22.2. Artifacts and Configurations
22.3. Uploading Artifacts
22.4. More about project libraries
22.5. Interacting with Maven Repositories
23. The Build Lifecycle
23.1. Build Phases
23.2. Settings File
23.3. Multi-Project Builds
23.4. Initialization
23.5. Configuration and Execution of a Single Project Build
23.6. Responding to the Lifecycle in the Build Script
24. Multi-project Builds
24.1. Cross Project Configuration
24.2. Subproject Configuration
24.3. Execution rules for multi-project builds
24.4. Running Tasks by their Absolute Path
24.5. Project and Task Paths
24.6. Dependencies - Which dependencies?
24.7. Project Lib Dependencies
24.8. Property and Method Inheritance
24.9. Summary
25. Organizing Build Logic
25.1. Build Sources
25.2. External dependencies
25.3. Ant Optional Dependencies
25.4. Summary
26. The Gradle Wrapper
26.1. Configuration
26.2. Unix file permissions
26.3. Environment variable
A. Potential Traps
A.1. Groovy Script Variables
A.2. Configuration and Execution Phase
B. Gradle Command Line
C. Existing IDE Support and how to cope without it
C.1. IntelliJ
C.2. Eclipse
C.3. Using Gradle without IDE support