www.equalexperts.com
…a better way to build
www.equalexperts.com
A simple build cycle
www.equalexperts.com
Why Gradle?
Ant features: Maven features:A flexible tool Build by conventionXML scripts Dependency
managementBuild tasks
But these are not enough
What’s needed:• Sensible defaults yet easy customization• Readable and maintainable scripts• Faster builds• Easy scalability
www.equalexperts.com
Gradle is:• Faster
• Concise
• Groovy DSL
• Flexible
• Programmable
• Integrates with Ant
• Supports Groovy and Scala
• Scalable
• Structured
• Open Source
www.equalexperts.com
FasterIncremental builds make it faster.
www.equalexperts.com
Concise – smaller scriptsbuild.gradleapply plugin : ’java’build.xml
www.equalexperts.com
Groovy DSLDSL is more readable than XML
www.equalexperts.com
FlexibleEasy to customize default behaviour
Here’s Gradle doing a specific customization…
www.equalexperts.com
Maven doing that same customization…
www.equalexperts.com
ProgrammableGo ahead and write your own tasks
www.equalexperts.com
Integration with Ant
www.equalexperts.com
Workshop Time !!!
www.equalexperts.com
Heads Up…
Gradle setup
Hello World Gradle
More about Task
Build your Java project
Create your Jar
Manage dependency for JUnit
Create and deploy your War
Multi-project build
www.equalexperts.com
Setup instructions
Installation
Environment Variables
• Requires JAVA_HOME
• Set GRADLE_HOME
• Add $GRADLE_HOME/bin to PATH
Run gradle -v
www.equalexperts.com
Basic script
build.gradle
task hello << {
println ‘Hello World !’
}
www.equalexperts.com
Find the examples on Git Hub:
https://github.com/Tejaswita/Tejaswita/tree/
master/Gradle_Introduction
www.equalexperts.com
Forum:http://forums.gradle.org/gradle
References:http://gradle.org/documentation
http://gradle.org/docs/current/dsl/index.html
Building and Testing with Gradle – by Tim Berglund & Matthew McCullough
Gradle User Guide
www.equalexperts.com
Take Away
A solution that provides convention over configuration approach to the build process and an approach at building that isn’t based
on XML