SlideShare a Scribd company logo
Why Gradle?
Gradle makes the impossible possible, the possible
easy and the easy elegant
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
apply plugin: 'java'
group = 'com.mycompany.app'
archivesBaseName = 'my-app'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
}
Maven vs Gradle
Recognition by ThoughtWorks
“Two things have caused fatigue with XML-based build tools like Ant and Maven: too
many angry pointy braces and the coarseness of plug-in architectures. While syntax
issues can be dealt with through generation, plug-in architectures severely limit the
ability for build tools to grow gracefully as projects become more complex. We have
come to feel that plug-ins are the wrong level of abstraction, and prefer language-
based tools like Gradle and Rake instead, because they offer finer-grained abstrac-
tions and more flexibility long term.”
Gradle’s Compelling Feature Set
Convention over Configuration - Build Cycle
Ant was cool but it has maintainability issues, duplicated code.
Maven picks up and idea of convention over configuration. Repeated steps are
standardized. Maven’s core logic can be extended with plugins
Maven has life cyclye; Compile, unit and integration tests, assembling the
artifact, deploying the artifact to local repo, releasing the artifact to remote repo.
Dependency Management over maven central
Shortcomings - Maven “My way or Highway”
● Maven proposes a default structre and lifecycle for a project that often is
too restrictive
● Writing custom extensions for maven is hard. You must learn MOJO
● Plugin versions may be trouble for your environment.
Which one would you prefer?
Flexibility and extensibility but get weak project standardization, tons of
boilerplate code no support for dependency management by picking Ant;
Or You go with maven, which offers a convention over configuration approach
and a seamlessly integrated dependency manager, but an overly restrictive
mindset and cumbersome plugin system.
Or A build tool that offers you both like Gradle!
Here comes Gradle
Groovy instead of XML is
declerative, readable, and
it clearly express the
intention
What is possible with Gradle while it is impossible with others
Directed Acyclic Graph: In maven goals must depend on each other even if they have no dependencies, in gradle must not
Task Exclusion: In gradle you exclude any task from being run and all its dependend tasks
Task Ordering: Gradle supports shouldRunAfter, mustRunAfter operations
Task Dependency Inference: Gradle aware of what it produce. Any task that has java bin directory as input will automatically trigger compileJava.
True Multi Task Execution: You can specify multiple tasks when executing the build and no task in the resulting DAG is executed twice
Dry Run: Show tasks in which order without executing them Ex: gradle -m clean compile
Build automatically when sources change,
Declarative DSL
Integration With Other Build Tools
Gradle builds are 100%compatible with Maven and Ivy Repos. You can retrieve and publish your own artifacts. Also
Gradle provides converter for existing maven builds
Deployment Pipline
● Compile the code
● Runing unit and integration tests
● Performing static code analysis and generating test coverage
● Creating the distribution
● Provisioning the target environment
● Deploying the deliverable
● Performing smoke and automated functional tests
Let’s Get it Started
task helloWorld{
doLast {
println ‘Hello World’
}
}
task helloWorld<<{
println ‘Hello World’
}
task helloWorld{
doFirst{
‘Hello’
}
doLast{
‘World’
}
}
$ gradle -q helloWorld
Hello World!
def chant(){
ant.echo(message: ‘Hell Ant yeah!’)
}
3.times {
task “yayGradle$it” <<{
println ‘Gradle rocks’
}
}
yayGradle0.dependsOn startSession
yayGradle2.dependsOn yayGradle1, yayGradle0
task groupTherapy(dependsOn: yayGradle2)
$ #exclude task
$ gradle groupTherapy -x yayGradle0
$ #show all tasks
$ gradle -q tasks --all
Gradle Daemon
When using gradle day to day basis, you’ll find yourself having to run your build
repetitvely. Each time you initiate a build, the JVM has to be started, Gradle
dependency’s has to be loaded into class loader, and the project model has to be
constructed. This procedure usually takes 2 seconds.
Gradle daemon to the rescue!
$ ~/.gradle/gradle.properties
org.gradle.daemon=true
Let’s do some examples!
Dependency Management
Either one is available throu Gradle, Maven or Ivy Repositories
apply plugin: ‘java’
repositories {
mavenCentral()
mavenLocal()
maven {
url “http://dev.foreks.com/nexus/content/repositories/release
}
ivy {
url “http://repo.foreks.com/ivy/repo”
url “../local-repo”
}
}
dependencies{
compile ‘org.hibernate:hibernate-core:3.6.7.Final’
}
Dependency Configurations
Default configurations are compile, runtime, testCompile, testRuntime
configurations{
perfCompile
}
dependencies{
perfCompile(‘org.openjdk.jmh:jmh-core:1.11.2’,
‘org.openjdk.jmh:jmh-generator-bytecode:1.11.2’,
project)
compile ‘org.codehaus.groovy:groovy-all:2.4.4’
testCompile(‘junit:junit:4.+’, ‘org.spockframework:spock-core:1.0-groovy-2.4’)
testRuntime(‘com.athaydes:spock-reports:1.2.7’)
}
apply plugin: ‘eclipse’
eclipse {
classpath {
plusConfigurations+=[configurations.testCompile, configurations.
perfCompile]
}
}
Publishing artifacts
apply plugin: ‘maven’
uploadArchives{
repositories{
mavenDeployer{
repository(url: ‘ http://dev.foreks.com/nexus/content/repositories/releases ’){
authentication(userName:nexusUsername, passowrd:nexusPassword)
}
snapshotRepository(url: ‘ http://dev.foreks.com/nexus/content/repositories/snapshots ’){
authentication(userName:nexusUsername, password:nexusPassword)
}
}
}
}
Thanks

More Related Content

What's hot

Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
Onkar Deshpande
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
Geert Pante
 
Maven
MavenMaven
Apache Maven
Apache MavenApache Maven
Apache Maven
Rahul Tanwani
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
MD Sayem Ahmed
 
Maven 2 Introduction
Maven 2 IntroductionMaven 2 Introduction
Maven 2 Introduction
Valentin Jacquemin
 
Maven
MavenMaven
Maven
feng lee
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
Dragos Balan
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
Rajind Ruparathna
 
Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
Matthias Käppler
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
Sid Anand
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
Chen Cheng-Wei
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
Manos Georgopoulos
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Introboyw165
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2
andyhot
 
maven build certificaton
maven build certificatonmaven build certificaton
maven build certificaton
Vskills
 
When Web meet Native App
When Web meet Native AppWhen Web meet Native App
When Web meet Native App
Yu-Wei Chuang
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 

What's hot (20)

Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Maven
MavenMaven
Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Maven 2 Introduction
Maven 2 IntroductionMaven 2 Introduction
Maven 2 Introduction
 
Maven
MavenMaven
Maven
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Maven
MavenMaven
Maven
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
 
Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2
 
maven build certificaton
maven build certificatonmaven build certificaton
maven build certificaton
 
When Web meet Native App
When Web meet Native AppWhen Web meet Native App
When Web meet Native App
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 

Viewers also liked

Android Gradle about using flavor
Android Gradle about using flavorAndroid Gradle about using flavor
Android Gradle about using flavor
Ted Liang
 
Big Data on the Cloud
Big Data on the CloudBig Data on the Cloud
Big Data on the Cloud
Sercan Karaoglu
 
Gradle
GradleGradle
Gradle
thoraage
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
Andres Almiray
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
Oriol Jiménez
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
 
Gradle
GradleGradle
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
Eric Wendelin
 
Gradle
GradleGradle
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
Kostas Saidis
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
Lemi Orhan Ergin
 

Viewers also liked (12)

Android Gradle about using flavor
Android Gradle about using flavorAndroid Gradle about using flavor
Android Gradle about using flavor
 
Big Data on the Cloud
Big Data on the CloudBig Data on the Cloud
Big Data on the Cloud
 
Gradle
GradleGradle
Gradle
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Gradle
GradleGradle
Gradle
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
Gradle
GradleGradle
Gradle
 
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
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
 

Similar to Why gradle

Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
Bhagwat Kumar
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
simonscholz
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
Skills Matter
 
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!
Corneil du Plessis
 
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)
Jared Burrows
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
Nibodha Technologies
 
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
Eric Wendelin
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
Max De Marzi
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
Tomek Kaczanowski
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
Schalk Cronjé
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
Corneil du Plessis
 
Gradle - time for another build
Gradle - time for another buildGradle - time for another build
Gradle - time for another build
Igor Khotin
 
Enter the gradle
Enter the gradleEnter the gradle
Enter the gradle
Parameswari Ettiappan
 
Gradle notes
Gradle notesGradle notes
Gradle notes
Dum My
 
Gradle
GradleGradle
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)Sejong Park
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
simonscholz
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
Ryan Cuprak
 

Similar to Why gradle (20)

Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: 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!
 
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)
 
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
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
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
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Gradle - time for another build
Gradle - time for another buildGradle - time for another build
Gradle - time for another build
 
Enter the gradle
Enter the gradleEnter the gradle
Enter the gradle
 
Gradle notes
Gradle notesGradle notes
Gradle notes
 
Gradle
GradleGradle
Gradle
 
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

Why gradle

  • 1. Why Gradle? Gradle makes the impossible possible, the possible easy and the easy elegant
  • 3. Recognition by ThoughtWorks “Two things have caused fatigue with XML-based build tools like Ant and Maven: too many angry pointy braces and the coarseness of plug-in architectures. While syntax issues can be dealt with through generation, plug-in architectures severely limit the ability for build tools to grow gracefully as projects become more complex. We have come to feel that plug-ins are the wrong level of abstraction, and prefer language- based tools like Gradle and Rake instead, because they offer finer-grained abstrac- tions and more flexibility long term.”
  • 5. Convention over Configuration - Build Cycle Ant was cool but it has maintainability issues, duplicated code. Maven picks up and idea of convention over configuration. Repeated steps are standardized. Maven’s core logic can be extended with plugins Maven has life cyclye; Compile, unit and integration tests, assembling the artifact, deploying the artifact to local repo, releasing the artifact to remote repo. Dependency Management over maven central
  • 6. Shortcomings - Maven “My way or Highway” ● Maven proposes a default structre and lifecycle for a project that often is too restrictive ● Writing custom extensions for maven is hard. You must learn MOJO ● Plugin versions may be trouble for your environment.
  • 7. Which one would you prefer? Flexibility and extensibility but get weak project standardization, tons of boilerplate code no support for dependency management by picking Ant; Or You go with maven, which offers a convention over configuration approach and a seamlessly integrated dependency manager, but an overly restrictive mindset and cumbersome plugin system. Or A build tool that offers you both like Gradle!
  • 8. Here comes Gradle Groovy instead of XML is declerative, readable, and it clearly express the intention
  • 9. What is possible with Gradle while it is impossible with others Directed Acyclic Graph: In maven goals must depend on each other even if they have no dependencies, in gradle must not Task Exclusion: In gradle you exclude any task from being run and all its dependend tasks Task Ordering: Gradle supports shouldRunAfter, mustRunAfter operations Task Dependency Inference: Gradle aware of what it produce. Any task that has java bin directory as input will automatically trigger compileJava. True Multi Task Execution: You can specify multiple tasks when executing the build and no task in the resulting DAG is executed twice Dry Run: Show tasks in which order without executing them Ex: gradle -m clean compile Build automatically when sources change, Declarative DSL
  • 10. Integration With Other Build Tools Gradle builds are 100%compatible with Maven and Ivy Repos. You can retrieve and publish your own artifacts. Also Gradle provides converter for existing maven builds
  • 11. Deployment Pipline ● Compile the code ● Runing unit and integration tests ● Performing static code analysis and generating test coverage ● Creating the distribution ● Provisioning the target environment ● Deploying the deliverable ● Performing smoke and automated functional tests
  • 12. Let’s Get it Started task helloWorld{ doLast { println ‘Hello World’ } } task helloWorld<<{ println ‘Hello World’ } task helloWorld{ doFirst{ ‘Hello’ } doLast{ ‘World’ } } $ gradle -q helloWorld Hello World! def chant(){ ant.echo(message: ‘Hell Ant yeah!’) } 3.times { task “yayGradle$it” <<{ println ‘Gradle rocks’ } } yayGradle0.dependsOn startSession yayGradle2.dependsOn yayGradle1, yayGradle0 task groupTherapy(dependsOn: yayGradle2) $ #exclude task $ gradle groupTherapy -x yayGradle0 $ #show all tasks $ gradle -q tasks --all
  • 13. Gradle Daemon When using gradle day to day basis, you’ll find yourself having to run your build repetitvely. Each time you initiate a build, the JVM has to be started, Gradle dependency’s has to be loaded into class loader, and the project model has to be constructed. This procedure usually takes 2 seconds. Gradle daemon to the rescue! $ ~/.gradle/gradle.properties org.gradle.daemon=true
  • 14. Let’s do some examples!
  • 15. Dependency Management Either one is available throu Gradle, Maven or Ivy Repositories apply plugin: ‘java’ repositories { mavenCentral() mavenLocal() maven { url “http://dev.foreks.com/nexus/content/repositories/release } ivy { url “http://repo.foreks.com/ivy/repo” url “../local-repo” } } dependencies{ compile ‘org.hibernate:hibernate-core:3.6.7.Final’ }
  • 16. Dependency Configurations Default configurations are compile, runtime, testCompile, testRuntime configurations{ perfCompile } dependencies{ perfCompile(‘org.openjdk.jmh:jmh-core:1.11.2’, ‘org.openjdk.jmh:jmh-generator-bytecode:1.11.2’, project) compile ‘org.codehaus.groovy:groovy-all:2.4.4’ testCompile(‘junit:junit:4.+’, ‘org.spockframework:spock-core:1.0-groovy-2.4’) testRuntime(‘com.athaydes:spock-reports:1.2.7’) } apply plugin: ‘eclipse’ eclipse { classpath { plusConfigurations+=[configurations.testCompile, configurations. perfCompile] } }
  • 17. Publishing artifacts apply plugin: ‘maven’ uploadArchives{ repositories{ mavenDeployer{ repository(url: ‘ http://dev.foreks.com/nexus/content/repositories/releases ’){ authentication(userName:nexusUsername, passowrd:nexusPassword) } snapshotRepository(url: ‘ http://dev.foreks.com/nexus/content/repositories/snapshots ’){ authentication(userName:nexusUsername, password:nexusPassword) } } } }