Slide 1

Slide 1 text

ANDRES ALMIRAY IX-CHEL RUIZ @AALMIRAY @IXCHELRUIZ HARDER, BETTER, STRONGER, FASTER

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

WHAT

Slide 5

Slide 5 text

Gradle is a build tool designed to take advantage of conventions over (not instead) configuration, while staying flexible enough to be customized to the needs of a particular project. In other words, the build tool bends to the project’s will, not the other way around.

Slide 6

Slide 6 text

Follows the Maven conventions. Expressive : Prefers a DSL for describing what needs to be done. Extensible : Has a growing an thriving plugin ecosystem. Productive : Fosters fast and reproducible builds. Convenient : It’s CI friendly (gradle wrapper).

Slide 7

Slide 7 text

WHY

Slide 8

Slide 8 text

RebelLabs © ZeroTurnaround

Slide 9

Slide 9 text

RebelLabs © ZeroTurnaround

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Caching of task input and outputs Richer, configurable lifecycle The Gradle deamon The Gradle wrapper Multi-project builds are hassle free Plugin development is more intuitive Better documentation overall

Slide 12

Slide 12 text

HOW

Slide 13

Slide 13 text

$ curl -s get.gvmtool.net | bash $ gvm install gradle

Slide 14

Slide 14 text

. ├── build.gradle ├── pom.xml └── src ├── main │ └── java │ └── sample │ └── Foo.java └── test └── java └── sample └── FooTest.java

Slide 15

Slide 15 text

4.0.0 com.acme sample jar 0.0.0-SNAPSHOT junit junit 4.12 test

Slide 16

Slide 16 text

apply plugin: 'java' apply plugin: 'maven-publish' version = '0.0.0-SNAPSHOT' group = 'com.acme' repositories { jcenter() } dependencies { testCompile 'junit:junit:4.12' }

Slide 17

Slide 17 text

SCENARIOS

Slide 18

Slide 18 text

ü  Executable/Launchable application ü  Executable fat jar ü  Installable application

Slide 19

Slide 19 text

EXECUTABLE LAUNCHABLE APPLICATION

Slide 20

Slide 20 text

org.codehaus.mojo exec-maven-plugin 1.2.1 sample.Foo $ mvn compile exec:java

Slide 21

Slide 21 text

apply plugin: 'java' apply plugin: 'application' mainClassName = 'sample.Foo' $ gradle run

Slide 22

Slide 22 text

EXECUTABLE FAT JAR

Slide 23

Slide 23 text

org.apache.maven.plugins maven-shade-plugin 2.3 sample.Foo $ mvn package –DskipTests=true

Slide 24

Slide 24 text

plugins { id 'com.github.johnrengelman.shadow' version '1.2.1' } apply plugin: 'java' apply plugin: 'application' mainClassName = 'sample.Foo' repositories { jcenter() } dependencies { compile 'commons-lang:commons-lang:2.6' } $ gradle shadowJar

Slide 25

Slide 25 text

Installable application . ├── bin │ ├── sample │ └── sample.bat └── lib ├── commons-lang-2.6.jar └── sample-0.0.0-SNAPSHOT.jar

Slide 26

Slide 26 text

1.  Add assembly plugin 2.  Create assembly descriptor 1.  Dist option for building the directory structure 2.  Zip option for packing all in a single file 3.  Create launch scripts (for all target platforms!) 4.  Might require custom profiles OR configure the appassembler plugin

Slide 27

Slide 27 text

apply plugin: 'java' apply plugin: 'application’ mainClassName = 'sample.Foo' repositories { jcenter() } dependencies { compile 'commons-lang:commons-lang:2.6' } $ gradle distZip

Slide 28

Slide 28 text

BUT WAIT, THERE’S MORE

Slide 29

Slide 29 text

$ gvm install lazybones $ lazybones create gradle-quickstart sample

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

license versions stats bintray shadow izpack java2html git coveralls asciidoctor jbake markdown livereload gretty Nexus watch wuff spawn

Slide 32

Slide 32 text

THANK YOU! HTTP://PEOPLE.CANOO.COM/SHARE ANDRES ALMIRAY IX-CHEL RUIZ @AALMIRAY @IXCHELRUIZ