Gradle Leveraging Groovy for Building Java Applications. Hans Dockter Gradle Project Lead

Similar documents
Enter the Gradle Hans Dockter CEO, Gradleware Founder Gradle

This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

Why switch exist-db from Ant to Maven?

Getting Started with Gradle

... Fisheye Crucible Bamboo

Software Engineering - Development Infrastructure 2. Kristjan Talvar Nortal

Apache Buildr in Action

The Workshop. Slides (you have a copy in the zip) Practical labs Ask questions

Hello Gradle. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

I Got My Mojo Workin'

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Build Automation Kurt Christensen

Who Moved My Module? 1

Tattletale. What is Tattletale? Enterprise archives JBoss Application Server 7 Putting it all together Roadmap

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

Rocking the Gradle! Hans Dockter CEO, Gradleware Founder Gradle

Package Management and Build Tools

Groovy & Grails Scripting for Modern Web Applications. Rohit Nayak Talentica Software

IntelliJ IDEA, the most intelligent Java IDE

Testing with Soap UI. Tomaš Maconko

Gradle. The Basics and Beyond

Javaentwicklung in der Oracle Cloud

Oracle Forms and Oracle APEX The Odd Couple

MAVEN INTERVIEW QUESTIONS

Tuesday, April 26, 2011

Chapter 1. Installation and Setup

ArcGIS Runtime SDK for Java: Building Apps. Mark Baird

JavaBasel 16. René Gröschke. Gradle 3.0 and beyond. Gradle 3.0 and beyond - #javabasel

Nexus for Component Management. Nexus for Component Management

RASP Library for Java Version 2.0.0

Getting Started with Rational Team Concert

Selenium Testing Training

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

Groovy. Extending Java with scripting capabilities. Last updated: 10 July 2017

Selenium Testing Course Content

Why real integration developers ride Camels

JBoss Tattletale 1.1 Developer's Guide

Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 13, 2012 Managed by UT-Battelle for the Department of Energy

Developing Rules Applications with Red Hat JBoss BRMS (JB463)

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

Distributing JavaFX Applications with Java WebStart and Artifactory

Hello Maven. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Automated Testing of Tableau Dashboards

JBoss Tattletale. Betraying all your project's naughty little secrets

Seminar report Google App Engine Submitted in partial fulfillment of the requirement for the award of degree Of CSE

JVM Survival Guide. Hadi Hariri

Continuous Integration & Code Quality MINDS-ON NUNO 11 APRIL 2017

Maven 2 & Continuum. by Trygve Laugstøl

Überraschend mehr Möglichkeiten. Orcas: Continuous Delivery for Databases. A Framework for Continuous Delivery in Database Environments.

Enabling Application Lifecycle Development in JDeveloper

RED HAT ENTERPRISE LINUX. STANDARDIZE & SAVE.

A Glance Over the Serverless Framework

JBoss Users & Developers Conference. Boston:2010

Lab 5 Exercise Build and continuous integration tools

HOW WE MOVED FROM JAVA TO SCALA

Migrating traditional Java EE applications to mobile

Mitchell Bosecke, Greg Burlet, David Dietrich, Peter Lorimer, Robin Miller

Advanced Java Testing. What s next?

GAVIN KING RED HAT CEYLON SWARM

SpringSource Tool Suites 3.0.0

Turbo boost your digital app test automation with Jenkins

Extending Java TM TM And Developing DSLs With JetBrains MPS Open- Source Language Workbench

Advanced Dependency Management with Gradle. Benjamin Muschko, Gradle Inc.

Configuration & Build Management

m2e 1.2 Release Review

Language alone won t pay your bills. Alan Franzoni - EP 2012 twitter: franzeur website:

Agile Engineering. and other stuff I m working on

Orchestrate JBoss Middleware with Ansible Tower Red Hat Summit San Francisco

Development tools: Version control, build tools, and integrated development environments 1

JBoss DNA. Randall Hauch Principal Software Engineer JBoss Data Services

An introduction to Headless Content Management Systems

Project Horizon Technical Overview. Steven Forman Principal Technical Consultant

Introduction to project industrialization using Maven YaJUG 06/10/2009. Copyright Pierre-Antoine Grégoire License Creative Commons 2.

About me. Jesper Pedersen. Project lead for. Chairman for Boston JBoss User Group. Core developer, JBoss by Red Hat

REASONS TO USE A BINARY REPOSITORY MANAGER WHEN DEVELOPING WITH. White Paper

PDSOE Workspace Management and Organisation. Marko Rüterbories Senior Consultant

ERIC YONGE EYStudios

Apache Karaf Cave 4.x - Documentation

Rubix Documentation. Release Qubole

Extreme Java Productivity with Spring Roo and Spring 3.0

Continuous Delivery of your infrastructure. Christophe

9 th CA 2E/CA Plex Worldwide Developer Conference 1

You Can t Move Forward Unless You Can Roll Back. By: Michael Black

Building a (resumable and extensible) DSL with Apache Groovy Jesse Glick CloudBees, Inc.

Application Deployment With Zend Server 5.5 Beta

Modernizing Servers and Software

Maven in the wild. An introduction to Maven

android-espresso #androidespresso

White Paper(Draft) Continuous Integration/Delivery/Deployment in Next Generation Data Integration

CASE STUDY IT. Albumprinter Adopting Redgate DLM

Sonatype CLM Enforcement Points - Nexus. Sonatype CLM Enforcement Points - Nexus

Continuous integration from the ground up

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process

Drools: A detailed introduction. Drools White Paper

maven Build System Making Projects Make Sense

Making SOA Groovy Paul Fremantle,

Visually Create Web Databases Apps with WDSC. By Jim Mason

How to Build an Appium Continuous Testing Pipeline

Sonatype CLM - IDE User Guide. Sonatype CLM - IDE User Guide

#jenkinsconf. Jenkins user plugin. This time it's. Jenkins User Conference Israel. Shiran JFrog

Transcription:

Gradle Leveraging Groovy for Building Java Applications Hans Dockter Gradle Project Lead mail@dockter.biz

About Me Founder and Project Lead of Gradle Independent Consultant Trainer for Skills Matter (TTD, Patterns, DDD) Past Senior Developer at Krugle and Volkswagen Commiter to JBoss and Founder of JBoss-IDE

Agenda Why a new build system The problem with Ant & Maven The importance of Project Automation Why an internal DSL, why Groovy? Introduction to Gradle Dependency Based Programming Build-By-Convention Managing your Jars Managing Multi-Project Builds Organizing your Build Logic

Why a new build system?

Our Vision (Quote from Moshé Feldenkrais) Make the impossible possible. Make the possible easy. Make the easy elegant.

The old bulls...

Ant

Ant - Pros Flexible You are in charge. Dependency based programming. A wealth of helpful tasks.

Ant - Cons No Build-By-Convention XML Anemic Interaction with Java Home-Baked general purpose elements Steep learning curve Pale imitation of a real language

Maven

Maven - Pros Build-By-Convention Many plugins (although a lot are for self-management) Some form of transitive dependency management

Maven - Cons XML Anemic Interaction with Java (Implicit) general purpose elements Extremely verbose Maven does not offer dependecy based programming. Frameworkitis...

Frameworkitis...... is the disease that a framework wants to do too much for you or it does it in a way that you don t want but you can t change it. It s fun to get all this functionality for free, but it hurts when the free functionality gets in the way. But you are now tied into the framework. To get the desired behavior you start to fight against the framework. And at this point you often start to lose, because it s difficult to bend the framework in a direction it didn t anticipate. Toolkits do not attempt to take control for you and they therefore do not suffer from frameworkitis. (Erich Gamma)

Solution Because the bigger the framework becomes, the greater the chances that it will want to do too much, the bigger the learning curves become, and the more difficult it becomes to maintain it. If you really want to take the risk of doing frameworks, you want to have small and focused frameworks that you can also probably make optional. If you really want to, you can use the framework, but you can also use the toolkit. That s a good position that avoids this frameworkitis problem, where you get really frustrated because you have to use the framework. Ideally I d like to have a toolbox of smaller frameworks where I can pick and choose, so that I can pay the framework costs as I go.(erich Gamma)

There are no simple builds.

Project Automation A build can do far more than just building the jar. Often repetitive, time consuming, boring stuff is still done manually. Deployment, release management, generating documentation Manually means: less reliable and less frequently. Automated means: Continuous feedback, executable documents, no secret knowledge. Essential for agile projects. Many of those tasks are very company specific. Maven & Ant are not well suited for this.

Gradle Overview 1 First release in April 2008 A flexible general purpose build tool Offers dependency based programming with a rich API. Build-by-convention plugins on top Powerful multi-project support Powerful dependency management based on Apache Ivy.

Gradle Overview 2 Build Scripts are written in Groovy We get our general purpose elements from a full blown OO language. The perfect base to provide a mix of: Small frameworks, toolsets and dependency based programming. Rich interaction with Java Gradle is NOT a framework. Gradle is mostly written in Java with a Groovy DSL layer on top. Offers very good documentation (70+ Pages user s guide) Commiter -> Steven Devijver, Hans Dockter, Adam Murdoch, Tom Eyckmans, Russel Winder

Live Demo - Hello World

Live Demo - Java

Java Plugin - Phases init resources compile testcompile test libs dists

Dependencies DSL on top of Apache Ivy Integrates with Ivy/Maven infrastructure Support for client modules. Support for storing libs in SVN. Extremely powerful and flexible. Compile only against first level deps.

Client Modules addclientmodule(confs: ['compile'], id: "org.codehaus.groovy:groovy-all:1.5.4") { adddependency("commons-cli:commons-cli:1.0:jar") addclientmodule("org.apache.ant:ant:1.7.0") { adddependency("org.apache.ant:ant-launcher:1.7.0:jar") adddependency("org.apache.ant:ant-junit:1.7.0") } } No need for XML descriptors. No need to set up your own repository.

Libs in Source Control System addflatdirresolver(lib, $rootdir/lib ) compile :commons-io:1.4.1 testcompile :junit:junit:4.4 Out of the box experience Perfect match with client modules

Multi-Project Builds Configuration Injection Partial builds Separate Config/Execution Hierarchy Arbitrary Multiproject Layout

ultimateapp api webservice // build script ultimate app subprojects { manifest.mainattributes([ 'Implementation-Title': 'Gradle', 'Implementation-Version': '0.1' ]) dependencies { compile "commons-lang:commons-lang:3.1" testcompile "junit:junit:4.4" } sourcecompatibility = 1.5 targetcompatibility = 1.5 test { fork(dir: $projectdir) exclude '**/Abstract*' } }

Organizing Build Logic No unnecessary indirections If build specific: Within the script Build Sources Otherwise: Jar

Gradle Wrapper Use Gradle without having Gradle installed Useful for: CI User friendly

There are really no simple builds.

The Gradle Build Gradle is build with Gradle Automatic release management Automatic user s guide generation Automatic distribution Behavior depends on task execution graph

Release Management The version number is automatically calculated The dist is build and uploaded to codehaus For trunk releases, a new svn branch is created. A tag is created. A new version properties file is commited. The download links on the website are updated

User s Guide The user s guide is written in LaTeX and generated by our build.ä The source code examples are mostly real tests and are automatically included. The expected output of those tests is automatically included. The tests are run. The current version is added to the title.

Uploading & Execution Graph Based on the task graph we set: Upload Destination Version Number

Production Ready? YES! (If you don t need a missing feature). The first big enterprise builds are migrating from Maven to Gradle. We are about to release 0.6. We are transparent: The user s guide list all missing features which might be known from other tools. Roadmap.

Roadmap see http://www.gradle.org/roadmap

Call for Contribution It is an exciting time for build systems. A rare opportunity to change and revolutionize a Java base technology. Use, Give Feedback, Provide Patches, Become a Committer