SlideShare a Scribd company logo
1 of 158
Migrating 25K lines of Ant
scripting to
Gradle
Hanno Embregts
May 26, 2016 - Sofia, Bulgaria
@hannotify
Who is this guy?
Who is this guy?
Who is this guy?
We will consult these 3 experts
Linus Torvalds
creator of Linux & Git
We will consult these 3 experts
Linus Torvalds Mark Reinhold
creator of Linux & Git Java's chief architect
We will consult these 3 experts
Linus Torvalds Mark Reinhold Louis van Gaal
creator of Linux & Git Java's chief architect manager of
Manchester United
We will consult these 3 experts
Linus Torvalds Mark Reinhold Louis van Gaal
creator of Linux & Git Java's chief architect former manager of
Manchester United
A history of build
automation
A history of build automation
A history of build automation
it all started with a command-line call to the compiler
A history of build automation
it all started with a command-line call to the compiler
but multi-module projects posed a problem due to order
requirements
A history of build automation
it all started with a command-line call to the compiler
but multi-module projects posed a problem due to order
requirements
Make (1977) - define builds with Makefiles
A history of build automation
it all started with a command-line call to the compiler
but multi-module projects posed a problem due to order
requirements
Make (1977) - define builds with Makefiles
Ant (2000), Maven (2004) - define builds with XML
XML
XML
Let's start by being nice:
XML
Let's start by being nice:
excels at expressing hierarchical data
XML
Let's start by being nice:
excels at expressing hierarchical data
but...
XML
Let's start by being nice:
excels at expressing hierarchical data
but...
build scripting logic doesn't easily fit a hierarchy
XML
Let's start by being nice:
excels at expressing hierarchical data
but...
build scripting logic doesn't easily fit a hierarchy
often it consists of conditional and repeating logic
XML
Let's start by being nice:
excels at expressing hierarchical data
but...
build scripting logic doesn't easily fit a hierarchy
often it consists of conditional and repeating logic
which can be expressed more concisely in a programming
language
What does Linus think of XML?
What does Linus think of XML?
( )
XML is crap. Really. There are no excuses.
XML is nasty to parse for humans, and it's a
disaster to parse even for computers. There's
just no reason for that horrible crap to exist.
https://plus.google.com/+LinusTorvalds/posts/X2XVf9Q7MfV
Changes in requirements
Past
Changes in requirements
Past
compiling
Changes in requirements
Past
compiling
packaging
Changes in requirements
Present
Changes in requirements
Present
one project, multiple programming languages
Changes in requirements
Present
one project, multiple programming languages
compiling
Changes in requirements
Present
one project, multiple programming languages
compiling
running automated tests
Changes in requirements
Present
one project, multiple programming languages
compiling
running automated tests
packaging
Changes in requirements
Present
one project, multiple programming languages
compiling
running automated tests
packaging
integrating code as early as possible
Changes in requirements
Present
one project, multiple programming languages
compiling
running automated tests
packaging
integrating code as early as possible
deploying software to TAP
Build tools:
head to head
Ant vs. Maven according to Mark
Ant vs. Maven according to Mark
( )
What's the difference between Ant and
Maven?
https://www.parleys.com/tutorial/devoxx-fireside-chat
Ant vs. Maven according to Mark
( )
What's the difference between Ant and
Maven? The creator of Ant has apologized.
https://www.parleys.com/tutorial/devoxx-fireside-chat
Build tools head-to-head
Ant Maven Gradle
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
pre-defined structure absent present present
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
pre-defined structure absent present present
custom structure n/a complex simple
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
pre-defined structure absent present present
custom structure n/a complex simple
verbosity high average low
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
pre-defined structure absent present present
custom structure n/a complex simple
verbosity high average low
learning curve shallow steep average
Build tools head-to-head
Ant Maven Gradle
build script format XML XML Groovy / DSL
dependencies with Ivy built-in built-in
multi-module builds complex simple simple
pre-defined structure absent present present
custom structure n/a complex simple
verbosity high average low
learning curve shallow steep average
build order depends-on lifecycles directed acyclic graph
Market share of build tools @
Devoxx Belgium
What is Gradle?
What is Gradle?
What is Gradle?
build system for the JVM
What is Gradle?
build system for the JVM
in development since 2009
What is Gradle?
build system for the JVM
in development since 2009
has become popular quickly due to being the default
Android build system
What is Gradle? (2)
What is Gradle? (2)
define builds in Groovy-based DSL
What is Gradle? (2)
define builds in Groovy-based DSL
build by convention
What is Gradle? (2)
define builds in Groovy-based DSL
build by convention
customization is easy
What is Gradle? (2)
define builds in Groovy-based DSL
build by convention
customization is easy
plugins offer additional features
What is Gradle? (2)
define builds in Groovy-based DSL
build by convention
customization is easy
plugins offer additional features
to support different (JVM) languages
to support various integration tooling
What is Gradle? (3)
What is Gradle? (3)
incremental builds
What is Gradle? (3)
incremental builds
widely supported
What is Gradle? (3)
incremental builds
widely supported
fast and efficient
What is Gradle? (3)
incremental builds
widely supported
fast and efficient
advanced dependency management
What is Gradle? (3)
incremental builds
widely supported
fast and efficient
advanced dependency management
directed acyclic graph
What is Gradle? (3)
incremental builds
widely supported
fast and efficient
advanced dependency management
directed acyclic graph
"Ant's flexiblity, Maven's structure"
Define your build in Groovy / the
Gradle DSL
Define your build in Groovy / the
Gradle DSL
no XML (tell Linus)
Define your build in Groovy / the
Gradle DSL
no XML (tell Linus)
Gradle DSL offers a build-oriented model
Sample Gradle build file
apply plugin: 'java'
group = 'org.gradle.example'
version = '1.0.0'
sourceCompatibility = targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
runtime 'org.slf4j:slf4j-simple:1.7.21'
testCompile 'junit:junit:4.12'
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
Build by convention
src
main
test
java
resources
java
resources
build
classes
reports
main
test
tests
test-results
inputs outputs
Overriding conventions is easy
Overriding conventions is easy
define repositories
Overriding conventions is easy
define repositories
customize task behaviour
Overriding conventions is easy
define repositories
customize task behaviour
customize build order
Overriding conventions is easy
define repositories
customize task behaviour
customize build order
define build logic for subprojects specifically
Overriding conventions is easy
define repositories
customize task behaviour
customize build order
define build logic for subprojects specifically
define brand new tasks or re-use existing ones
Extending build logic with
plugins
Extending build logic with
plugins
loads of stuff at .plugins.gradle.org
Extending build logic with
plugins
loads of stuff at .
or build your own plugin to address specific requirements
plugins.gradle.org
Extending build logic with
plugins
loads of stuff at .
or build your own plugin to address specific requirements
in Java, Scala or Groovy
plugins.gradle.org
Widely supported
Fast & efficient
Fast & efficient
caching of build plan and dependencies
Fast & efficient
caching of build plan and dependencies
incremental building
Fast & efficient
caching of build plan and dependencies
incremental building
running tasks in parallel
Directed acyclic graph
Getting Started
Getting Started
Getting Started
define build task
Getting Started
define build task
extend existing build task
Getting Started
define build task
extend existing build task
define advanced task with Groovy
Getting Started
define build task
extend existing build task
define advanced task with Groovy
import tasks through plugins
Getting Started
define build task
extend existing build task
define advanced task with Groovy
import tasks through plugins
e.g. the Java-plugin
Getting Started
define build task
extend existing build task
define advanced task with Groovy
import tasks through plugins
e.g. the Java-plugin
define slot in build order
How does Gradle handle...?
How does Gradle handle...?
a Java project with its dependencies
How does Gradle handle...?
a Java project with its dependencies
running unit tests
How does Gradle handle...?
a Java project with its dependencies
running unit tests
computing code coverage
How does Gradle handle...?
a Java project with its dependencies
running unit tests
computing code coverage
running an existing Ant-target (see next example)
A Java project with Ant, Maven
en Gradle
A Java project with Ant, Maven
en Gradle
build tool overkill
Importing existing Ant targets
ant.importBuild 'build.xml'
DIY Profiling
DIY Profiling
Gradle at NS
(Dutch Railways)
Gradle at NS (Dutch Railways)
Gradle at NS (Dutch Railways)
not at all a 'greenfield project'!
Gradle at NS (Dutch Railways)
not at all a 'greenfield project'!
1 million lines of code
Gradle at NS (Dutch Railways)
not at all a 'greenfield project'!
1 million lines of code
over 25,000 lines of Ant scripting
Gradle at NS (Dutch Railways)
not at all a 'greenfield project'!
1 million lines of code
over 25,000 lines of Ant scripting
30 software developers
Gradle at NS (Dutch Railways)
not at all a 'greenfield project'!
1 million lines of code
over 25,000 lines of Ant scripting
30 software developers
system behaves like a monolith
Migration strategy
Migration strategy
divide the project into components according to
functionality
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
focus on code that is used regularly (i.e. on a daily basis)
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
focus on code that is used regularly (i.e. on a daily basis)
verify after each step that:
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
focus on code that is used regularly (i.e. on a daily basis)
verify after each step that:
results are exactly the same as before
no problems occur in existing Ant code
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
focus on code that is used regularly (i.e. on a daily basis)
verify after each step that:
results are exactly the same as before
no problems occur in existing Ant code
don't fool yourself: not every single line of Ant code should
be replaced
Migration strategy
divide the project into components according to
functionality
start Gradling at a small, isolated part
focus on code that is used regularly (i.e. on a daily basis)
verify after each step that:
results are exactly the same as before
no problems occur in existing Ant code
don't fool yourself: not every single line of Ant code should
be replaced
Ant projects are 'first class citizens'
Challenges
Challenges
dependency spaghetti
Challenges
dependency spaghetti
collaboration with existing Ant code
Challenges
dependency spaghetti
collaboration with existing Ant code
continuous integration & delivery
Migration result
Migration result
a component's responsibility has become clearer
Migration result
a component's responsibility has become clearer
a build will only run if the particular component has
changed
Migration result
a component's responsibility has become clearer
a build will only run if the particular component has
changed
run unit test in parallel (Gradle decides when)
Migration result
a component's responsibility has become clearer
a build will only run if the particular component has
changed
run unit test in parallel (Gradle decides when)
dependencies behave transitively
Migration result (lines of code)
Migration result (lines of code)
Language Lines of code (before) Lines of code (after)
Ant over 25,000 about 15,000
Gradle 0 1,232
What does Louis think of migrating all Ant
code?
What does Louis think of migrating all Ant
code?
( )
In the Netherlands they say: "That is another
cook."
https://youtu.be/x-QRqOndbzw
Wrap-up
Wrap-up
Ant & Maven:
Wrap-up
Ant & Maven:
require hard-to-maintain code
Wrap-up
Ant & Maven:
require hard-to-maintain code
the purpose of a code fragment is not clearly evident
Wrap-up
Ant & Maven:
require hard-to-maintain code
the purpose of a code fragment is not clearly evident
often fail to address changing requirements
Wrap-up
Ant & Maven:
require hard-to-maintain code
the purpose of a code fragment is not clearly evident
often fail to address changing requirements
rely heavily on XML
Wrap-up
Ant & Maven:
require hard-to-maintain code
the purpose of a code fragment is not clearly evident
often fail to address changing requirements
rely heavily on XML
Gradle is a better alternative
Wrap-up (2)
Gradle offers structure and flexibility
Wrap-up (2)
Gradle offers structure and flexibility
tries to combine the power of Ant and Maven
Wrap-up (2)
Gradle offers structure and flexibility
tries to combine the power of Ant and Maven
integrates with (almost) anything
Wrap-up (3)
So no drawbacks whatsoever?
Wrap-up (3)
So no drawbacks whatsoever?
Gradle spends a lot of time on configuration parsing (but
this has steadily improved in the past year)
Wrap-up (3)
So no drawbacks whatsoever?
Gradle spends a lot of time on configuration parsing (but
this has steadily improved in the past year)
developers need to get used to it
Wrap-up (3)
So no drawbacks whatsoever?
Gradle spends a lot of time on configuration parsing (but
this has steadily improved in the past year)
developers need to get used to it
migrating existing scripting is a lot of work
Should my project use Gradle?
A brand-new project?
Should my project use Gradle?
A brand-new project?
just do it
Should my project use Gradle?
A brand-new project?
just do it
do it RIGHT NOW
Should my project use Gradle?
An existing project?
Should my project use Gradle?
An existing project?
Will you benefit from Gradles key features? (better
performance, maintainability, less verbose, ...)
Should my project use Gradle?
An existing project?
Will you benefit from Gradles key features? (better
performance, maintainability, less verbose, ...)
Any technical debt to solve?
Should my project use Gradle?
An existing project?
Will you benefit from Gradles key features? (better
performance, maintainability, less verbose, ...)
Any technical debt to solve?
use an artifact repository and remove duplicates
Should my project use Gradle?
An existing project?
Will you benefit from Gradles key features? (better
performance, maintainability, less verbose, ...)
Any technical debt to solve?
use an artifact repository and remove duplicates
divide your project into multiple components
Should my project use Gradle?
An existing project?
Will you benefit from Gradles key features? (better
performance, maintainability, less verbose, ...)
Any technical debt to solve?
use an artifact repository and remove duplicates
divide your project into multiple components
define a clear structure in your build logic
Any questions?
Further reading
"Why Build Your Java Projects with Gradle Rather than Ant
or Maven?"
by Benjamin Muschko
( )
Gradle User Guide
( )
Gradle Build Language Reference
( )
'Gradle Getting Started' project @ GitHub
( )
'Build Tool Overkill' project @ GitHub
( )
http://www.drdobbs.com/jvm/why-build-your-java-projects-with-gradle/240168608
http://gradle.org/docs/current/userguide/userguide.html
http://gradle.org/docs/current/dsl/index.html
https://github.com/hannoembregts/gradle-getting-started
http://github.com/hannoembregts/build-tool-overkill
Thank You :)
You can contact me at:
@hannotify
hanno.embregts@infosupport.com

More Related Content

More from 🎤 Hanno Embregts 🎸

Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?🎤 Hanno Embregts 🎸
 
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022🎤 Hanno Embregts 🎸
 
Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?🎤 Hanno Embregts 🎸
 
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG🎤 Hanno Embregts 🎸
 
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)🎤 Hanno Embregts 🎸
 
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...🎤 Hanno Embregts 🎸
 
Entering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with TesseractEntering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with Tesseract🎤 Hanno Embregts 🎸
 
The Soft Side of Software Development / Devoxx 2019
The Soft Side of Software Development / Devoxx 2019The Soft Side of Software Development / Devoxx 2019
The Soft Side of Software Development / Devoxx 2019🎤 Hanno Embregts 🎸
 
Beware of Survivorship Bias! (conference talk at J-Fall 2019)
Beware of Survivorship Bias! (conference talk at J-Fall 2019)Beware of Survivorship Bias! (conference talk at J-Fall 2019)
Beware of Survivorship Bias! (conference talk at J-Fall 2019)🎤 Hanno Embregts 🎸
 
Will Git Be Around Forever? A List of Possible Successors
Will Git Be Around Forever? A List of Possible SuccessorsWill Git Be Around Forever? A List of Possible Successors
Will Git Be Around Forever? A List of Possible Successors🎤 Hanno Embregts 🎸
 
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...🎤 Hanno Embregts 🎸
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018🎤 Hanno Embregts 🎸
 
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...🎤 Hanno Embregts 🎸
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)🎤 Hanno Embregts 🎸
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!🎤 Hanno Embregts 🎸
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths
QWERTY or DVORAK? Debunking the Keyboard Layout MythsQWERTY or DVORAK? Debunking the Keyboard Layout Myths
QWERTY or DVORAK? Debunking the Keyboard Layout Myths🎤 Hanno Embregts 🎸
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)🎤 Hanno Embregts 🎸
 

More from 🎤 Hanno Embregts 🎸 (20)

Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?
 
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
 
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
 
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
 
Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?
 
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
 
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
 
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
 
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
 
Entering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with TesseractEntering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with Tesseract
 
The Soft Side of Software Development / Devoxx 2019
The Soft Side of Software Development / Devoxx 2019The Soft Side of Software Development / Devoxx 2019
The Soft Side of Software Development / Devoxx 2019
 
Beware of Survivorship Bias! (conference talk at J-Fall 2019)
Beware of Survivorship Bias! (conference talk at J-Fall 2019)Beware of Survivorship Bias! (conference talk at J-Fall 2019)
Beware of Survivorship Bias! (conference talk at J-Fall 2019)
 
Will Git Be Around Forever? A List of Possible Successors
Will Git Be Around Forever? A List of Possible SuccessorsWill Git Be Around Forever? A List of Possible Successors
Will Git Be Around Forever? A List of Possible Successors
 
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
 
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths
QWERTY or DVORAK? Debunking the Keyboard Layout MythsQWERTY or DVORAK? Debunking the Keyboard Layout Myths
QWERTY or DVORAK? Debunking the Keyboard Layout Myths
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%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 masabamasaba
 
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 pastPapp Krisztián
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%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 Hararemasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
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 🔝✔️✔️Delhi Call girls
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 

Recently uploaded (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%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
 
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
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%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
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
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 🔝✔️✔️
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+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...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Migrating 25K lines of Ant scripting to Gradle

  • 1. Migrating 25K lines of Ant scripting to Gradle Hanno Embregts May 26, 2016 - Sofia, Bulgaria @hannotify
  • 2. Who is this guy?
  • 3. Who is this guy?
  • 4. Who is this guy?
  • 5. We will consult these 3 experts Linus Torvalds creator of Linux & Git
  • 6. We will consult these 3 experts Linus Torvalds Mark Reinhold creator of Linux & Git Java's chief architect
  • 7. We will consult these 3 experts Linus Torvalds Mark Reinhold Louis van Gaal creator of Linux & Git Java's chief architect manager of Manchester United
  • 8. We will consult these 3 experts Linus Torvalds Mark Reinhold Louis van Gaal creator of Linux & Git Java's chief architect former manager of Manchester United
  • 9. A history of build automation
  • 10. A history of build automation
  • 11. A history of build automation it all started with a command-line call to the compiler
  • 12. A history of build automation it all started with a command-line call to the compiler but multi-module projects posed a problem due to order requirements
  • 13. A history of build automation it all started with a command-line call to the compiler but multi-module projects posed a problem due to order requirements Make (1977) - define builds with Makefiles
  • 14. A history of build automation it all started with a command-line call to the compiler but multi-module projects posed a problem due to order requirements Make (1977) - define builds with Makefiles Ant (2000), Maven (2004) - define builds with XML
  • 15. XML
  • 16. XML Let's start by being nice:
  • 17. XML Let's start by being nice: excels at expressing hierarchical data
  • 18. XML Let's start by being nice: excels at expressing hierarchical data but...
  • 19. XML Let's start by being nice: excels at expressing hierarchical data but... build scripting logic doesn't easily fit a hierarchy
  • 20. XML Let's start by being nice: excels at expressing hierarchical data but... build scripting logic doesn't easily fit a hierarchy often it consists of conditional and repeating logic
  • 21. XML Let's start by being nice: excels at expressing hierarchical data but... build scripting logic doesn't easily fit a hierarchy often it consists of conditional and repeating logic which can be expressed more concisely in a programming language
  • 22. What does Linus think of XML?
  • 23. What does Linus think of XML? ( ) XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist. https://plus.google.com/+LinusTorvalds/posts/X2XVf9Q7MfV
  • 28. Changes in requirements Present one project, multiple programming languages
  • 29. Changes in requirements Present one project, multiple programming languages compiling
  • 30. Changes in requirements Present one project, multiple programming languages compiling running automated tests
  • 31. Changes in requirements Present one project, multiple programming languages compiling running automated tests packaging
  • 32. Changes in requirements Present one project, multiple programming languages compiling running automated tests packaging integrating code as early as possible
  • 33. Changes in requirements Present one project, multiple programming languages compiling running automated tests packaging integrating code as early as possible deploying software to TAP
  • 35. Ant vs. Maven according to Mark
  • 36. Ant vs. Maven according to Mark ( ) What's the difference between Ant and Maven? https://www.parleys.com/tutorial/devoxx-fireside-chat
  • 37. Ant vs. Maven according to Mark ( ) What's the difference between Ant and Maven? The creator of Ant has apologized. https://www.parleys.com/tutorial/devoxx-fireside-chat
  • 39. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL
  • 40. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in
  • 41. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple
  • 42. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple pre-defined structure absent present present
  • 43. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple pre-defined structure absent present present custom structure n/a complex simple
  • 44. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple pre-defined structure absent present present custom structure n/a complex simple verbosity high average low
  • 45. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple pre-defined structure absent present present custom structure n/a complex simple verbosity high average low learning curve shallow steep average
  • 46. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in multi-module builds complex simple simple pre-defined structure absent present present custom structure n/a complex simple verbosity high average low learning curve shallow steep average build order depends-on lifecycles directed acyclic graph
  • 47. Market share of build tools @ Devoxx Belgium
  • 50. What is Gradle? build system for the JVM
  • 51. What is Gradle? build system for the JVM in development since 2009
  • 52. What is Gradle? build system for the JVM in development since 2009 has become popular quickly due to being the default Android build system
  • 54. What is Gradle? (2) define builds in Groovy-based DSL
  • 55. What is Gradle? (2) define builds in Groovy-based DSL build by convention
  • 56. What is Gradle? (2) define builds in Groovy-based DSL build by convention customization is easy
  • 57. What is Gradle? (2) define builds in Groovy-based DSL build by convention customization is easy plugins offer additional features
  • 58. What is Gradle? (2) define builds in Groovy-based DSL build by convention customization is easy plugins offer additional features to support different (JVM) languages to support various integration tooling
  • 60. What is Gradle? (3) incremental builds
  • 61. What is Gradle? (3) incremental builds widely supported
  • 62. What is Gradle? (3) incremental builds widely supported fast and efficient
  • 63. What is Gradle? (3) incremental builds widely supported fast and efficient advanced dependency management
  • 64. What is Gradle? (3) incremental builds widely supported fast and efficient advanced dependency management directed acyclic graph
  • 65. What is Gradle? (3) incremental builds widely supported fast and efficient advanced dependency management directed acyclic graph "Ant's flexiblity, Maven's structure"
  • 66. Define your build in Groovy / the Gradle DSL
  • 67. Define your build in Groovy / the Gradle DSL no XML (tell Linus)
  • 68. Define your build in Groovy / the Gradle DSL no XML (tell Linus) Gradle DSL offers a build-oriented model
  • 69. Sample Gradle build file apply plugin: 'java' group = 'org.gradle.example' version = '1.0.0' sourceCompatibility = targetCompatibility = 1.8 repositories { mavenCentral() } dependencies { compile 'org.slf4j:slf4j-api:1.7.21' runtime 'org.slf4j:slf4j-simple:1.7.21' testCompile 'junit:junit:4.12' } task sourceJar(type: Jar) { classifier = 'sources' from sourceSets.main.allSource }
  • 72. Overriding conventions is easy define repositories
  • 73. Overriding conventions is easy define repositories customize task behaviour
  • 74. Overriding conventions is easy define repositories customize task behaviour customize build order
  • 75. Overriding conventions is easy define repositories customize task behaviour customize build order define build logic for subprojects specifically
  • 76. Overriding conventions is easy define repositories customize task behaviour customize build order define build logic for subprojects specifically define brand new tasks or re-use existing ones
  • 77. Extending build logic with plugins
  • 78. Extending build logic with plugins loads of stuff at .plugins.gradle.org
  • 79. Extending build logic with plugins loads of stuff at . or build your own plugin to address specific requirements plugins.gradle.org
  • 80. Extending build logic with plugins loads of stuff at . or build your own plugin to address specific requirements in Java, Scala or Groovy plugins.gradle.org
  • 83. Fast & efficient caching of build plan and dependencies
  • 84. Fast & efficient caching of build plan and dependencies incremental building
  • 85. Fast & efficient caching of build plan and dependencies incremental building running tasks in parallel
  • 90. Getting Started define build task extend existing build task
  • 91. Getting Started define build task extend existing build task define advanced task with Groovy
  • 92. Getting Started define build task extend existing build task define advanced task with Groovy import tasks through plugins
  • 93. Getting Started define build task extend existing build task define advanced task with Groovy import tasks through plugins e.g. the Java-plugin
  • 94. Getting Started define build task extend existing build task define advanced task with Groovy import tasks through plugins e.g. the Java-plugin define slot in build order
  • 95. How does Gradle handle...?
  • 96. How does Gradle handle...? a Java project with its dependencies
  • 97. How does Gradle handle...? a Java project with its dependencies running unit tests
  • 98. How does Gradle handle...? a Java project with its dependencies running unit tests computing code coverage
  • 99. How does Gradle handle...? a Java project with its dependencies running unit tests computing code coverage running an existing Ant-target (see next example)
  • 100. A Java project with Ant, Maven en Gradle
  • 101. A Java project with Ant, Maven en Gradle build tool overkill
  • 102. Importing existing Ant targets ant.importBuild 'build.xml'
  • 105. Gradle at NS (Dutch Railways)
  • 106. Gradle at NS (Dutch Railways)
  • 107. Gradle at NS (Dutch Railways) not at all a 'greenfield project'!
  • 108. Gradle at NS (Dutch Railways) not at all a 'greenfield project'! 1 million lines of code
  • 109. Gradle at NS (Dutch Railways) not at all a 'greenfield project'! 1 million lines of code over 25,000 lines of Ant scripting
  • 110. Gradle at NS (Dutch Railways) not at all a 'greenfield project'! 1 million lines of code over 25,000 lines of Ant scripting 30 software developers
  • 111. Gradle at NS (Dutch Railways) not at all a 'greenfield project'! 1 million lines of code over 25,000 lines of Ant scripting 30 software developers system behaves like a monolith
  • 113. Migration strategy divide the project into components according to functionality
  • 114. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part
  • 115. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part focus on code that is used regularly (i.e. on a daily basis)
  • 116. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part focus on code that is used regularly (i.e. on a daily basis) verify after each step that:
  • 117. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part focus on code that is used regularly (i.e. on a daily basis) verify after each step that: results are exactly the same as before no problems occur in existing Ant code
  • 118. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part focus on code that is used regularly (i.e. on a daily basis) verify after each step that: results are exactly the same as before no problems occur in existing Ant code don't fool yourself: not every single line of Ant code should be replaced
  • 119. Migration strategy divide the project into components according to functionality start Gradling at a small, isolated part focus on code that is used regularly (i.e. on a daily basis) verify after each step that: results are exactly the same as before no problems occur in existing Ant code don't fool yourself: not every single line of Ant code should be replaced Ant projects are 'first class citizens'
  • 123. Challenges dependency spaghetti collaboration with existing Ant code continuous integration & delivery
  • 125. Migration result a component's responsibility has become clearer
  • 126. Migration result a component's responsibility has become clearer a build will only run if the particular component has changed
  • 127. Migration result a component's responsibility has become clearer a build will only run if the particular component has changed run unit test in parallel (Gradle decides when)
  • 128. Migration result a component's responsibility has become clearer a build will only run if the particular component has changed run unit test in parallel (Gradle decides when) dependencies behave transitively
  • 130. Migration result (lines of code) Language Lines of code (before) Lines of code (after) Ant over 25,000 about 15,000 Gradle 0 1,232
  • 131. What does Louis think of migrating all Ant code?
  • 132. What does Louis think of migrating all Ant code? ( ) In the Netherlands they say: "That is another cook." https://youtu.be/x-QRqOndbzw
  • 135. Wrap-up Ant & Maven: require hard-to-maintain code
  • 136. Wrap-up Ant & Maven: require hard-to-maintain code the purpose of a code fragment is not clearly evident
  • 137. Wrap-up Ant & Maven: require hard-to-maintain code the purpose of a code fragment is not clearly evident often fail to address changing requirements
  • 138. Wrap-up Ant & Maven: require hard-to-maintain code the purpose of a code fragment is not clearly evident often fail to address changing requirements rely heavily on XML
  • 139. Wrap-up Ant & Maven: require hard-to-maintain code the purpose of a code fragment is not clearly evident often fail to address changing requirements rely heavily on XML Gradle is a better alternative
  • 140. Wrap-up (2) Gradle offers structure and flexibility
  • 141. Wrap-up (2) Gradle offers structure and flexibility tries to combine the power of Ant and Maven
  • 142. Wrap-up (2) Gradle offers structure and flexibility tries to combine the power of Ant and Maven integrates with (almost) anything
  • 143. Wrap-up (3) So no drawbacks whatsoever?
  • 144. Wrap-up (3) So no drawbacks whatsoever? Gradle spends a lot of time on configuration parsing (but this has steadily improved in the past year)
  • 145. Wrap-up (3) So no drawbacks whatsoever? Gradle spends a lot of time on configuration parsing (but this has steadily improved in the past year) developers need to get used to it
  • 146. Wrap-up (3) So no drawbacks whatsoever? Gradle spends a lot of time on configuration parsing (but this has steadily improved in the past year) developers need to get used to it migrating existing scripting is a lot of work
  • 147. Should my project use Gradle? A brand-new project?
  • 148. Should my project use Gradle? A brand-new project? just do it
  • 149. Should my project use Gradle? A brand-new project? just do it do it RIGHT NOW
  • 150. Should my project use Gradle? An existing project?
  • 151. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...)
  • 152. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...) Any technical debt to solve?
  • 153. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...) Any technical debt to solve? use an artifact repository and remove duplicates
  • 154. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...) Any technical debt to solve? use an artifact repository and remove duplicates divide your project into multiple components
  • 155. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...) Any technical debt to solve? use an artifact repository and remove duplicates divide your project into multiple components define a clear structure in your build logic
  • 157. Further reading "Why Build Your Java Projects with Gradle Rather than Ant or Maven?" by Benjamin Muschko ( ) Gradle User Guide ( ) Gradle Build Language Reference ( ) 'Gradle Getting Started' project @ GitHub ( ) 'Build Tool Overkill' project @ GitHub ( ) http://www.drdobbs.com/jvm/why-build-your-java-projects-with-gradle/240168608 http://gradle.org/docs/current/userguide/userguide.html http://gradle.org/docs/current/dsl/index.html https://github.com/hannoembregts/gradle-getting-started http://github.com/hannoembregts/build-tool-overkill
  • 158. Thank You :) You can contact me at: @hannotify hanno.embregts@infosupport.com