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

The Hand that Rocked the Gradle

The Hand that Rocked the Gradle

An introduction to Gradle

Trevor Gowing

June 14, 2016
Tweet

More Decks by Trevor Gowing

Other Decks in Programming

Transcript

  1. The Hand that Rocks the An introduction to Gradle by

    @trevorgowing hosted by @bsgafrica
  2. Don’t be a fool, wrap your build tool! The wrapper

    is made up of a collections of files, namely: • gradlew (Unix shell script) • gradlew.bat (Windows batch file) • gradle/wrapper/gradle-wrapper.jar • gradle/wrapper/gradle-wrapper.properties https://memegenerator.net/instance/65420850
  3. Here there be daemons! How to enable the Gradle daemon:

    • Via environment variables - add -Dorg.gradle.daemon=true to the GRADLE_OPTS environment variable • Via properties file - add org.gradle.daemon=true to the «GRADLE_USER_HOME» /gradle.properties file. http://www.lovethispic.com/image/13730/i-can't-drown-my-demons
  4. Why does it never end? You can initiate a continuous

    build by supplying either the -t or --continuous switch: • gradle -t build • gradle --continuous build http://lizbrazier.com/hamsterwheel
  5. Migrating from Maven • Uses effective POM and effective settings

    (support for POM inheritance, dependency management, properties) • Supports both single module and multi module projects • Supports custom module names (that differ from directory names) • Generates general metadata - id, description and version • Applies maven, java and war plugins (as needed) • Generates dependencies (both external and inter-module)
  6. Migrating from Maven ... • Generates download repositories (inc. local

    Maven repository) • Adjusts Java compiler settings • Supports packaging of sources and tests • Supports TestNG runner • Generates global exclusions from Maven enforcer plugin settings
  7. References and Recommended Resources • Why Build your projects with

    Gradle by Benjamin Muschko http://www.drdobbs.com/jvm/why-build-your-java-projects-with-gradle/240 168608 • Gradle User Guide https://docs.gradle.org/current/userguide/userguide.html • Building and Testing with Gradle by Tim Berglund & Matthew McMullough http://www2.gradle.com/l/68052/2015-01-13/6dm • Gradle Beyond the Basics by Tim Berglund http://www2.gradle.com/l/68052/2015-01-26/23s5 • Gradle for Android and Java by Mark Vieira & Jeremy Silver https://www.udacity.com/course/gradle-for-android-and-java--ud867
  8. Keep in touch and thanks! • Twitter - https://twitter.com/trevorgowing •

    Google - https://plus.google.com/+trevorgowing • Linkedin - https://za.linkedin.com/in/trevorgowing • Meetup - http://www.meetup.com/members/113029642 Special thanks to Nitsan Wakart @nitsanw for encouraging me speak and for the awesome title suggestion! Another special thanks to BSG http://www.bsg.co.za for hosting and sponsoring food & drinks!