______________________________________________________________________________________________

Gradle
A build system

______________________________________________________________________________________________

Version 0.2

Copyright 2007-2008 Hans Dockter

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.

Contents
1 Introduction
2 The Gradle Core Tutorial
 2.1 Hello World
 2.2 Build scripts are code
 2.3 Task dependencies
 2.4 Dynamic tasks
 2.5 Manipulating existing tasks
 2.6 Shortcut notations
 2.7 Ant
 2.8 Using methods
 2.9 Configure By DAG
 2.10 Summary
3 The Java Projects Appetizer
 3.1 Examples
4 The ’This And That’ Tutorial
 4.1 Skipping Tasks
 4.2 Console Output
 4.3 Directory Creation
 4.4 Gradle Properties and System Properties
 4.5 Accessing the web via a proxy
5 Overview
 5.1 Features
 5.2 Why Groovy?
 5.3 Missing Features
6 The Project and Task API
 6.1 Project API
 6.2 Task API
 6.3 Summary
7 More about Tasks
 7.1 Configuring Tasks
 7.2 Replacing Tasks
 7.3 Summary
8 Plugins
 8.1 Declaring Plugins
 8.2 Configuration
 8.3 Summary
9 The Java Plugin
 9.1 Init
 9.2 Javadoc
 9.3 Clean
 9.4 Resources
 9.5 Compile
 9.6 Test
 9.7 Bundles
 9.8 Archive Tasks
 9.9 Upload
10 The Groovy Plugin
 10.1 Compile
11 The War Plugin
12 Dependency Management
 12.1 Introduction
 12.2 How to declare your dependencies
 12.3 Java Plugin and Dependency Management
 12.4 Strategies of transitive dependency management
 12.5 Repositories and Resolvers
13 The Build Lifecycle
 13.1 Build Phases
 13.2 Settings File
 13.3 Multi-Project Builds
 13.4 Initialization
 13.5 Configuration and Execution of a Single Project Build
14 Multi-project builds
 14.1 Cross Project Configuration
 14.2 Subproject Configuration
 14.3 Execution rules for multi-project builds
 14.4 Project and Task Paths
 14.5 Dependencies - Which dependencies?
 14.6 Project Lib Dependencies
 14.7 Property and Method Inheritance
 14.8 Summary
15 Organizing Build Logic
 15.1 Build Sources
 15.2 External dependencies
 15.3 Ant Optional Dependencies
 15.4 Summary
16 The Gradle Wrapper
 16.1 Unix file permissions
 16.2 Environment variable
A Potential Traps
 A.1 Groovy Script Variables
 A.2 Configuration and Execution Phase
B Existing IDE Support and how to cope without it
 B.1 IntelliJ
 B.2 Eclipse
 B.3 Using Gradle without IDE support
C Command line