+ All Categories
Home > Documents > Uberconf 10

Uberconf 10

Date post: 26-Jan-2015
Category:
Upload: skills-matter
View: 102 times
Download: 0 times
Share this document with a friend
Description:
 
40
Monday, October 25, 2010
Transcript
Page 1: Uberconf 10

Monday, October 25, 2010

Page 2: Uberconf 10

Gradle

A Better Way To Build

Monday, October 25, 2010

Page 3: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 3

About Hans Dockter

• Founder, Gradle• CEO, Gradle Inc.• Before Gradle:

o Trainer, Mentor, Consultantfor Enterprise Java.

o Senior Developer for Krugle and Volkswagen.

• Prehistoric ;): Committer to JBoss and founder of JBoss-IDE.

Monday, October 25, 2010

Page 4: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• A general purpose build system• It comes with a Groovy DSL and a Java core.• Provides build-in support for Java, Groovy, Scala,

Web, OSGi projects.• Gradle provides exciting solutions for many of the

big pain points you often have with current builds.– Maintainability– Performance– Usability

4

What is Gradle?

Monday, October 25, 2010

Page 5: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

What is Gradle?

Gradle is declarative

You specify the WHAT

Gradle figures out the HOW

Monday, October 25, 2010

Page 6: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

ExtensibleBuild Language

instead of a Build Framework

Monday, October 25, 2010

Page 7: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Deep Configuration API• Deep Execution API • Rich API• Extendable Domain Objects• Custom Tasks• Custom Plugins

7

Extending Gradle

Monday, October 25, 2010

Page 8: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Custom Declarative Elements

usePlugin ʻeditionsʼ

productEditions {enterprise core, plugins, powerAddonspublic core, plugins, openApi

}

> gradle enterpriseEditionZip> gradle publicEditionTar

Monday, October 25, 2010

Page 9: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Gradle is

declarativewithout

being rigid

Monday, October 25, 2010

Page 10: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

The Build Language

Source Sets

Dependencies

Configurations

Archives

ProjectsArtifacts

Custom Tasks

Plugins

Monday, October 25, 2010

Page 11: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

XML and the What

It does not matter muchwhether a build systemuses XML or Groovy for

declaring things.

Monday, October 25, 2010

Page 12: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Pleaseno

messybuild scripts

Monday, October 25, 2010

Page 13: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Separate Imperative from Declarative• Custom Tasks/Plugins• BuildSrc• Jar

13

Organizing Build Logic

Monday, October 25, 2010

Page 14: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 14

buildscript { repositories { mavenCentral() } dependencies { classpath 'commons-math:commons-math:1.1' }}

task math << {org.apache.commons.math.fraction.Fraction lhs = new

org.apache.commons.math.fraction.Fraction(1, 3);// do something

}

Build Script Libraries

Monday, October 25, 2010

Page 15: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Performanceis one of the

biggestpain points

of complex builds.

Monday, October 25, 2010

Page 16: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Should clean be required for a

reliable build?(Hint: We have the

21st century)

Monday, October 25, 2010

Page 17: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Incremental Build• Parallel Testing• Soon: Parallel Builds• Not too distant future: Distributed testing/builds• Rich Model

17

Speed Improvements

Monday, October 25, 2010

Page 18: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Gradle isa

BuildIntegration

Tool

Monday, October 25, 2010

Page 19: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Ant Tasks• Deep import of Ant builds• Retrieve/Deploy to Maven/Ivy repositories• Autogeneration of pom.xml/ivy.xml• Future: Deep import of Maven builds

19

Build Integration Features

Monday, October 25, 2010

Page 20: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Mission Critical!• Very expensive if the build system can’t adapt to the

existing project layout:– Freeze– Project automation not working for a while– Different branches (unreliable, hard to compare, ...)

• Gradle’s suppleness enables baby steps.– Gradle can adapt to any project layout.– No separate branches– Comparable --> You can write tests

20

Build Migration

Monday, October 25, 2010

Page 21: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Dependency Management

• Transitive Dependencies• Repository less dependencies are 1st class citizens.• Excludes per configuration or dependency• Very flexible repository handling• Based on Apache Ivy• Powerful API• Much More ...

Monday, October 25, 2010

Page 22: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Deep Integration withAnt Builds

> gradle helloHello, from Gradle...Here comes Ant...[ant:echo] Hello, from Ant

<project> <target name="hello" depends="intro"> <echo>Hello, from Ant</echo> </target></project>

ant.importBuild 'build.xml'

hello.doFirst { println 'Here comes Ant' }task intro << { println 'Hello, from Gradle'}

Monday, October 25, 2010

Page 23: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Supports Maven/Ant/Gradle with pom or ivy.

• Supports any repository layout

• Very advanced features

• Gradle Artifactory plugin

• Integrated in Gradle Hudson plugin.

• Gradle Inc. has business partnership with JFrog.

23

Build Eco System

Monday, October 25, 2010

Page 24: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 25: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 26: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 27: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 28: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 29: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Process is very important.

But it is all aboutYOUR

process

Monday, October 25, 2010

Page 30: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Their is no one-size-fits-all

project structurefor the

enterprise.

Monday, October 25, 2010

Page 31: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

The physical structure of your

projects should be determined by

your requirements.

(What, if not?)

Monday, October 25, 2010

Page 32: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Be as rigid as

YOUwant

Monday, October 25, 2010

Page 33: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

FRAME-WORKITIS

Monday, October 25, 2010

Page 34: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 34

Fighting with a Framework

Monday, October 25, 2010

Page 35: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Monday, October 25, 2010

Page 36: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

ExtensibleBuild Language

instead of a Build Framework

Monday, October 25, 2010

Page 37: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Gradle Wrapper

>./gradlew assemble

Monday, October 25, 2010

Page 38: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

• Very active community (mailing-list, patches, issues)• Apache v2 license.• Excellent user’s guide (200+ pages) + many samples• Frequent releases, multiple commits per day• Quality is king:

– 2800 unit tests, Many hundreds of integration test– Healthy codebase– low defect rate

• Commiter -> Steve Appling, Hans Dockter, Tom Eyckmans, Adam Murdoch, Russel Winder

38

Project Background

Monday, October 25, 2010

Page 39: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 39

Commercial Support: www.gradle.biz

Monday, October 25, 2010

Page 40: Uberconf 10

SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.

Q&A

Monday, October 25, 2010


Recommended