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.2.1 More about convention objects
  8.2.2 Declaring Plugins Multiple Times
 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.7.1 The libs Task
  9.7.2 The dists Task
  9.7.3 Adding Archives
 9.8 Archive Tasks
  9.8.1 Common Properties
  9.8.2 Adding Content
  9.8.3 Merging
  9.8.4 Manifest
  9.8.5 MetaInf
 9.9 Upload
10 The Groovy Plugin
 10.1 Compile
11 The War Plugin
12 Dependency Management
 12.1 Introduction
  12.1.1 Versioning the jar name
  12.1.2 Transitive dependency management
  12.1.3 Version conflicts
  12.1.4 Dependency management and Java
 12.2 How to declare your dependencies
  12.2.1 Configurations
  12.2.2 Artifact Dependencies
  12.2.3 Module Dependencies
  12.2.4 Client Module Dependencies
  12.2.5 Project dependencies
  12.2.6 Ivy dependencies
  12.2.7 Configuring the Dependency Manager
 12.3 Java Plugin and Dependency Management
 12.4 Strategies of transitive dependency management
  12.4.1 Enterprise Environments
  12.4.2 Other environments
  12.4.3 Implicit transitive dependencies
 12.5 Repositories and Resolvers
  12.5.1 Introduction
  12.5.2 Maven Repository
  12.5.3 Flat Directory Resolver
  12.5.4 Cache
  12.5.5 Resolver Container
  12.5.6 More about Ivy 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.1.1 Defining Common Behavior
 14.2 Subproject Configuration
  14.2.1 Defining Common Behavior
  14.2.2 Adding Specific Behavior
  14.2.3 Project Filtering
 14.3 Execution rules for multi-project builds
 14.4 Project and Task Paths
 14.5 Dependencies - Which dependencies?
  14.5.1 Execution Dependencies
  14.5.2 Configuration Time Dependencies
  14.5.3 Real Life examples
 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