SlideShare a Scribd company logo
1 of 53
Download to read offline
#jbcn2016 JBCN 2016 © S1
GRADLE IN 45MIN
Schalk Cronjé
ABOUT ME
Email:
Twitter / Ello : @ysb33r
ysb33r@gmail.com
Gradle plugins authored/contributed to: VFS, Asciidoctor,
JRuby family (base, jar, war etc.), GnuMake, Doxygen
2
GET YOUR DAILY GRADLE DOSE
@DailyGradle
#gradleTip
3
 
4 . 1
SDKMAN
Manages parallel version of multiple SDKs
Mostly for (but not limited to) JVM-related systems
Windows users can use Posh-GVM (Powershell)
Windows 10 Bash ??
curl -s http://get.sdkman.io | bash
4 . 2
SDKMAN
SdkMan:
Posh-GVM:
@sdkmanager
http://sdkman.io
https://github.com/ ofreud/posh-gvm
4 . 3
5
GRADLE
A next generation build-and-deploy pipeline
tool
6 . 1
MOST TRIVIAL JAVA PROJECT
apply plugin: 'java'
Will look for sources under src/main/java
6 . 2
JAVA PROJECT
repositories {
jcenter()
}
apply plugin : 'java'
dependencies {
testCompile 'junit:junit:4.1'
}
GRADLE DEPENDENCY MANAGEMENT
Easy to use
Flexible to con gure for exceptions
Uses dependencies closure
First word on line is usually name of a con guration.
Con gurations are usually supplied by plugins.
Dependencies are downloaded from repositories
Maven coordinates are used as format
7 . 1
GRADLE REPOSITORIES
Speci ed within a repositories closure
Processed in listed order to look for dependencies
jcenter() preferred open-source repo.
mavenLocal(), mavenCentral(), maven {}
Ivy repositories via ivy {}
Flat-directory repositories via flatDir
7 . 2
GRADLE REPOSITORIES
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
repositories {
ivy {
url 'file://path/to/repo'
layout 'pattern', {
artifact '[module]/[revision]/[artifact](.[ext])'
ivy '[module]/[revision]/ivy.xml'
}
}
}
7 . 3
GRADLE DSL
Underlying language is Groovy
You don’t need to be a Groovy expert to be a Gradle power
user
Groovy doesn’t need ; in most cases
Groovy does more with less punctuation, making it an ideal
choice for a DSL
In most cases lines that do not end on an operator is
considered a completed statement.
8 . 1
GROOVY VS JAVA
In Groovy:
All class members are public by default
No need to create getters/setters for public elds
Both static & dynamic typing supported
def means Object
8 . 2
CALLING METHODS
class Foo {
void bar( def a,def b ) {}
}
def foo = new Foo()
foo.bar( '123',456 )
foo.bar '123', 456
foo.with {
bar '123', 456
}
8 . 3
CALLING METHODS WITH CLOSURES
class Foo {
void bar( def a,Closure b ) {}
}
def foo = new Foo()
foo.bar( '123',{ println it } )
foo.bar ('123') {
println it
}
foo.bar '123', {
println it
}
8 . 4
MAPS IN GROOVY
Hashmaps in Groovy are simple to use
def myMap = [ plugin : 'java' ]
Maps are easy to pass inline to functions
project.apply( plugin : 'java' )
Which in Gradle can become
apply plugin : 'java'
8 . 5
LISTS IN GROOVY
Lists in Groovy are simple too
def myList = [ 'clone', ''http://github.com/ysb33r/GradleLectures' ]
This makes it possible for Gradle to do
args 'clone', 'http://github.com/ysb33r/GradleLectures'
8 . 6
CLOSURE DELEGATION IN GROOVY
When a symbol cannot be resolved within a closure,
Groovy will look elsewhere
In Groovy speak this is called a Delegate.
This can be programmatically controlled via the
Closure.delegate property.
8 . 7
CLOSURE DELEGATION IN GROOVY
class Foo {
def target
}
class Bar {
Foo foo = new Foo()
void doSomething( Closure c ) {
c.delegate = foo
c()
}
}
Bar bar = new Bar()
bar.doSomething {
target = 10
}
8 . 8
MORE CLOSURE MAGIC
If a Groovy class has a method 'call(Closure)`, the object can
be passed a closure directly.
class Foo {
def call( Closure c) { /* ... */ }
}
Foo foo = new Foo()
foo {
println 'Hello, world'
}
// This avoids ugly syntax
foo.call({ println 'Hello, world' })
8 . 9
CLOSURE DELEGATION IN GRADLE
In most cases the delegation will be entity the closure is
passed to.
Will also look at the Project and ext objects.
The Closure.delegate property allows plugin writers
ability to create beautiful DSLs
task runSomething(type : Exec ) { cmdline 'git' }
is roughly the equivalent of
ExecTask runSomething = new ExecTask()
runSomething.cmdline( 'git' )
8 . 10
GRADLE TASKS
Can be based upon a task type
task runSomething ( type : Exec ) {
command 'git'
args 'clone', 'https://bitbucket.com/ysb33r/GradleWorkshop'
}
Can be free-form
task hellowWorld << {
println 'Hello, world'
}
9 . 1
9 . 2
GRADLE TASKS : CONFIGURATION VS ACTION
Use of << {} adds action to be executed
Tasks supplied by plugin will have default actions
Use of {} con gures a task
BUILDSCRIPT
The buildscript closure is special
It tells Gradle what to load into the classpath before
evaluating the script itself.
It also tells it where to look for those dependencies.
Even though Gradle 2.1 has added a new way of adding
external plugins, buildscript are much more exible.
10
EXTENSIONS
Extensions are global con guration blocks added by
plugins.
Example: The jruby-gradle-base plugin will add a
jruby block.
apply plugin: 'com.github.jruby-gradle.base'
jruby {
defaultVersion = '1.7.11'
}
11
12 . 1
GRADLE COMMAND-LINE
gradle -v
gradle -h
gradle tasks
gradle tasks --info
GRADLE WRAPPER
Use wrapper where possible:
Eliminates need to install Gradle in order to build project
Leads to more reproducible builds
gradle wrapper --wrapper-version 2.12
./gradlew tasks
12 . 2
12 . 3
EXECUTING TASKS
./gradlew <taskName1> <taskName2> ...
./gradlew build
DEPENDENCIES
Examine dependencies involved with various con gurations
./gradlew dependencies
12 . 4
13 . 1
SUPPORT FOR OTHER JVM LANGUAGES
GROOVY PROJECT
repositories {
jcenter()
}
apply plugin : 'groovy'
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.3'
testCompile ('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module : 'groovy-all'
}
}
13 . 2
13 . 3
SCALA PROJECT
repositories {
jcenter()
}
apply plugin : 'scala'
dependencies {
compile 'org.scala-lang:scala-library:2.11.8'
}
13 . 4
BUILDING KOTLIN
plugins {
id "com.zoltu.kotlin" version "1.0.1"
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.1-1"
}
RUNNING JRUBY
plugins {
id 'com.github.jruby-gradle.base' version '1.2.1'
}
import com.github.jrubygradle.JRubyExec
dependencies {
jrubyExec "rubygems:colorize:0.7.7"
}
task printSomePrettyOutputPlease(type: JRubyExec) {
description "Execute our nice local print-script.rb"
script "${projectDir}/print-script.rb"
}
(Example from JRuby-Gradle project)
13 . 5
OTHER LANGUAGES
C++ / C / ASM / Resources (built-in)
Clojure (plugin)
Frege (plugin)
Golang (plugin)
Gosu (plugin)
Ceyon (plugin)
Mirah (plugin)
14
SUPPORT FOR OTHER BUILDSYSTEMS
ANT (built-in)
GNU Make
MSBuild / xBuild
Grunt, Gulp
Anything else craftable via Exec or JavaExec task
15
BUILDING DOCUMENTATION
Javadoc, Groovydoc, Scaladoc (built-in)
Doxygen (C, C++) (plugin)
Markdown (plugin)
Asciidoctor (plugin)
16 . 1
16 . 2
BUILDING WITH ASCIIDOCTOR
plugins {
id 'org.asciidoctor.convert' version '1.5.2'
}
BUILDING WITH ASCIIDOCTOR
repositories {
jcenter()
}
asciidoctor {
sources {
include 'example.adoc'
}
backends 'html5'
}
16 . 3
PUBLISHING
Built-in to Maven, Ivy
Metadata publishing for native projects still lacking
Various plugins for AWS and other cloud storage
Plain old copies to FTP, SFTP etc.
17
18
MORE SUPPORT…
Of cial buildsystem for Android
Docker
Hadoop
TOUR DE FORCE
Build a distributable application packaged as as ZIP
Runnable via shell script or batch le
Contains classes written Java, Groovy & Kotlin source
Test source code with Spock Framework
19 . 1
TOUR DE FORCE
plugins {
id 'java'
id 'groovy'
id 'com.zoltu.kotlin' version '1.0.1'
id 'application'
}
repositories {
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.3'
compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.1-1'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
version = '1.0'
mainClassName = "gradle.workshop.HelloJava"
compileGroovy.dependsOn compileKotlin
19 . 2
ENDGAME
Gradle is breaking new ground
Ever improving native support
Continuous performance improvements
Go nd some more plugins at https://plugins.gradle.org
20
ABOUT THIS PRESENTATION
Written in Asciidoctor
Styled by asciidoctor-revealjs extension
Built using:
Gradle
gradle-asciidoctor-plugin
gradle-vfs-plugin
Code snippets tested as part of build
Source code:
https://github.com/ysb33r/GradleLectures/tree/Jbcn2016
21
WRITING PLUGINS?
https://leanpub.com/b/idiomaticgradle
22
THANK YOU
Email:
Twitter / Ello : @ysb33r
#idiomaticgradle
ysb33r@gmail.com
(Just in-case you need a buildtool consultant)
23
24 . 1
MIGRATIONS
24 . 2
ANT TO GRADLE
Re ect Ant Build into Gradle
ant.importBuild('build.xml')
24 . 3
MAVEN TO GRADLE
Go to directory where pom.xml is and type
gradle init --type pom
25 . 1
USEFUL STUFF
PUBLISHING VIA VFS
plugins {
id "org.ysb33r.vfs" version "1.0"
}
task publishToWebserver << {
vfs {
cp "${buildDir}/website",
"ftp://${username}:${password}@int.someserver.com/var/www",
recursive : true, overwrite : true
}
}

More Related Content

What's hot

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
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot WorldSchalk Cronjé
 
[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
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradleLiviu Tudor
 
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 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 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
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developersTricode (part of Dept)
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-kyon mm
 
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 DevelopersKostas Saidis
 
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
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 

What's hot (20)

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
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
 
[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...
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
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 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
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Gradle
GradleGradle
Gradle
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developers
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-
 
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
 
groovy & grails - lecture 10
groovy & grails - lecture 10groovy & grails - lecture 10
groovy & grails - lecture 10
 
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
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Js tacktalk team dev js testing performance
Js tacktalk team dev js testing performanceJs tacktalk team dev js testing performance
Js tacktalk team dev js testing performance
 
groovy & grails - lecture 9
groovy & grails - lecture 9groovy & grails - lecture 9
groovy & grails - lecture 9
 

Similar to Gradle in 45min: Building applications with Java, Groovy, Kotlin and more

Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle pluginDmytro Zaitsev
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Andres Almiray
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyJames Williams
 
Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Andres Almiray
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldSchalk Cronjé
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfKAI CHU CHUNG
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introductionIgor Popov
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Tino Isnich
 
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
 
Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshopJacobAae
 
Gdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackGdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackKAI CHU CHUNG
 
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
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
 

Similar to Gradle in 45min: Building applications with Java, Groovy, Kotlin and more (20)

Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle plugin
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Enter the gradle
Enter the gradleEnter the gradle
Enter the gradle
 
Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
 
Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introduction
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
GradleFX
GradleFXGradleFX
GradleFX
 
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
 
Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshop
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
Gdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackGdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpack
 
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!
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 

More from Schalk Cronjé

What's new in Asciidoctor
What's new in AsciidoctorWhat's new in Asciidoctor
What's new in AsciidoctorSchalk Cronjé
 
Probability Management
Probability ManagementProbability Management
Probability ManagementSchalk Cronjé
 
Seeking Enligtenment - A journey of purpose rather than instruction
Seeking Enligtenment  - A journey of purpose rather than instructionSeeking Enligtenment  - A journey of purpose rather than instruction
Seeking Enligtenment - A journey of purpose rather than instructionSchalk Cronjé
 
Seeking Enligtenment - A journey of purpose rather tan instruction
Seeking Enligtenment - A journey of purpose rather tan instructionSeeking Enligtenment - A journey of purpose rather tan instruction
Seeking Enligtenment - A journey of purpose rather tan instructionSchalk Cronjé
 
Beyond Estimates - Probability Management
Beyond Estimates - Probability ManagementBeyond Estimates - Probability Management
Beyond Estimates - Probability ManagementSchalk Cronjé
 
Documentation An Engineering Problem Unsolved
Documentation  An Engineering Problem UnsolvedDocumentation  An Engineering Problem Unsolved
Documentation An Engineering Problem UnsolvedSchalk Cronjé
 
Death of Agile : Welcome to Value-focused Testing
Death of Agile : Welcome to Value-focused TestingDeath of Agile : Welcome to Value-focused Testing
Death of Agile : Welcome to Value-focused TestingSchalk Cronjé
 
Tree of Knowledge - About Philosophy, Unity & Testing
Tree of Knowledge - About Philosophy, Unity & TestingTree of Knowledge - About Philosophy, Unity & Testing
Tree of Knowledge - About Philosophy, Unity & TestingSchalk Cronjé
 
Beyond estimates - Overview at Agile:MK
Beyond estimates - Overview at Agile:MKBeyond estimates - Overview at Agile:MK
Beyond estimates - Overview at Agile:MKSchalk Cronjé
 
Groovy VFS (with 1.0 news)
Groovy VFS (with 1.0 news)Groovy VFS (with 1.0 news)
Groovy VFS (with 1.0 news)Schalk Cronjé
 
Beyond estimates - Reflection on the state of Agile Forecasting
Beyond estimates - Reflection on the state of Agile ForecastingBeyond estimates - Reflection on the state of Agile Forecasting
Beyond estimates - Reflection on the state of Agile ForecastingSchalk Cronjé
 
Seeking enligtenment - A journey of "Why?" rather than "How?"
Seeking enligtenment - A journey of "Why?" rather than "How?"Seeking enligtenment - A journey of "Why?" rather than "How?"
Seeking enligtenment - A journey of "Why?" rather than "How?"Schalk Cronjé
 
RfC2822 for Mere Mortals
RfC2822 for Mere MortalsRfC2822 for Mere Mortals
RfC2822 for Mere MortalsSchalk Cronjé
 
Prosperity-focused Agile Technology Leadership
Prosperity-focused Agile Technology LeadershipProsperity-focused Agile Technology Leadership
Prosperity-focused Agile Technology LeadershipSchalk Cronjé
 

More from Schalk Cronjé (18)

DocuOps & Asciidoctor
DocuOps & AsciidoctorDocuOps & Asciidoctor
DocuOps & Asciidoctor
 
What's new in Asciidoctor
What's new in AsciidoctorWhat's new in Asciidoctor
What's new in Asciidoctor
 
Probability Management
Probability ManagementProbability Management
Probability Management
 
Seeking Enligtenment - A journey of purpose rather than instruction
Seeking Enligtenment  - A journey of purpose rather than instructionSeeking Enligtenment  - A journey of purpose rather than instruction
Seeking Enligtenment - A journey of purpose rather than instruction
 
Seeking Enligtenment - A journey of purpose rather tan instruction
Seeking Enligtenment - A journey of purpose rather tan instructionSeeking Enligtenment - A journey of purpose rather tan instruction
Seeking Enligtenment - A journey of purpose rather tan instruction
 
Beyond Estimates - Probability Management
Beyond Estimates - Probability ManagementBeyond Estimates - Probability Management
Beyond Estimates - Probability Management
 
Documentation An Engineering Problem Unsolved
Documentation  An Engineering Problem UnsolvedDocumentation  An Engineering Problem Unsolved
Documentation An Engineering Problem Unsolved
 
Death of Agile : Welcome to Value-focused Testing
Death of Agile : Welcome to Value-focused TestingDeath of Agile : Welcome to Value-focused Testing
Death of Agile : Welcome to Value-focused Testing
 
Asciidoctor in 15min
Asciidoctor in 15minAsciidoctor in 15min
Asciidoctor in 15min
 
Tree of Knowledge - About Philosophy, Unity & Testing
Tree of Knowledge - About Philosophy, Unity & TestingTree of Knowledge - About Philosophy, Unity & Testing
Tree of Knowledge - About Philosophy, Unity & Testing
 
Beyond estimates - Overview at Agile:MK
Beyond estimates - Overview at Agile:MKBeyond estimates - Overview at Agile:MK
Beyond estimates - Overview at Agile:MK
 
Groovy VFS (with 1.0 news)
Groovy VFS (with 1.0 news)Groovy VFS (with 1.0 news)
Groovy VFS (with 1.0 news)
 
Beyond estimates - Reflection on the state of Agile Forecasting
Beyond estimates - Reflection on the state of Agile ForecastingBeyond estimates - Reflection on the state of Agile Forecasting
Beyond estimates - Reflection on the state of Agile Forecasting
 
Seeking enligtenment - A journey of "Why?" rather than "How?"
Seeking enligtenment - A journey of "Why?" rather than "How?"Seeking enligtenment - A journey of "Why?" rather than "How?"
Seeking enligtenment - A journey of "Why?" rather than "How?"
 
RfC2822 for Mere Mortals
RfC2822 for Mere MortalsRfC2822 for Mere Mortals
RfC2822 for Mere Mortals
 
Groovy VFS
Groovy VFSGroovy VFS
Groovy VFS
 
Prosperity-focused Agile Technology Leadership
Prosperity-focused Agile Technology LeadershipProsperity-focused Agile Technology Leadership
Prosperity-focused Agile Technology Leadership
 
Real World TDD
Real World TDDReal World TDD
Real World TDD
 

Recently uploaded

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Recently uploaded (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Gradle in 45min: Building applications with Java, Groovy, Kotlin and more

  • 1. #jbcn2016 JBCN 2016 © S1 GRADLE IN 45MIN Schalk Cronjé
  • 2. ABOUT ME Email: Twitter / Ello : @ysb33r ysb33r@gmail.com Gradle plugins authored/contributed to: VFS, Asciidoctor, JRuby family (base, jar, war etc.), GnuMake, Doxygen
  • 3. 2 GET YOUR DAILY GRADLE DOSE @DailyGradle #gradleTip
  • 5. 4 . 1 SDKMAN Manages parallel version of multiple SDKs Mostly for (but not limited to) JVM-related systems Windows users can use Posh-GVM (Powershell) Windows 10 Bash ?? curl -s http://get.sdkman.io | bash
  • 7. 4 . 3 5 GRADLE A next generation build-and-deploy pipeline tool
  • 8. 6 . 1 MOST TRIVIAL JAVA PROJECT apply plugin: 'java' Will look for sources under src/main/java
  • 9. 6 . 2 JAVA PROJECT repositories { jcenter() } apply plugin : 'java' dependencies { testCompile 'junit:junit:4.1' }
  • 10. GRADLE DEPENDENCY MANAGEMENT Easy to use Flexible to con gure for exceptions Uses dependencies closure First word on line is usually name of a con guration. Con gurations are usually supplied by plugins. Dependencies are downloaded from repositories Maven coordinates are used as format
  • 11. 7 . 1 GRADLE REPOSITORIES Speci ed within a repositories closure Processed in listed order to look for dependencies jcenter() preferred open-source repo. mavenLocal(), mavenCentral(), maven {} Ivy repositories via ivy {} Flat-directory repositories via flatDir
  • 12. 7 . 2 GRADLE REPOSITORIES repositories { jcenter() mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } repositories { ivy { url 'file://path/to/repo' layout 'pattern', { artifact '[module]/[revision]/[artifact](.[ext])' ivy '[module]/[revision]/ivy.xml' } } }
  • 13. 7 . 3 GRADLE DSL Underlying language is Groovy You don’t need to be a Groovy expert to be a Gradle power user Groovy doesn’t need ; in most cases Groovy does more with less punctuation, making it an ideal choice for a DSL In most cases lines that do not end on an operator is considered a completed statement.
  • 14. 8 . 1 GROOVY VS JAVA In Groovy: All class members are public by default No need to create getters/setters for public elds Both static & dynamic typing supported def means Object
  • 15. 8 . 2 CALLING METHODS class Foo { void bar( def a,def b ) {} } def foo = new Foo() foo.bar( '123',456 ) foo.bar '123', 456 foo.with { bar '123', 456 }
  • 16. 8 . 3 CALLING METHODS WITH CLOSURES class Foo { void bar( def a,Closure b ) {} } def foo = new Foo() foo.bar( '123',{ println it } ) foo.bar ('123') { println it } foo.bar '123', { println it }
  • 17. 8 . 4 MAPS IN GROOVY Hashmaps in Groovy are simple to use def myMap = [ plugin : 'java' ] Maps are easy to pass inline to functions project.apply( plugin : 'java' ) Which in Gradle can become apply plugin : 'java'
  • 18. 8 . 5 LISTS IN GROOVY Lists in Groovy are simple too def myList = [ 'clone', ''http://github.com/ysb33r/GradleLectures' ] This makes it possible for Gradle to do args 'clone', 'http://github.com/ysb33r/GradleLectures'
  • 19. 8 . 6 CLOSURE DELEGATION IN GROOVY When a symbol cannot be resolved within a closure, Groovy will look elsewhere In Groovy speak this is called a Delegate. This can be programmatically controlled via the Closure.delegate property.
  • 20. 8 . 7 CLOSURE DELEGATION IN GROOVY class Foo { def target } class Bar { Foo foo = new Foo() void doSomething( Closure c ) { c.delegate = foo c() } } Bar bar = new Bar() bar.doSomething { target = 10 }
  • 21. 8 . 8 MORE CLOSURE MAGIC If a Groovy class has a method 'call(Closure)`, the object can be passed a closure directly. class Foo { def call( Closure c) { /* ... */ } } Foo foo = new Foo() foo { println 'Hello, world' } // This avoids ugly syntax foo.call({ println 'Hello, world' })
  • 22. 8 . 9 CLOSURE DELEGATION IN GRADLE In most cases the delegation will be entity the closure is passed to. Will also look at the Project and ext objects. The Closure.delegate property allows plugin writers ability to create beautiful DSLs task runSomething(type : Exec ) { cmdline 'git' } is roughly the equivalent of ExecTask runSomething = new ExecTask() runSomething.cmdline( 'git' )
  • 23. 8 . 10 GRADLE TASKS Can be based upon a task type task runSomething ( type : Exec ) { command 'git' args 'clone', 'https://bitbucket.com/ysb33r/GradleWorkshop' } Can be free-form task hellowWorld << { println 'Hello, world' }
  • 24. 9 . 1 9 . 2 GRADLE TASKS : CONFIGURATION VS ACTION Use of << {} adds action to be executed Tasks supplied by plugin will have default actions Use of {} con gures a task
  • 25. BUILDSCRIPT The buildscript closure is special It tells Gradle what to load into the classpath before evaluating the script itself. It also tells it where to look for those dependencies. Even though Gradle 2.1 has added a new way of adding external plugins, buildscript are much more exible.
  • 26. 10 EXTENSIONS Extensions are global con guration blocks added by plugins. Example: The jruby-gradle-base plugin will add a jruby block. apply plugin: 'com.github.jruby-gradle.base' jruby { defaultVersion = '1.7.11' }
  • 27. 11 12 . 1 GRADLE COMMAND-LINE gradle -v gradle -h gradle tasks gradle tasks --info
  • 28. GRADLE WRAPPER Use wrapper where possible: Eliminates need to install Gradle in order to build project Leads to more reproducible builds gradle wrapper --wrapper-version 2.12 ./gradlew tasks
  • 29. 12 . 2 12 . 3 EXECUTING TASKS ./gradlew <taskName1> <taskName2> ... ./gradlew build
  • 30. DEPENDENCIES Examine dependencies involved with various con gurations ./gradlew dependencies
  • 31. 12 . 4 13 . 1 SUPPORT FOR OTHER JVM LANGUAGES
  • 32. GROOVY PROJECT repositories { jcenter() } apply plugin : 'groovy' dependencies { compile 'org.codehaus.groovy:groovy-all:2.4.3' testCompile ('org.spockframework:spock-core:1.0-groovy-2.4') { exclude module : 'groovy-all' } }
  • 33. 13 . 2 13 . 3 SCALA PROJECT repositories { jcenter() } apply plugin : 'scala' dependencies { compile 'org.scala-lang:scala-library:2.11.8' }
  • 34. 13 . 4 BUILDING KOTLIN plugins { id "com.zoltu.kotlin" version "1.0.1" } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.1-1" }
  • 35. RUNNING JRUBY plugins { id 'com.github.jruby-gradle.base' version '1.2.1' } import com.github.jrubygradle.JRubyExec dependencies { jrubyExec "rubygems:colorize:0.7.7" } task printSomePrettyOutputPlease(type: JRubyExec) { description "Execute our nice local print-script.rb" script "${projectDir}/print-script.rb" } (Example from JRuby-Gradle project)
  • 36. 13 . 5 OTHER LANGUAGES C++ / C / ASM / Resources (built-in) Clojure (plugin) Frege (plugin) Golang (plugin) Gosu (plugin) Ceyon (plugin) Mirah (plugin)
  • 37. 14 SUPPORT FOR OTHER BUILDSYSTEMS ANT (built-in) GNU Make MSBuild / xBuild Grunt, Gulp Anything else craftable via Exec or JavaExec task
  • 38. 15 BUILDING DOCUMENTATION Javadoc, Groovydoc, Scaladoc (built-in) Doxygen (C, C++) (plugin) Markdown (plugin) Asciidoctor (plugin)
  • 39. 16 . 1 16 . 2 BUILDING WITH ASCIIDOCTOR plugins { id 'org.asciidoctor.convert' version '1.5.2' }
  • 40. BUILDING WITH ASCIIDOCTOR repositories { jcenter() } asciidoctor { sources { include 'example.adoc' } backends 'html5' }
  • 41. 16 . 3 PUBLISHING Built-in to Maven, Ivy Metadata publishing for native projects still lacking Various plugins for AWS and other cloud storage Plain old copies to FTP, SFTP etc.
  • 42. 17 18 MORE SUPPORT… Of cial buildsystem for Android Docker Hadoop
  • 43. TOUR DE FORCE Build a distributable application packaged as as ZIP Runnable via shell script or batch le Contains classes written Java, Groovy & Kotlin source Test source code with Spock Framework
  • 44. 19 . 1 TOUR DE FORCE plugins { id 'java' id 'groovy' id 'com.zoltu.kotlin' version '1.0.1' id 'application' } repositories { jcenter() } dependencies { compile 'org.codehaus.groovy:groovy-all:2.4.3' compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.1-1' testCompile 'org.spockframework:spock-core:1.0-groovy-2.4' } version = '1.0' mainClassName = "gradle.workshop.HelloJava" compileGroovy.dependsOn compileKotlin
  • 45. 19 . 2 ENDGAME Gradle is breaking new ground Ever improving native support Continuous performance improvements Go nd some more plugins at https://plugins.gradle.org
  • 46. 20 ABOUT THIS PRESENTATION Written in Asciidoctor Styled by asciidoctor-revealjs extension Built using: Gradle gradle-asciidoctor-plugin gradle-vfs-plugin Code snippets tested as part of build Source code: https://github.com/ysb33r/GradleLectures/tree/Jbcn2016
  • 48. 22 THANK YOU Email: Twitter / Ello : @ysb33r #idiomaticgradle ysb33r@gmail.com (Just in-case you need a buildtool consultant)
  • 50. 24 . 2 ANT TO GRADLE Re ect Ant Build into Gradle ant.importBuild('build.xml')
  • 51. 24 . 3 MAVEN TO GRADLE Go to directory where pom.xml is and type gradle init --type pom
  • 52. 25 . 1 USEFUL STUFF
  • 53. PUBLISHING VIA VFS plugins { id "org.ysb33r.vfs" version "1.0" } task publishToWebserver << { vfs { cp "${buildDir}/website", "ftp://${username}:${password}@int.someserver.com/var/www", recursive : true, overwrite : true } }