Migrating 25K lines of Ant scripting to Gradle

••
Migrating 25K lines of Ant scripting to Gradle
Who is this guy?
Migrating 25K lines of Ant scripting to Gradle
Migrating 25K lines of Ant scripting to Gradle
Migrating 25K lines of Ant scripting to Gradle
Migrating 25K lines of Ant scripting to Gradle
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
Changes in
requirements
Changes in requirements
Past
compiling
packaging
Changes in requirements
Present
one project, multiple programming languages
compiling
running automated tests
packaging
integrating code as early as possible
deploying software to TAP
Defining builds in
XML
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...
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
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
Gradle at NS
(Dutch Railways)
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
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:
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
Ant projects are 'first class citizens'
Challenges
dependency spaghetti
collaboration with existing Ant code
continuous integration & delivery
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)
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
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
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
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)
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
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
( )
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
Thank you :)
You can contact me at:
@hannotify
hanno.embregts@infosupport.com
1 of 60

Recommended

Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017) by
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 🎸
738 views•22 slides
Building a Spring Boot Application - Ask the Audience! by
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 🎸
917 views•21 slides
Spring Boot by
Spring BootSpring Boot
Spring Bootkoppenolski
365 views•15 slides
Connecting Connect with Spring Boot by
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring BootVincent Kok
1.1K views•109 slides
Spring Boot by
Spring BootSpring Boot
Spring BootJaran Flaath
545 views•51 slides
Springboot and camel by
Springboot and camelSpringboot and camel
Springboot and camelDeepak Kumar
355 views•7 slides

More Related Content

What's hot

SpringBoot by
SpringBootSpringBoot
SpringBootJaran Flaath
401 views•49 slides
Spring boot introduction by
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
7.7K views•36 slides
Spring boot by
Spring bootSpring boot
Spring bootGyanendra Yadav
1.9K views•32 slides
Introduction to Spring Boot! by
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!Jakub Kubrynski
6.4K views•28 slides
Spring boot by
Spring bootSpring boot
Spring bootPradeep Shanmugam
649 views•12 slides
Using JHipster 4 for generating Angular/Spring Boot apps by
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsYakov Fain
3.6K views•35 slides

What's hot(20)

SpringBoot by Jaran Flaath
SpringBootSpringBoot
SpringBoot
Jaran Flaath•401 views
Spring boot introduction by Rasheed Waraich
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich•7.7K views
Introduction to Spring Boot! by Jakub Kubrynski
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
Jakub Kubrynski•6.4K views
Using JHipster 4 for generating Angular/Spring Boot apps by Yakov Fain
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
Yakov Fain•3.6K views
Java and services code lab spring boot and spring data using mongo db by Staples
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
Staples•228 views
Angular 2 for Java Developers by Yakov Fain
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
Yakov Fain•25.9K views
Apache ANT vs Apache Maven by Mudit Gupta
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
Mudit Gupta•1.3K views
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017 by Matt Raible
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Matt Raible•771 views
Intro JavaScript by koppenolski
Intro JavaScriptIntro JavaScript
Intro JavaScript
koppenolski•122 views
Midwest PHP 2017 DevOps For Small team by Joe Ferguson
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
Joe Ferguson•540 views
Using JHipster for generating Angular/Spring Boot apps by Yakov Fain
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
Yakov Fain•1.8K views
Using JHipster for generating Angular/Spring Boot apps by Yakov Fain
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
Yakov Fain•1.5K views
No Va Taig April 7 2010 by rudy regner
No Va Taig April 7 2010No Va Taig April 7 2010
No Va Taig April 7 2010
rudy regner•622 views
Integration Testing With Cucumber How To Test Anything J A O O 2009 by Dr Nic Williams
Integration Testing With  Cucumber    How To Test Anything    J A O O 2009Integration Testing With  Cucumber    How To Test Anything    J A O O 2009
Integration Testing With Cucumber How To Test Anything J A O O 2009
Dr Nic Williams•4K views

Similar to Migrating 25K lines of Ant scripting to Gradle

The Ember.js Framework - Everything You Need To Know by
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowAll Things Open
1.6K views•69 slides
Gradle(the innovation continues) by
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)Sejong Park
1.2K views•34 slides
Enterprise build tool gradle by
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradleDeepak Shevani
368 views•23 slides
Preparing for Scala 3 by
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3Martin Odersky
11.1K views•48 slides
Boilerplates: Step up your Web Development Process by
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessFibonalabs
55 views•20 slides
ReactJS or Angular by
ReactJS or AngularReactJS or Angular
ReactJS or Angularboyney123
5.7K views•16 slides

Similar to Migrating 25K lines of Ant scripting to Gradle(20)

The Ember.js Framework - Everything You Need To Know by All Things Open
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
All Things Open•1.6K views
Gradle(the innovation continues) by Sejong Park
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)
Sejong Park•1.2K views
Enterprise build tool gradle by Deepak Shevani
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradle
Deepak Shevani•368 views
Preparing for Scala 3 by Martin Odersky
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
Martin Odersky•11.1K views
Boilerplates: Step up your Web Development Process by Fibonalabs
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development Process
Fibonalabs•55 views
ReactJS or Angular by boyney123
ReactJS or AngularReactJS or Angular
ReactJS or Angular
boyney123•5.7K views
Introduction to webpack and babel by AmanRaj378
Introduction to webpack and babelIntroduction to webpack and babel
Introduction to webpack and babel
AmanRaj378•58 views
Grails at DMC Digital by tomaslin
Grails at DMC DigitalGrails at DMC Digital
Grails at DMC Digital
tomaslin•674 views
Creating and Maintaining an Open Source Library by Nicholas Schweitzer
Creating and Maintaining an Open Source LibraryCreating and Maintaining an Open Source Library
Creating and Maintaining an Open Source Library
Nicholas Schweitzer•70 views
The ultimate cheat sheet on .net core, .net framework, and .net standard by Concetto Labs
The ultimate cheat sheet on .net core, .net framework, and .net standardThe ultimate cheat sheet on .net core, .net framework, and .net standard
The ultimate cheat sheet on .net core, .net framework, and .net standard
Concetto Labs•100 views
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain... by Maarten Balliauw
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
Maarten Balliauw•1.2K views
Performance monitoring and call tracing in microservice environments by Martin Gutenbrunner
Performance monitoring and call tracing in microservice environmentsPerformance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environments
Martin Gutenbrunner•2.4K views
Angular 2 vs React. What to chose in 2017? by TechMagic
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
TechMagic•2.9K views
10 Tips for Configuring Your Builds with Bamboo Specs by Atlassian
10 Tips for Configuring Your Builds with Bamboo Specs10 Tips for Configuring Your Builds with Bamboo Specs
10 Tips for Configuring Your Builds with Bamboo Specs
Atlassian•20.2K views
What Web Framework To Use? by Kasra Khosravi
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?
Kasra Khosravi•1.1K views
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain... by Maarten Balliauw
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Maarten Balliauw•326 views
Evolving your api architecture with the strangler pattern by dwcarter74
Evolving your api architecture with the strangler patternEvolving your api architecture with the strangler pattern
Evolving your api architecture with the strangler pattern
dwcarter74•138 views
Continuous integration and delivery for java based web applications by Sunil Dalal
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
Sunil Dalal•1.3K views
Practical WebAssembly with Apex, wasmRS, and nanobus by Jarrod Overson
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobus
Jarrod Overson•55 views
The Development History of PVS-Studio for Linux by PVS-Studio
The Development History of PVS-Studio for LinuxThe Development History of PVS-Studio for Linux
The Development History of PVS-Studio for Linux
PVS-Studio•117 views

More from 🎤 Hanno Embregts 🎸

Pattern Matching: Small Enhancement or Major Feature? by
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?🎤 Hanno Embregts 🎸
23 views•109 slides
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202 by
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 🎸
4 views•108 slides
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022 by
"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 🎸
7 views•35 slides
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022 by
"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 🎸
5 views•61 slides
Pattern Matching: Small Enhancement or Major Feature? by
Pattern Matching: Small Enhancement or Major Feature?Pattern Matching: Small Enhancement or Major Feature?
Pattern Matching: Small Enhancement or Major Feature?🎤 Hanno Embregts 🎸
75 views•103 slides
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors" by
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 🎸
62 views•62 slides

More from 🎤 Hanno Embregts 🎸(18)

Recently uploaded

Flask-Python by
Flask-PythonFlask-Python
Flask-PythonTriloki Gupta
10 views•12 slides
How to build dyanmic dashboards and ensure they always work by
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always workWiiisdom
16 views•13 slides
Quality Assurance by
Quality Assurance Quality Assurance
Quality Assurance interworksoftware2
8 views•6 slides
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...Stefan Wolpers
44 views•38 slides
Electronic AWB - Electronic Air Waybill by
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill Freightoscope
6 views•1 slide
Mobile App Development Company by
Mobile App Development CompanyMobile App Development Company
Mobile App Development CompanyRichestsoft
5 views•6 slides

Recently uploaded(20)

How to build dyanmic dashboards and ensure they always work by Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom•16 views
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers•44 views
Electronic AWB - Electronic Air Waybill by Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope •6 views
Mobile App Development Company by Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft •5 views
Playwright Retries by artembondar5
Playwright RetriesPlaywright Retries
Playwright Retries
artembondar5•7 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski•16 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan•8 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app•10 views
aATP - New Correlation Confirmation Feature.pptx by EsatEsenek1
aATP - New Correlation Confirmation Feature.pptxaATP - New Correlation Confirmation Feature.pptx
aATP - New Correlation Confirmation Feature.pptx
EsatEsenek1•222 views
Page Object Model by artembondar5
Page Object ModelPage Object Model
Page Object Model
artembondar5•7 views
Automated Testing of Microsoft Power BI Reports by RTTS
Automated Testing of Microsoft Power BI ReportsAutomated Testing of Microsoft Power BI Reports
Automated Testing of Microsoft Power BI Reports
RTTS•11 views
Introduction to Gradle by John Valentino
Introduction to GradleIntroduction to Gradle
Introduction to Gradle
John Valentino•7 views
Bootstrapping vs Venture Capital.pptx by Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic•16 views

Migrating 25K lines of Ant scripting to Gradle

  • 2. Who is this guy?
  • 7. We will consult these 3 experts Linus Torvalds creator of Linux & Git
  • 8. We will consult these 3 experts Linus Torvalds Mark Reinhold creator of Linux & Git Java's chief architect
  • 9. 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
  • 10. 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
  • 13. Changes in requirements Present one project, multiple programming languages compiling running automated tests packaging integrating code as early as possible deploying software to TAP
  • 15. XML Let's start by being nice: excels at expressing hierarchical data
  • 16. 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
  • 17. What does Linus think of XML?
  • 18. 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
  • 20. Ant vs. Maven according to Mark
  • 21. Ant vs. Maven according to Mark ( ) What's the difference between Ant and Maven? https://www.parleys.com/tutorial/devoxx-fireside-chat
  • 22. 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
  • 24. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL
  • 25. Build tools head-to-head Ant Maven Gradle build script format XML XML Groovy / DSL dependencies with Ivy built-in built-in
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. Gradle at NS (Dutch Railways)
  • 33. 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
  • 35. 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)
  • 36. 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
  • 37. 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'
  • 38. Challenges dependency spaghetti collaboration with existing Ant code continuous integration & delivery
  • 39. 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
  • 40. 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
  • 41. What does Louis think of migrating all Ant code?
  • 42. What does Louis think of migrating all Ant code? ( ) In the Netherlands they say: "That is another cook." https://youtu.be/x-QRqOndbzw
  • 45. Wrap-up Ant & Maven: require hard-to-maintain code the purpose of a code fragment is not clearly evident
  • 46. 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
  • 47. 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
  • 48. Wrap-up (2) Gradle offers structure and flexibility tries to combine the power of Ant and Maven integrates with (almost) anything
  • 49. Wrap-up (3) So no drawbacks whatsoever?
  • 50. 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
  • 51. Should my project use Gradle? A brand-new project?
  • 52. Should my project use Gradle? A brand-new project? just do it
  • 53. Should my project use Gradle? A brand-new project? just do it do it RIGHT NOW
  • 54. Should my project use Gradle? An existing project?
  • 55. Should my project use Gradle? An existing project? Will you benefit from Gradles key features? (better performance, maintainability, less verbose, ...)
  • 56. 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?
  • 57. 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
  • 59. Further reading "Why Build Your Java Projects with Gradle Rather than Ant or Maven?" by Benjamin Muschko ( ) Gradle User Guide ( ) Gradle Build Language Reference ( ) 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
  • 60. Thank you :) You can contact me at: @hannotify hanno.embregts@infosupport.com