Advanced Gradle Fundamentals for Java/JVM

Get on your way to faster, more flexible builds in just two days.

Upcoming Dates

Description

The Advanced Gradle Fundamentals training course is an extensive hands-on two day Gradle training course for build masters and developers who are familiar with Gradle and are authoring and maintaining their builds. Participants will learn how to use the Gradle build system to substantially increase their productivity. This Gradle training class dives into the more advanced fundamental features of the Gradle build system.

Participants will spend a significant portion of the class with their hands on the keyboard, learning by doing, working through lab exercises designed to build on the presented material and explore the depths of Gradle. This class can take you from complete newcomer status to Gradle competence. Due to the in-depth treatment of the topics it is also very suitable for people who have experience working with Gradle. The class will be delivered by a Gradle Core Developer which gives you access to the deepest Gradle knowledge available. No question will remain unanswered.

Duration

4 days, with each day consisting of a 3.5 hour training session followed by 30-minute Q&A.

Objectives

Once the training is complete participants will be able to:

  • Write your own Gradle plugins
  • Integrate with Ant and Maven
  • Learn about copy and archive tasks in Gradle
  • Working with a powerful file system API
  • Build migration best practices
  • Learn how to build Java applications
  • How to efficiently move away from your current build environment
  • Learn how to deal with complex build requirements
  • Learn how to deal with large multi module builds

Prerequisites

This course assumes a good understanding of the Java language and working experience with Gradle and Groovy. If you are not experienced with Gradle or Groovy you should attend the Introduction to Gradle training class.

Audience

Experienced Gradle users are encouraged to attend the Advanced Gradle Fundamentals training.

Course Outline

Plugins

  • What are Gradle plugins?
  • The role of plugins
  • Packaging and distributing plugins
  • Review of core plugins

Working with files

  • The file tasks (e.g. Copy, Sync)
  • Filtering, excluding,
  • aggregating, renaming
  • Working with CopySpecs
  • Expanding and making archives (zip, tar etc.)
  • The Gradle file APIs
  • Best practices for working with files

Ant Integration

  • Gradle compared to Ant
  • When to utilize Ant in Gradle
  • Using Ant tasks in Gradle builds
  • Importing Ant builds
  • Migrating from Ant to Gradle

Dependency Management

  • Terminology
  • Repositories, metadata and transitive dependencies
  • Dependency configurations
  • Declaring dependencies
  • Customizing dependency resolution & conflict-management
  • Publishing artifacts (Maven & Ivy)

Extending the model

  • Extending existing objects
  • Object extensions
  • Object containers & configuration rules

Task inputs & outputs

  • The power of the input/output model
  • Describing inputs and outputs
  • Incremental builds
  • Inferring task dependencies

The Java plugin

  • Source sets
  • Project conventions
  • Automated testing
  • Building JARs

Multiproject builds

  • Defining a multiproject build
  • Avoiding duplicate configuration with configuration injection
  • Inter project dependencies
  • Downstream and upstream partial builds

The build runtime

  • Extending all builds with init scripts
  • Init script locations
  • Using the Gradle wrapper
  • Customizing the Gradle distribution with init scripts