Skip Main Navigation
Page Content
This event has ended

Save This Event

Event Saved

Extending Gradle

Gradle Inc.

Wednesday, November 18, 2015 at 8:30 AM - Thursday, November 19, 2015 at 12:30 PM (PST)

Ticket Information

Ticket Type Sales End Price Fee Quantity
Standard Ended $900.00 $0.00

Share Extending Gradle

Event Details

COURSE SUMMARY


This training is a one day, hands-on, instructor lead training course designed for advanced Gradle users who want to learn more about the ins and outs of implementing extensions for Gradle builds. We'll touch on writing, testing, publishing and consuming custom tasks and plugins with the help of a real-world, practical example. Furthermore, the material will teach the Gradle APIs that allow for writing your own domain specific language.

DURATION


One day (If delivered virtually: two sessions of 3.5 Hours + 30 minutes Q&A)

OBJECTIVES


Upon completion of this course you will get/learn…

  • The importance of implementing non-functional requirements for build logic

  • Developing, testing, publishing and consuming custom build logic

  • Developing, testing, publishing and consuming plugins

  • How to extend Gradle’s domain specific language

  • A deep understanding of the relevant Gradle core APIs

  • Real-world best practices for Gradle plugin development


AUDIENCE


This course is designed for developers, architects and build masters that author build logic on a regular basis and want to learn best practices for organizing build code, plugin development and writing custom extensions for Gradle.

PREREQUISITES


Basic knowledge of Gradle core concepts are required. Attendance of course Introduction to Gradle is recommended. A lot of the example code is going to be developed in Groovy. Basic knowledge of Groovy is expected.

OUTLINE


The proposed four-hour Gradle for Android course is divided into four hour-long segments, each providing time for some Q&A plus a short break before continuing into the next segment.

  • Introduction





      • The non-functional requirements of a build

      • Maintaining, reusing and testing build logic

      • Extending Gradle’s Domain Specific Language

      • Typical use cases

      • Concepts covered in this course





  • Case study build logic





      • Overview of functionality

      • Discussion of initial implementation

      • Flaws and shortcomings of the implementation

      • Implementation plan





  • Writing custom tasks





      • Comparing default tasks with custom tasks

      • Task types provided by the Gradle API

      • Custom task Gradle core API

      • Implementing custom tasks

      • Lab: Rewriting logic as custom tasks

      • Task inputs & outputs

        • Advantages of incremental builds

        • Declaring task inputs and outputs

        • Understanding internal mechanics



      • Lab: Declaring and using custom task inputs/outputs





  • Testing custom tasks





      • Recap: Types of tests, testing pyramid

      • Testing support in Gradle core

      • Community testing support: Nebula Test

      • Declaring custom tasks in buildSrc project

        • Overview

        • Benefits

        • Implications



      • Lab: Declaring custom task classes in buildSrc project

      • Exploring ProjectBuilder API for writing tests

      • Setting up testing support in buildSrc project

      • Lab: Writing unit tests for custom tasks





  • Bundling, publishing and consuming custom tasks





      • Reusing custom tasks across projects

      • Setting up the build for a standalone project

      • Lab: Setting up a standalone Gradle project for custom tasks

      • Creating JAR containing custom tasks

      • Publishing JAR containing custom tasks

      • Lab: Building and publishing custom task JAR

      • Consuming custom task artifacts in other builds

      • Lab: Using external custom tasks in Gradle project





  • Plugin basics





      • The role of plugins

      • Types of plugins and their use cases

      • Overview of core and community plugins

      • Gradle’s plugin portal

      • Consuming script plugins in a build

      • Consuming binary plugins in a build

      • Applying plugins through buildscript block vs. plugin DSL





  • Writing and testing binary plugins





      • Plugin Gradle core API

      • Implementing a plugin

      • Lab: Writing a plugin in buildSrc project

      • Defining a plugin identifier

        • Meaningful and unique identifiers

        • Mechanics



      • Lab: Adding a plugin identifier to plugin

      • Lab: Writing unit tests for plugins

      • Outlook: Writing integration and functional tests





  • Bundling, publishing and consuming binary plugins





      • Lab: Moving plugin code into standalone project

      • Generating sources and Javadoc artifacts

      • Lab: Building and publishing plugin artifacts

      • Consuming plugin artifact in other builds

      • Lab: Using external plugin in Gradle project

      • Outlook: Publishing to Gradle plugin portal





  • Extending Gradle's build language





      • Philosophy

      • Relevant Gradle core API

      • Extra properties

        • Use case

        • Declaring and using extra properties



      • Lab: Declaring and using properties for plugin

      • Extensions

        • Use case

        • Declaring and using extensions

        • Deeply nested structures



      • Lab: Declaring and using an extension for plugin

      • Tips & Tricks

        • Deferring evaluation order

        • Mapping extension values to custom task properties



      • Examples of plugin DSLs in the wild

      • Going further

        • Domain Object Collections

        • Configuration rules

        • Using NamedDomainObjectContainer

        • Lab: Simplifying plugin logic with the help of these concepts







  • Best practices




    • Convention over configuration

    • Lab: Implementing the concept

    • Separating capabilities from conventions

    • Lab: Implementing the concept


Have questions about Extending Gradle? Contact Gradle Inc.

When

Wednesday, November 18, 2015 at 8:30 AM - Thursday, November 19, 2015 at 12:30 PM (PST)


  Add to my calendar

Organizer

Gradle Inc.

Gradle Inc. is the engine behind the award winning open source build tool Gradle as well as Gradle Enterprise. While fundamentally a product company, we also provide support, consulting, implementation assistance, and custom extensions to organizations using Gradle. 

  Contact the Organizer

Please log in or sign up

In order to purchase these tickets in installments, you'll need an Eventbrite account. Log in or sign up for a free account to continue.