Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Gradle (at JUG Essen)

Introduction to Gradle (at JUG Essen)

An introduction to Gradle that has just a few slides and a long demo afterwards. The presentation starts with a short introduction and overview over Gradle Inc., the Gradle Build Tool and some build tool history. What follows is a demo that covers the following topics:

- Creating a gradle build with gradle init
- Writing custom tasks
- Discovering the build using build scans
- Defining custom source sets
- Extracting build logic into separate build scripts
- Extracting build logic into pre-compiled script plugins
- Extracting build logic into build plugins

The demo code can be found at https://github.com/britter/introduction-to-gradle

Benedikt Ritter

April 16, 2019
Tweet

More Decks by Benedikt Ritter

Other Decks in Programming

Transcript

  1. Agenda • Gradle Inc. Overview • Gradle Build Tool Overview

    • Demo ◦ Code: https://github.com/britter/introduction-to-gradle • Q&A
  2. What software do we create at Gradle Inc? Open Source

    Build Automation Commercial SaaS Product (on-premises) Development Productivity For Gradle and Maven
  3. Some Build Tool History make 1977 Simple build scripts Orchestration

    of build logic Apache Ant 2000 XML build scripts Reusable logic via tasks Dependency management via Ivy Apache Maven 2002 XML build descriptions Reusable logic via plugins Built-in dependency management Backed by central repository Gradle 2007 Declarative DSL in Groovy/Kotlin Build description with opt-in scriptability & plugin system Flexible dependency management Focus on performance Discoverable builds via build scans
  4. Gradle is flexible • Groovy / Kotlin DSL • Inline

    scripting • Pre-compiled script plugins • Plugin portal for reusable logic
  5. Gradle is fast • Build in parallelism • Gradle daemon

    • UP-TO-DATE checking • Locale cache • Remote cache
  6. Demo Agenda • Build Init • Simple Task - Zip

    all Sources • Custom Source Set and Task - IntegTest • Extract Source Set and Task to separate script • Make script a Pre-compiled script plugin • Create a Test configurations plugin to easily add more test configurations • Build Scans (always publish, tags, links, values)
  7. More cool Gradle Features… • Composite builds • Dependency meta

    data format • Dependency version alignment • Variant aware dependency resolution
  8. Can’t switch to Gradle? • Build scans are also available

    for Apache Maven! https://scans.gradle.com • Gradle Enterprise provides Build Acceleration for Maven Builds • Make your builds more reliable with Gradle Enterprise • Debug your builds with Gradle Enterprise
  9. Want to learn more? • Try out Gradle/Maven build scans

    for free at https://scans.gradle.com • Checkout the Dependency Management Webinar at https://gradle.com/blog/dependency-management-with-gradle-fundamentals/ • Read our latest blog post on build caching for Maven at https://gradle.com/blog/build-scans-and-build-caching-for-maven-with-gradle-enterprise • Request a personal demo of Gradle Enterprise at https://gradle.com/enterprise/contact