SlideShare a Scribd company logo
Gradle: The Build System 
Corneil du Plessis 
corneil.duplessis@gmail.com 
@corneil
Gradle: Introduction 
The Build System you have been waiting for.
Gradle: Introduction 
 Scope 
 History Lesson 
- Make 
- Ant 
- Maven 
 Gradle
Gradle: Make 
 Targets, dependencies, rules 
 Sample: 
CFLAGS ?= -g 
all: helloworld 
helloworld: helloworld.o 
# Commands start with TAB not spaces 
$(CC) $(LDFLAGS) -o $@ $^ 
helloworld.o: helloworld.c 
$(CC) $(CFLAGS) -c -o $@ $< 
 Suffix rules: 
.c.o: 
$(CC) $(CFLAGS) -c $<
Gradle: Ant 
 Projects, targets, dependency, built-in tasks, taskdef. 
 <project name="My Project" default="all" basedir="."> 
<property name="app.name" value="hello"/> 
<property name="tcserver.home" value="/opt/tomcat-6.0.25.A.RELEASE" 
/> 
<property name="work.home" value="${basedir}/work"/> 
<property name="dist.home" value="${basedir}/dist"/> 
<property name="src.home" value="${basedir}/src"/> 
<property name="web.home" value="${basedir}/web"/> 
<path id="compile.classpath"> 
<fileset dir="${tcserver.home}/bin"> 
<include name="*.jar"/> 
</fileset> 
<pathelement location="${tcserver.home}/lib"/> 
<fileset dir="${tcserver.home}/lib"> 
<include name="*.jar"/> 
</fileset> 
</path>
Gradle: Ant – cont. 
 <target name="all" depends="clean,compile,dist" description="Clean work dirs, then compile and create a WAR"/> 
<target name="clean" description="Delete old work and dist directories"> 
<delete dir="${work.home}"/> 
<delete dir="${dist.home}"/> 
</target> 
<target name="prepare" depends="clean" description="Create work dirs copy static files to work dir"> 
<mkdir dir="${dist.home}"/> 
<mkdir dir="${work.home}/WEB-INF/classes"/> 
<copy todir="${work.home}"> 
<fileset dir="${web.home}"/> 
</copy> 
</target> 
<target name="compile" depends="prepare" description="Compile sources and copy to WEB-INF/classes dir"> 
<javac srcdir="${src.home}" destdir="${work.home}/WEB-INF/classes"> 
<classpath refid="compile.classpath"/> 
</javac> 
<copy todir="${work.home}/WEB-INF/classes"> 
<fileset dir="${src.home}" excludes="**/*.java"/> 
</copy> 
</target> 
<target name="dist" depends="compile" 
description="Create WAR file for binary distribution"> 
<jar jarfile="${dist.home}/${app.name}.war" 
basedir="${work.home}"/> 
</target> 
</project>
Gradle: Maven 
 POM, Goals, Lifecycle, Plugins, Profiles 
 Maven Repository 
 <project 
xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.mkyong</groupId> 
<artifactId>CounterWebApp</artifactId> 
<packaging>war</packaging> 
<version>1.0-SNAPSHOT</version> 
<name>CounterWebApp Maven Webapp</name> 
<url>http://maven.apache.org</url> 
<properties> 
<spring.version>3.2.8.RELEASE</spring.version> 
<junit.version>4.11</junit.version> 
<jdk.version>1.6</jdk.version> 
</properties>
Gradle: Maven – cont 
 <dependencies> 
<!-- Spring 3 dependencies → 
<dependency> 
<groupId>org.springframework</groupId> 
<artifactId>spring-core</artifactId> 
<version>${spring.version}</version> 
</dependency> 
<dependency> 
<groupId>org.springframework</groupId> 
<artifactId>spring-web</artifactId> 
<version>${spring.version}</version> 
</dependency> 
<dependency> 
<groupId>org.springframework</groupId> 
<artifactId>spring-webmvc</artifactId> 
<version>${spring.version}</version> 
</dependency> 
<dependency> 
<groupId>junit</groupId> 
<artifactId>junit</artifactId> 
<version>${junit.version}</version> 
<scope>test</scope> 
</dependency> 
</dependencies>
Gradle: Maven – cont 
 <build> 
<finalName>CounterWebApp</finalName> 
<plugins> 
<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-compiler-plugin</artifactId> 
<version>3.0</version> 
<configuration> 
<source>${jdk.version}</source> 
<target>${jdk.version}</target> 
</configuration> 
</plugin> 
</plugins> 
</build> 
</project>
Gradle: What is it? 
 Gradle is a Groovy DSL for creating build scripts 
 Gradle has a beautiful designed model for Tasks, 
Dependencies, Conventions etc. 
 Gradle understands Ivy and Maven repositories 
 Gradle can execute Ant scripts and tasks directly
Gradle: What does it look like? 
 gradle.properties 
springVersion=3.2.8.RELEASE 
junitVersion=4.11 
 settings.gradle 
rootProject.name = 'CounterWebApp' 
 build.gradle 
apply plugin: 'java' 
apply plugin: 'war' 
repositories { 
mavenCentral() 
} 
group = 'com.mkyong' 
archivesBaseName = 'CounterWebApp' 
version = '1.0-SNAPSHOT' 
sourceCompatibility = 1.6 
dependencies { 
compile 'org.springframework:spring-core:${springVersion}' 
compile 'org.springframework:spring-web:${springVersion}' 
compile 'org.springframework:spring-webmvc:${springVersion}' 
testCompile group: 'junit', name: 'junit', version: junitVersion 
}
Gradle: Artifacts 
 build.gradle 
- buildScript 
- configurations 
- dependencies 
- apply plugin 
- artifacts 
- sourceSets 
- other dsl sections and Groovy 
 settings.gradle 
- subprojects 
 gradle.properties
Gradle: Builtin Support 
 Ant Projects, Tasks 
 Java, Jar, War, Ear 
 Scala, Groovy 
 Sonar, Pmd, Jacoco, CheckStyle, FindBugs, CodeNarc, 
JDepend 
 Maven Publish, Ivy Publish 
 Jetty 
 GNU Compilers, Clang, Visual C++ 
 Eclipse, IdeaJ, Netbeans
Gradle: Create scripts 
 Create build.gradle and other files 
- Basic, Java Library, Scala Library, Groovy Library 
- Convert pom 
 gradle init –type <project-type> 
 Checkout lazybones at 
https://github.com/pledbrook/lazybones
Gradle: Demo 
 Conversion from pom 
 Custom Tasks
Gradle: 3rd Party plugins 
 http://plugins.gradle.org 
 Google Android Development 
 Bintray publishing. 
 Artifactory 
 Spring IO Framework 
 https://github.com/nebula-plugins 
 Google App Engine 
 Tomcat 
 lessCss, minCss, minJs
Gradle – Questions 
 Discuss on JUG Facebook 
 http://www.slideshare.net/CorneilduPlessis 
 https://www.facebook.com/groups/jozijug

More Related Content

PPT
Ant
Manav Prasad
 
PPT
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
Srijan Technologies
 
PPT
Intro to-ant
Manav Prasad
 
PPTX
DevOps and Chef
PiXeL16
 
PDF
What happens in laravel 4 bootstraping
Jace Ju
 
PDF
Dethroning Grunt: Simple and Effective Builds with gulp.js
Jay Harris
 
PDF
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
Srijan Technologies
 
PDF
Django Rest Framework and React and Redux, Oh My!
Eric Palakovich Carr
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
Srijan Technologies
 
Intro to-ant
Manav Prasad
 
DevOps and Chef
PiXeL16
 
What happens in laravel 4 bootstraping
Jace Ju
 
Dethroning Grunt: Simple and Effective Builds with gulp.js
Jay Harris
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
Srijan Technologies
 
Django Rest Framework and React and Redux, Oh My!
Eric Palakovich Carr
 

What's hot (20)

PDF
Vue 淺談前端建置工具
andyyou
 
KEY
CodeIgniter 3.0
Phil Sturgeon
 
PDF
HTML5 JavaScript APIs
Remy Sharp
 
PDF
Grails 1.4.0.M1 メモLT
Tsuyoshi Yamamoto
 
KEY
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
Graham Dumpleton
 
KEY
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
PDF
Salesforce CLI Cheat Sheet
Keir Bowden
 
PDF
Forget Grunt and Gulp! Webpack and NPM rule them all!
Derek Willian Stavis
 
PDF
The Best (and Worst) of Django
Jacob Kaplan-Moss
 
PDF
You must know about CodeIgniter Popular Library
Bo-Yi Wu
 
PDF
Deploying configurable frontend web application containers
José Moreira
 
PPTX
NLIT 2011: Chef & Capistrano
nickblah
 
PDF
Using VueJS in front of Drupal 8
Brian Ward
 
PDF
Head First Zend Framework - Part 1 Project & Application
Jace Ju
 
PDF
Continuous Integration with Robot Sweatshop
Justin Scott
 
PDF
Using Groovy with Jenkins
sascha_klein
 
PDF
From Hacker to Programmer (w/ Webpack, Babel and React)
Joseph Chiang
 
PDF
遠端團隊專案建立與管理 remote team management 2016
Caesar Chi
 
KEY
Phpne august-2012-symfony-components-friends
Michael Peacock
 
PDF
Using Backbone.js with Drupal 7 and 8
Ovadiah Myrgorod
 
Vue 淺談前端建置工具
andyyou
 
CodeIgniter 3.0
Phil Sturgeon
 
HTML5 JavaScript APIs
Remy Sharp
 
Grails 1.4.0.M1 メモLT
Tsuyoshi Yamamoto
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
Graham Dumpleton
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Salesforce CLI Cheat Sheet
Keir Bowden
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Derek Willian Stavis
 
The Best (and Worst) of Django
Jacob Kaplan-Moss
 
You must know about CodeIgniter Popular Library
Bo-Yi Wu
 
Deploying configurable frontend web application containers
José Moreira
 
NLIT 2011: Chef & Capistrano
nickblah
 
Using VueJS in front of Drupal 8
Brian Ward
 
Head First Zend Framework - Part 1 Project & Application
Jace Ju
 
Continuous Integration with Robot Sweatshop
Justin Scott
 
Using Groovy with Jenkins
sascha_klein
 
From Hacker to Programmer (w/ Webpack, Babel and React)
Joseph Chiang
 
遠端團隊專案建立與管理 remote team management 2016
Caesar Chi
 
Phpne august-2012-symfony-components-friends
Michael Peacock
 
Using Backbone.js with Drupal 7 and 8
Ovadiah Myrgorod
 
Ad

Similar to Gradle: The Build system you have been waiting for (20)

ODP
Gradle: The Build System you have been waiting for!
Corneil du Plessis
 
PDF
Gradle talk, Javarsovia 2010
Tomek Kaczanowski
 
PDF
Gradle - time for a new build
Igor Khotin
 
PDF
Gradleintroduction 111010130329-phpapp01
Tino Isnich
 
PDF
Gradle Introduction
Dmitry Buzdin
 
PPTX
Single Page JavaScript WebApps... A Gradle Story
Kon Soulianidis
 
PPTX
GradleFX
Christophe Herreman
 
PPTX
Faster Java EE Builds with Gradle
Ryan Cuprak
 
PPTX
Faster Java EE Builds with Gradle
Ryan Cuprak
 
PDF
In the Brain of Hans Dockter: Gradle
Skills Matter
 
PDF
Gradle - Build system evolved
Bhagwat Kumar
 
PDF
Making the most of your gradle build - Gr8Conf 2017
Andres Almiray
 
ODP
Gradle - time for another build
Igor Khotin
 
PDF
Making the most of your gradle build - Greach 2017
Andres Almiray
 
PPT
Maven in Mule
Anand kalla
 
PDF
10 Cool Facts about Gradle
Evgeny Goldin
 
PDF
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
PPT
Maven
javeed_mhd
 
PPT
Maven
AbdulImrankhan7
 
Gradle: The Build System you have been waiting for!
Corneil du Plessis
 
Gradle talk, Javarsovia 2010
Tomek Kaczanowski
 
Gradle - time for a new build
Igor Khotin
 
Gradleintroduction 111010130329-phpapp01
Tino Isnich
 
Gradle Introduction
Dmitry Buzdin
 
Single Page JavaScript WebApps... A Gradle Story
Kon Soulianidis
 
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Faster Java EE Builds with Gradle
Ryan Cuprak
 
In the Brain of Hans Dockter: Gradle
Skills Matter
 
Gradle - Build system evolved
Bhagwat Kumar
 
Making the most of your gradle build - Gr8Conf 2017
Andres Almiray
 
Gradle - time for another build
Igor Khotin
 
Making the most of your gradle build - Greach 2017
Andres Almiray
 
Maven in Mule
Anand kalla
 
10 Cool Facts about Gradle
Evgeny Goldin
 
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
Maven
javeed_mhd
 
Ad

More from Corneil du Plessis (14)

PPTX
Sweet Streams (Are made of this)
Corneil du Plessis
 
PPTX
Cloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Corneil du Plessis
 
PPTX
QueryDSL - Lightning Talk
Corneil du Plessis
 
PPTX
Enhancements in Java 9 Streams
Corneil du Plessis
 
PPTX
Reactive Spring 5
Corneil du Plessis
 
PPTX
Empathic API-Design
Corneil du Plessis
 
ODP
Performance Comparison JVM Languages
Corneil du Plessis
 
ODP
Microservices Patterns and Anti-Patterns
Corneil du Plessis
 
ODP
Consume Spring Data Rest with Angularjs
Corneil du Plessis
 
ODP
The Evolution of Java
Corneil du Plessis
 
ODP
Polyglot persistence with Spring Data
Corneil du Plessis
 
ODP
Data repositories
Corneil du Plessis
 
ODP
Dependency Injection in Spring in 10min
Corneil du Plessis
 
ODP
Spring Data in 10 minutes
Corneil du Plessis
 
Sweet Streams (Are made of this)
Corneil du Plessis
 
Cloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Corneil du Plessis
 
QueryDSL - Lightning Talk
Corneil du Plessis
 
Enhancements in Java 9 Streams
Corneil du Plessis
 
Reactive Spring 5
Corneil du Plessis
 
Empathic API-Design
Corneil du Plessis
 
Performance Comparison JVM Languages
Corneil du Plessis
 
Microservices Patterns and Anti-Patterns
Corneil du Plessis
 
Consume Spring Data Rest with Angularjs
Corneil du Plessis
 
The Evolution of Java
Corneil du Plessis
 
Polyglot persistence with Spring Data
Corneil du Plessis
 
Data repositories
Corneil du Plessis
 
Dependency Injection in Spring in 10min
Corneil du Plessis
 
Spring Data in 10 minutes
Corneil du Plessis
 

Recently uploaded (20)

PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Exploring AI Agents in Process Industries
amoreira6
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 

Gradle: The Build system you have been waiting for

  • 1. Gradle: The Build System Corneil du Plessis [email protected] @corneil
  • 2. Gradle: Introduction The Build System you have been waiting for.
  • 3. Gradle: Introduction  Scope  History Lesson - Make - Ant - Maven  Gradle
  • 4. Gradle: Make  Targets, dependencies, rules  Sample: CFLAGS ?= -g all: helloworld helloworld: helloworld.o # Commands start with TAB not spaces $(CC) $(LDFLAGS) -o $@ $^ helloworld.o: helloworld.c $(CC) $(CFLAGS) -c -o $@ $<  Suffix rules: .c.o: $(CC) $(CFLAGS) -c $<
  • 5. Gradle: Ant  Projects, targets, dependency, built-in tasks, taskdef.  <project name="My Project" default="all" basedir="."> <property name="app.name" value="hello"/> <property name="tcserver.home" value="/opt/tomcat-6.0.25.A.RELEASE" /> <property name="work.home" value="${basedir}/work"/> <property name="dist.home" value="${basedir}/dist"/> <property name="src.home" value="${basedir}/src"/> <property name="web.home" value="${basedir}/web"/> <path id="compile.classpath"> <fileset dir="${tcserver.home}/bin"> <include name="*.jar"/> </fileset> <pathelement location="${tcserver.home}/lib"/> <fileset dir="${tcserver.home}/lib"> <include name="*.jar"/> </fileset> </path>
  • 6. Gradle: Ant – cont.  <target name="all" depends="clean,compile,dist" description="Clean work dirs, then compile and create a WAR"/> <target name="clean" description="Delete old work and dist directories"> <delete dir="${work.home}"/> <delete dir="${dist.home}"/> </target> <target name="prepare" depends="clean" description="Create work dirs copy static files to work dir"> <mkdir dir="${dist.home}"/> <mkdir dir="${work.home}/WEB-INF/classes"/> <copy todir="${work.home}"> <fileset dir="${web.home}"/> </copy> </target> <target name="compile" depends="prepare" description="Compile sources and copy to WEB-INF/classes dir"> <javac srcdir="${src.home}" destdir="${work.home}/WEB-INF/classes"> <classpath refid="compile.classpath"/> </javac> <copy todir="${work.home}/WEB-INF/classes"> <fileset dir="${src.home}" excludes="**/*.java"/> </copy> </target> <target name="dist" depends="compile" description="Create WAR file for binary distribution"> <jar jarfile="${dist.home}/${app.name}.war" basedir="${work.home}"/> </target> </project>
  • 7. Gradle: Maven  POM, Goals, Lifecycle, Plugins, Profiles  Maven Repository  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mkyong</groupId> <artifactId>CounterWebApp</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>CounterWebApp Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <spring.version>3.2.8.RELEASE</spring.version> <junit.version>4.11</junit.version> <jdk.version>1.6</jdk.version> </properties>
  • 8. Gradle: Maven – cont  <dependencies> <!-- Spring 3 dependencies → <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> </dependencies>
  • 9. Gradle: Maven – cont  <build> <finalName>CounterWebApp</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin> </plugins> </build> </project>
  • 10. Gradle: What is it?  Gradle is a Groovy DSL for creating build scripts  Gradle has a beautiful designed model for Tasks, Dependencies, Conventions etc.  Gradle understands Ivy and Maven repositories  Gradle can execute Ant scripts and tasks directly
  • 11. Gradle: What does it look like?  gradle.properties springVersion=3.2.8.RELEASE junitVersion=4.11  settings.gradle rootProject.name = 'CounterWebApp'  build.gradle apply plugin: 'java' apply plugin: 'war' repositories { mavenCentral() } group = 'com.mkyong' archivesBaseName = 'CounterWebApp' version = '1.0-SNAPSHOT' sourceCompatibility = 1.6 dependencies { compile 'org.springframework:spring-core:${springVersion}' compile 'org.springframework:spring-web:${springVersion}' compile 'org.springframework:spring-webmvc:${springVersion}' testCompile group: 'junit', name: 'junit', version: junitVersion }
  • 12. Gradle: Artifacts  build.gradle - buildScript - configurations - dependencies - apply plugin - artifacts - sourceSets - other dsl sections and Groovy  settings.gradle - subprojects  gradle.properties
  • 13. Gradle: Builtin Support  Ant Projects, Tasks  Java, Jar, War, Ear  Scala, Groovy  Sonar, Pmd, Jacoco, CheckStyle, FindBugs, CodeNarc, JDepend  Maven Publish, Ivy Publish  Jetty  GNU Compilers, Clang, Visual C++  Eclipse, IdeaJ, Netbeans
  • 14. Gradle: Create scripts  Create build.gradle and other files - Basic, Java Library, Scala Library, Groovy Library - Convert pom  gradle init –type <project-type>  Checkout lazybones at https://github.com/pledbrook/lazybones
  • 15. Gradle: Demo  Conversion from pom  Custom Tasks
  • 16. Gradle: 3rd Party plugins  http://plugins.gradle.org  Google Android Development  Bintray publishing.  Artifactory  Spring IO Framework  https://github.com/nebula-plugins  Google App Engine  Tomcat  lessCss, minCss, minJs
  • 17. Gradle – Questions  Discuss on JUG Facebook  http://www.slideshare.net/CorneilduPlessis  https://www.facebook.com/groups/jozijug