SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
HARDER, BETTER, 
STRONGER, FASTER 
ANDRES ALMIRAY IX-CHEL RUIZ 
@AALMIRAY @IXCHELRUIZ
WHAT
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.
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).
WHY
RebelLabs © ZeroTurnaround
RebelLabs © ZeroTurnaround
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
HOW
$ curl -s get.gvmtool.net | bash 
$ gvm install gradle
.! 
├── build.gradle! 
├── pom.xml! 
└── src! 
├── main! 
│ └── java! 
│ └── sample! 
│ └── Foo.java! 
└── test! 
└── java! 
└── sample! 
└── FooTest.java!
<project xmlns="http://maven.apache.org/POM/4.0.0"! 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"! 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">! 
<modelVersion>4.0.0</modelVersion>! 
<groupId>com.acme</groupId>! 
<artifactId>sample</artifactId>! 
<packaging>jar</packaging>! 
<version>0.0.0-SNAPSHOT</version>! 
! 
<dependencies>! 
<dependency>! 
<groupId>junit</groupId>! 
<artifactId>junit</artifactId>! 
<version>4.11</version>! 
<scope>test</scope>! 
</dependency>! 
</dependencies>! 
</project>! 

apply plugin: 'java'! 
apply plugin: 'maven-publish'! 
! 
version = '0.0.0-SNAPSHOT'! 
group = 'com.acme'! 
! 
repositories {! 
jcenter()! 
}! 
! 
dependencies {! 
testCompile 'junit:junit:4.11'! 
}! 

SCENARIOS
ü Executable/Launchable 
application 
ü Executable fat jar 
ü Installable application
EXECUTABLE 
LAUNCHABLE 
APPLICATION
<project ...>! 
<build>! 
<plugins>! 
<plugin>! 
<groupId>org.codehaus.mojo</groupId>! 
<artifactId>exec-maven-plugin</artifactId>! 
<version>1.2.1</version>! 
<configuration>! 
<mainClass>sample.Foo</mainClass>! 
</configuration>! 
</plugin>! 
</plugins>! 
</build>! 
</project>! 
$ mvn compile exec:java 

apply plugin: 'java'! 
apply plugin: 'application'! 
! 
mainClassName = 'sample.Foo'! 
$ gradle run 

EXECUTABLE 
FAT JAR
<plugins> 
<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-shade-plugin</artifactId> 
<version>2.3</version> 
<configuration> 
<transformers> 
<transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
<manifestEntries> 
<Main-Class>sample.Foo</Main-Class> 
</manifestEntries> 
</transformer> 
</transformers> 
</configuration> 
</plugin> 
<plugins> 
$ mvn package –DskipTests=true 

plugins {! 
id 'com.github.johnrengelman.shadow' version '1.1.2'! 
}! 
! 
apply plugin: 'java'! 
apply plugin: 'application'! 
! 
mainClassName = 'sample.Foo'! 
! 
repositories { jcenter() }! 
! 
dependencies { compile 'commons-lang:commons-lang:2.6' }! 
$ gradle shadowJar 

Installable application 
.! 
├── bin! 
│ ├── sample! 
│ └── sample.bat! 
└── lib! 
├── commons-lang-2.6.jar! 
└── sample-0.0.0-SNAPSHOT.jar!
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! 

apply plugin: 'java'! 
apply plugin: 'application’! 
mainClassName = 'sample.Foo'! 
! 
repositories {! 
jcenter()! 
}! 
! 
dependencies {! 
compile 'commons-lang:commons-lang:2.6'! 
}! 
$ gradle distZip 

BUT WAIT, 
THERE’S 
MORE
$ gvm install lazybones 
$ lazybones create gradle-quickstart 
sample
license 
versions 
stats 
bintray 
shadow 
izpack 
java2html 
git 
coveralls 
asciidoctor 
jbake 
markdown 
livereload 
gretty 
Nexus 
watch 
wuff 
spawn
THANK YOU! 
HTTP://PEOPLE.CANOO.COM/SHARE 
Andres Almiray Ix-chel Ruiz 
@aalmiray @ixchelruiz

Contenu connexe

Tendances

Tendances (20)

Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
Gradle
GradleGradle
Gradle
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
Gradle and Android Studio : Best of Friends
Gradle and Android Studio : Best of FriendsGradle and Android Studio : Best of Friends
Gradle and Android Studio : Best of Friends
 
Intro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speedIntro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speed
 
Gradle explained
Gradle explainedGradle explained
Gradle explained
 
Spec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSpec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlow
 
Building with Gradle
Building with GradleBuilding with Gradle
Building with Gradle
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
GradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugGradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggug
 
DevOps Toolchain v1.0
DevOps Toolchain v1.0DevOps Toolchain v1.0
DevOps Toolchain v1.0
 
Gradle
GradleGradle
Gradle
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Infinum Android Talks #14 - Gradle plugins
Infinum Android Talks #14 - Gradle pluginsInfinum Android Talks #14 - Gradle plugins
Infinum Android Talks #14 - Gradle plugins
 
Building at a glance
Building at a glanceBuilding at a glance
Building at a glance
 
Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Why you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch MavenWhy you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch Maven
 

En vedette

Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
Igor Khotin
 
Setting up an Investment Bank
Setting up an Investment BankSetting up an Investment Bank
Setting up an Investment Bank
rizwan ansari
 

En vedette (14)

Gradle
GradleGradle
Gradle
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive Programming
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradle
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!
 
Gradle
GradleGradle
Gradle
 
Android Gradle about using flavor
Android Gradle about using flavorAndroid Gradle about using flavor
Android Gradle about using flavor
 
Why gradle
Why gradle Why gradle
Why gradle
 
Terraforming organisations
Terraforming organisationsTerraforming organisations
Terraforming organisations
 
Gradle
GradleGradle
Gradle
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Setting up an Investment Bank
Setting up an Investment BankSetting up an Investment Bank
Setting up an Investment Bank
 

Similaire à Javaone - Gradle: Harder, Better, Stronger, Faster

Similaire à Javaone - Gradle: Harder, Better, Stronger, Faster (20)

Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Features everywhere
Features everywhere Features everywhere
Features everywhere
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with Gradle
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Slim3 quick start
Slim3 quick startSlim3 quick start
Slim3 quick start
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
Scala, Functional Programming and Team Productivity
Scala, Functional Programming and Team ProductivityScala, Functional Programming and Team Productivity
Scala, Functional Programming and Team Productivity
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
 
Gradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, FasterGradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, Faster
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 

Plus de Andres Almiray

Plus de Andres Almiray (20)

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abierto
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianza
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidencia
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java Developers
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven Puzzlers
 
Maven Puzzlers
Maven PuzzlersMaven Puzzlers
Maven Puzzlers
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java Developers
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of light
 
Building modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and LayrryBuilding modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and Layrry
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpc
 
Building modular applications with JPMS and Layrry
Building modular applications with JPMS and LayrryBuilding modular applications with JPMS and Layrry
Building modular applications with JPMS and Layrry
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
 
Apache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and YouApache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and You
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years ago
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years ago
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in tech
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with Gradle
 
Gradle ex-machina
Gradle ex-machinaGradle ex-machina
Gradle ex-machina
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Javaone - Gradle: Harder, Better, Stronger, Faster

  • 1. HARDER, BETTER, STRONGER, FASTER ANDRES ALMIRAY IX-CHEL RUIZ @AALMIRAY @IXCHELRUIZ
  • 2.
  • 3.
  • 5. 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.
  • 6. 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).
  • 7. WHY
  • 10.
  • 11. 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
  • 12. HOW
  • 13. $ curl -s get.gvmtool.net | bash $ gvm install gradle
  • 14. .! ├── build.gradle! ├── pom.xml! └── src! ├── main! │ └── java! │ └── sample! │ └── Foo.java! └── test! └── java! └── sample! └── FooTest.java!
  • 15. <project xmlns="http://maven.apache.org/POM/4.0.0"! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"! xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">! <modelVersion>4.0.0</modelVersion>! <groupId>com.acme</groupId>! <artifactId>sample</artifactId>! <packaging>jar</packaging>! <version>0.0.0-SNAPSHOT</version>! ! <dependencies>! <dependency>! <groupId>junit</groupId>! <artifactId>junit</artifactId>! <version>4.11</version>! <scope>test</scope>! </dependency>! </dependencies>! </project>! 
  • 16. apply plugin: 'java'! apply plugin: 'maven-publish'! ! version = '0.0.0-SNAPSHOT'! group = 'com.acme'! ! repositories {! jcenter()! }! ! dependencies {! testCompile 'junit:junit:4.11'! }! 
  • 18. ü Executable/Launchable application ü Executable fat jar ü Installable application
  • 20. <project ...>! <build>! <plugins>! <plugin>! <groupId>org.codehaus.mojo</groupId>! <artifactId>exec-maven-plugin</artifactId>! <version>1.2.1</version>! <configuration>! <mainClass>sample.Foo</mainClass>! </configuration>! </plugin>! </plugins>! </build>! </project>! $ mvn compile exec:java 
  • 21. apply plugin: 'java'! apply plugin: 'application'! ! mainClassName = 'sample.Foo'! $ gradle run 
  • 23. <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.3</version> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>sample.Foo</Main-Class> </manifestEntries> </transformer> </transformers> </configuration> </plugin> <plugins> $ mvn package –DskipTests=true 
  • 24. plugins {! id 'com.github.johnrengelman.shadow' version '1.1.2'! }! ! apply plugin: 'java'! apply plugin: 'application'! ! mainClassName = 'sample.Foo'! ! repositories { jcenter() }! ! dependencies { compile 'commons-lang:commons-lang:2.6' }! $ gradle shadowJar 
  • 25. Installable application .! ├── bin! │ ├── sample! │ └── sample.bat! └── lib! ├── commons-lang-2.6.jar! └── sample-0.0.0-SNAPSHOT.jar!
  • 26. 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! 
  • 27. apply plugin: 'java'! apply plugin: 'application’! mainClassName = 'sample.Foo'! ! repositories {! jcenter()! }! ! dependencies {! compile 'commons-lang:commons-lang:2.6'! }! $ gradle distZip 
  • 29. $ gvm install lazybones $ lazybones create gradle-quickstart sample
  • 30.
  • 31. license versions stats bintray shadow izpack java2html git coveralls asciidoctor jbake markdown livereload gretty Nexus watch wuff spawn
  • 32. THANK YOU! HTTP://PEOPLE.CANOO.COM/SHARE Andres Almiray Ix-chel Ruiz @aalmiray @ixchelruiz