COURSE

Introduction to Gradle

Learn how to better manage and build your projects using Gradle.

  • 2 Days
  • Beginner
  • In-person / Online
  • £ On Request

Overview

Within Agile methods such as SCRUM and Kanban, automated build management is essential to enable continuous testing, integration and deployment. Without a fully autonomous ‘build->test->release’ cycle to act as its heartbeat, an Agile team has no effective means of detecting errors or measuring progress. Additionally, if the build system is not self-contained and isolated from external dependencies, it is challenging for developers to transfer their work between machines and set up new ones.

Traditionally, build management in Java has been based around Maven. Whilst Maven enables rapid progress at the beginning of a project, its inflexibility quickly leads to issues as the project grows. In particular, the XML-based syntax and complex underlying architecture means that customising the framework for bespoke project needs is an arduous process.

Gradle is an alternative to Maven which has quickly overtaken it as the default build tool in JEE. Unlike Maven, a Gradle build script is a program written in the Groovy JVM scripting language (or Kotlin), making it trivial to inject arbitrary functionality into the build process. This DSL (Domain Specific Language) based approach is the same as that used to great effect within the ‘Ruby on Rails’ web framework.

Gradle embeds micro-frameworks (aka Plugins) which support all the standard tasks required of a build tool. It is fully interoperable with Maven and can, for example, download libraries from existing Maven repositories. In addition, it is designed to enable the modern style of ‘polyglot programming’ – where multiple JVM languages are used within the same project.

This course will enable developers to manage their builds with Gradle, extend the tool to shorten and simplify their deployment process, and use Gradle's power features to explore new forms of software development.

Outline

Overview of Build Automation

  • The early days of Make and Ant
  • How Rake pioneered DSLs in ‘RoR’
  • Why Maven became dominant in JEE
  • Issues with the Maven approach
  • The emergence of Gradle

Introduction to Groovy

  • Dynamic typing within the JVM
  • Basic syntax and concepts
  • Closures and functional programming
  • Techniques for building DSLs

Introducing Gradle

  • Creating a build script for a console application
  • Making the script self-contained via the Wrapper
  • Configuring and connecting to repositories
  • Managing dependencies and creating discrete scopes
  • Exclusions and controlling transitive dependencies

Gradle Builds in Depth

  • The lifecycle of a build within Gradle
  • Creating a graph of inter-dependent tasks
  • Managing the file system and source code control (VCS)
  • Configuring source sets using the Java plugin
  • Installing and managing additional plugins
  • Enabling TDD, BDD and CI using Gradle plugins
  • How the Gradle Daemon reduces startup times
  • Documenting your script for external use

Advanced Uses of Gradle

  • Building multi-module JEE Web Applications
  • Enabling use of Java, Scala and Clojure within the same project
  • Running code quality tools (Checkstyle, Jacoco, PMD etc…)
  • Using Gradle to build Android and iOS mobile applications
  • Supporting alternative Java Web Architectures (e.g. Play)
  • Advantages of using Gradle to build C and C++ projects

Requirements

  • Delegates must be proficient with a JVM language (Java, Groovy, Scala or Clojure) with at least one year's experience developing applications in industry. For Kotlin DSLs, please ask in your enquiry.
COURSE

Introduction to Gradle

Learn how to better manage and build your projects using Gradle.

  • 2 Days
  • Beginner
  • In-person / Online
  • £ On Request

ShapeCreated with Sketch.
ShapeCreated with Sketch.
image/svg+xml
image/svg+xml