SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Corneil du Plessis
Gradle: The Build system you have been waiting for!
DevOps &
Automation
Gradle: Introduction

Scope

History Lesson
− Make
− Ant
− Maven

Gradle
− What is it?
− Is Groovy
− Artefacts
− Builtin Support
− Case studies
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="SampleWebApp" default="all" basedir=".">
<property name="app.name" value="SampleWebApp"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="work.dir" value="${basedir}/work"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="web.dir" value="${basedir}/web"/>
<path id="compile.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
Gradle: Ant – cont.
<target name="all" depends="clean,compile,dist" description="Clean dirs,compile,create a WAR"/>
<target name="clean" description="Delete old work and dist directories">
<delete dir="${work.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="prepare" depends="clean" description="Create work dirs copy static files to work dir">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${work.dir}/WEB-INF/classes"/>
<copy todir="${work.dir}">
<fileset dir="${web.dir}"/>
</copy>
</target>
<target name="compile" depends="prepare" description="Compile sources and copy to WEB-INF/classes dir">
<javac srcdir="${src.dir}" destdir="${work.dir}/WEB-INF/classes">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${work.dir}/WEB-INF/classes">
<fileset dir="${src.dir}" excludes="**/*.java"/>
</copy>
</target>
<target name="dist" depends="compile" description="Create WAR file for binary distribution">
<jar jarfile="${dist.dir}/${app.name}.war" basedir="${work.dir}"/>
</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>io.jumpco.samples</groupId>
<artifactId>SampleWebApp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>SampleWebApp Maven Web App</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>4.2.4.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<jdk.version>1.8</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>SampleWebApp</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

This is a valid Gradle build script:
apply plugin: 'war'
Gradle: What does it look like?
build.gradle
apply plugin: 'java'
apply plugin: 'war'
repositories {
mavenCentral()
}
group = 'io.jumpco.samples'
version = '1.0-SNAPSHOT'
sourceCompatibility = 1.8
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
}
settings.gradle
rootProject.name = 'SampleWebApp'
gradle.properties
springVersion=4.2.4.RELEASE
junitVersion=4.11
Gradle: Is Groovy

DSL Handlers

Closures
repositories {
maven {
url 'http://download.java.net/mave/2/'
}
}

Strings
'org.springframework:spring-core:' + springVersion
“org.springframework:spring-core:$springVersion”
Gradle: Artifacts
● build.gradle
– buildScript
– configurations
– dependencies
– apply plugin
– artifacts
– sourceSets
– other dsl sections and Groovy
● settings.gradle
– subprojects
● gradle.properties
– Global properties
● buildSrc
– Custom tasks
Gradle: Builtin Support

Ant Projects, Tasks

Java, Jar, War, Ear

Scala, Groovy, GNU Compilers, Clang, Visual C++

Build Reporting

ANTLR

OSGi

Sonar, Pmd, Jacoco, CheckStyle, FindBugs, CodeNarc,
JDepend

Maven Publish, Ivy Publish, Signing, Distribution

Jetty

Announcements (Twitter, Growl, Snarl, notify-send)
Gradle: IDE Support
● Eclipse
● IntelliJ
● Netbeans
● Use your imagination
Gradle: Create scripts

gradle init –type basic|pom|java-library

Create build.gradle and other files
− Basic, Java Library, Scala Library, Groovy Library
− Choose test framework
− Convert pom
●
IDE New Gradle Project
●
Checkout lazybones at
https://github.com/pledbrook/lazybones
Gradle: Wrapper
gradle wrapper
Creates gradlew, gradlew.bat, gradle folder. Small enough to
checkin.
./gradlew build
Downloads Gradle version and executes build task.
Gradle: Other

Gradle UI – Swing application

Gradle Daemon will remain running and will reload only
modified scripts to improve execution time.

--continuous option. Gradle will remain running and trigger
build when input artefacts modified.

New Build Model
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: Cases Studies
● 2000 components, 1000 release builds per day
● Nebula. Patched Gradle.
● Enterprise Projects with > 300 modules
● Partial Local build.
● Generate documentation
● Deployment automation
Gradle: Summary
● Made for Customisation
● Robust Dependency Management
● Build Reporting
● The same flexible Build Model for both continuous
integration and local development.
● One source of the truth
/* THANK YOU*/
Corneil du Plessis
JumpCo (formerly TSC Technologies)
corneil@jumpco.io
corneil.duplessis@gmail.com
https://about.me/corneil
Demo project:
https://github.com/corneil/gradle-docs
http://www.devconf.co.za/Rate

Weitere ähnliche Inhalte

Was ist angesagt?

Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Eric Wendelin
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...ZeroTurnaround
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Gradle - time for another build
Gradle - time for another buildGradle - time for another build
Gradle - time for another buildIgor Khotin
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin WritingSchalk Cronjé
 
NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6Kostas Saidis
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with GradleWei Chen
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for androidzhang ghui
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-kyon mm
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbtFabio Fumarola
 
Gradle plugins, take it to the next level
Gradle plugins, take it to the next levelGradle plugins, take it to the next level
Gradle plugins, take it to the next levelEyal Lezmy
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 

Was ist angesagt? (20)

Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
Gradle
GradleGradle
Gradle
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Gradle - time for another build
Gradle - time for another buildGradle - time for another build
Gradle - time for another build
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 
NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Gradle plugins, take it to the next level
Gradle plugins, take it to the next levelGradle plugins, take it to the next level
Gradle plugins, take it to the next level
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 

Andere mochten auch

Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring DataCorneil du Plessis
 
Microservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsMicroservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsCorneil du Plessis
 
Performance Comparison JVM Languages
Performance Comparison JVM LanguagesPerformance Comparison JVM Languages
Performance Comparison JVM LanguagesCorneil du Plessis
 
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
 
From Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMFrom Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMBucharest Java User Group
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android projectShaka Huang
 

Andere mochten auch (8)

Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring Data
 
Spring Data in 10 minutes
Spring Data in 10 minutesSpring Data in 10 minutes
Spring Data in 10 minutes
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Microservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsMicroservices Patterns and Anti-Patterns
Microservices Patterns and Anti-Patterns
 
Performance Comparison JVM Languages
Performance Comparison JVM LanguagesPerformance Comparison JVM Languages
Performance Comparison JVM Languages
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
 
From Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMFrom Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVM
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android project
 

Ähnlich wie Gradle Build System Introduction

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 forCorneil du Plessis
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overviewKevin He
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Tomek Kaczanowski
 
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
 
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: GradleSkills Matter
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Tino Isnich
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
 
10 Cool Facts about Gradle
10 Cool Facts about Gradle10 Cool Facts about Gradle
10 Cool Facts about GradleEvgeny Goldin
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle buildsPeter Ledbrook
 
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
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfigVijay Shukla
 

Ähnlich wie Gradle Build System Introduction (20)

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
 
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
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
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]
 
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
 
Why gradle
Why gradle Why gradle
Why gradle
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
OpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleOpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with Gradle
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
10 Cool Facts about Gradle
10 Cool Facts about Gradle10 Cool Facts about Gradle
10 Cool Facts about Gradle
 
Enter the gradle
Enter the gradleEnter the gradle
Enter the gradle
 
GradleFX
GradleFXGradleFX
GradleFX
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle builds
 
Grails 101
Grails 101Grails 101
Grails 101
 
Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
 
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)
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfig
 

Mehr von Corneil du Plessis

Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Corneil du Plessis
 
Cloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Cloud Native Applications for Cloud Foundry using Spring Cloud : A WorkshopCloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Cloud Native Applications for Cloud Foundry using Spring Cloud : A WorkshopCorneil du Plessis
 
Enhancements in Java 9 Streams
Enhancements in Java 9 StreamsEnhancements in Java 9 Streams
Enhancements in Java 9 StreamsCorneil du Plessis
 
Consume Spring Data Rest with Angularjs
Consume Spring Data Rest with AngularjsConsume Spring Data Rest with Angularjs
Consume Spring Data Rest with AngularjsCorneil du Plessis
 
Dependency Injection in Spring in 10min
Dependency Injection in Spring in 10minDependency Injection in Spring in 10min
Dependency Injection in Spring in 10minCorneil du Plessis
 

Mehr von Corneil du Plessis (9)

Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Sweet Streams (Are made of this)
Sweet Streams (Are made of this)
 
Cloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Cloud Native Applications for Cloud Foundry using Spring Cloud : A WorkshopCloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
Cloud Native Applications for Cloud Foundry using Spring Cloud : A Workshop
 
QueryDSL - Lightning Talk
QueryDSL - Lightning TalkQueryDSL - Lightning Talk
QueryDSL - Lightning Talk
 
Enhancements in Java 9 Streams
Enhancements in Java 9 StreamsEnhancements in Java 9 Streams
Enhancements in Java 9 Streams
 
Reactive Spring 5
Reactive Spring 5Reactive Spring 5
Reactive Spring 5
 
Empathic API-Design
Empathic API-DesignEmpathic API-Design
Empathic API-Design
 
Consume Spring Data Rest with Angularjs
Consume Spring Data Rest with AngularjsConsume Spring Data Rest with Angularjs
Consume Spring Data Rest with Angularjs
 
Data repositories
Data repositoriesData repositories
Data repositories
 
Dependency Injection in Spring in 10min
Dependency Injection in Spring in 10minDependency Injection in Spring in 10min
Dependency Injection in Spring in 10min
 

Kürzlich hochgeladen

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
+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
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Kürzlich hochgeladen (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+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...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Gradle Build System Introduction

  • 1. Corneil du Plessis Gradle: The Build system you have been waiting for! DevOps & Automation
  • 2. Gradle: Introduction  Scope  History Lesson − Make − Ant − Maven  Gradle − What is it? − Is Groovy − Artefacts − Builtin Support − Case studies
  • 3. 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 $<
  • 4. Gradle: Ant  Projects, targets, dependency, built-in tasks, taskdef. <project name="SampleWebApp" default="all" basedir="."> <property name="app.name" value="SampleWebApp"/> <property name="lib.dir" value="${basedir}/lib"/> <property name="work.dir" value="${basedir}/work"/> <property name="dist.dir" value="${basedir}/dist"/> <property name="src.dir" value="${basedir}/src"/> <property name="web.dir" value="${basedir}/web"/> <path id="compile.classpath"> <fileset dir="${lib.dir}"> <include name="*.jar"/> </fileset> </path>
  • 5. Gradle: Ant – cont. <target name="all" depends="clean,compile,dist" description="Clean dirs,compile,create a WAR"/> <target name="clean" description="Delete old work and dist directories"> <delete dir="${work.dir}"/> <delete dir="${dist.dir}"/> </target> <target name="prepare" depends="clean" description="Create work dirs copy static files to work dir"> <mkdir dir="${dist.dir}"/> <mkdir dir="${work.dir}/WEB-INF/classes"/> <copy todir="${work.dir}"> <fileset dir="${web.dir}"/> </copy> </target> <target name="compile" depends="prepare" description="Compile sources and copy to WEB-INF/classes dir"> <javac srcdir="${src.dir}" destdir="${work.dir}/WEB-INF/classes"> <classpath refid="compile.classpath"/> </javac> <copy todir="${work.dir}/WEB-INF/classes"> <fileset dir="${src.dir}" excludes="**/*.java"/> </copy> </target> <target name="dist" depends="compile" description="Create WAR file for binary distribution"> <jar jarfile="${dist.dir}/${app.name}.war" basedir="${work.dir}"/> </target> </project>
  • 6. 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>io.jumpco.samples</groupId> <artifactId>SampleWebApp</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>SampleWebApp Maven Web App</name> <url>http://maven.apache.org</url> <properties> <spring.version>4.2.4.RELEASE</spring.version> <junit.version>4.12</junit.version> <jdk.version>1.8</jdk.version> </properties>
  • 7. 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>
  • 8. Gradle: Maven – cont <build> <finalName>SampleWebApp</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>
  • 9. 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  This is a valid Gradle build script: apply plugin: 'war'
  • 10. Gradle: What does it look like? build.gradle apply plugin: 'java' apply plugin: 'war' repositories { mavenCentral() } group = 'io.jumpco.samples' version = '1.0-SNAPSHOT' sourceCompatibility = 1.8 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 } settings.gradle rootProject.name = 'SampleWebApp' gradle.properties springVersion=4.2.4.RELEASE junitVersion=4.11
  • 11. Gradle: Is Groovy  DSL Handlers  Closures repositories { maven { url 'http://download.java.net/mave/2/' } }  Strings 'org.springframework:spring-core:' + springVersion “org.springframework:spring-core:$springVersion”
  • 12. Gradle: Artifacts ● build.gradle – buildScript – configurations – dependencies – apply plugin – artifacts – sourceSets – other dsl sections and Groovy ● settings.gradle – subprojects ● gradle.properties – Global properties ● buildSrc – Custom tasks
  • 13. Gradle: Builtin Support  Ant Projects, Tasks  Java, Jar, War, Ear  Scala, Groovy, GNU Compilers, Clang, Visual C++  Build Reporting  ANTLR  OSGi  Sonar, Pmd, Jacoco, CheckStyle, FindBugs, CodeNarc, JDepend  Maven Publish, Ivy Publish, Signing, Distribution  Jetty  Announcements (Twitter, Growl, Snarl, notify-send)
  • 14. Gradle: IDE Support ● Eclipse ● IntelliJ ● Netbeans ● Use your imagination
  • 15. Gradle: Create scripts  gradle init –type basic|pom|java-library  Create build.gradle and other files − Basic, Java Library, Scala Library, Groovy Library − Choose test framework − Convert pom ● IDE New Gradle Project ● Checkout lazybones at https://github.com/pledbrook/lazybones
  • 16. Gradle: Wrapper gradle wrapper Creates gradlew, gradlew.bat, gradle folder. Small enough to checkin. ./gradlew build Downloads Gradle version and executes build task.
  • 17. Gradle: Other  Gradle UI – Swing application  Gradle Daemon will remain running and will reload only modified scripts to improve execution time.  --continuous option. Gradle will remain running and trigger build when input artefacts modified.  New Build Model
  • 18. 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
  • 19. Gradle: Cases Studies ● 2000 components, 1000 release builds per day ● Nebula. Patched Gradle. ● Enterprise Projects with > 300 modules ● Partial Local build. ● Generate documentation ● Deployment automation
  • 20. Gradle: Summary ● Made for Customisation ● Robust Dependency Management ● Build Reporting ● The same flexible Build Model for both continuous integration and local development. ● One source of the truth
  • 21. /* THANK YOU*/ Corneil du Plessis JumpCo (formerly TSC Technologies) corneil@jumpco.io corneil.duplessis@gmail.com https://about.me/corneil Demo project: https://github.com/corneil/gradle-docs http://www.devconf.co.za/Rate