SlideShare a Scribd company logo
1 of 52
Download to read offline
GRADLE IN A POLYGLOT WORLD
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
GRADLE
Not just for building JVM projects
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.
GROOVY VS JAVA
In Groovy:
All class members are public by default
No need to create getters/setters for public fields
Both static & dynamic typing supported
def means Object
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
}
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
}
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'
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'
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.
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
}
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' })
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' )
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'
}
GRADLE TASKS : CONFIGURATION VS
ACTION
Use of << {} adds action to be executed
Tasks supplied by plugin will have default actions
Use of {} configures 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 flexible.
EXTENSIONS
Extensions are global configuration 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'
}
JAVA PROJECT
repositories {
jcenter()
}
apply plugin : 'java'
dependencies {
testCompile 'junit:junit:4.1+'
}
GRADLE DEPENDENCY
MANAGEMENT
Easy to use
Flexible to configure for exceptions
Uses dependencies closure
First word on line is usually name of a configuration.
Configurations are usually supplied by plugins.
Dependencies are downloaded from repositories
Maven coordinates are used as format
GRADLE REPOSITORIES
Specified 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
BUILDING C++
BUILDING C++ - TOOL SUPPORT
Operating
System
Tool Chain Official
Linux gcc, clang Y
MacOS X Xcode Y
gcc-macports, clang-
macports
N
Windows Visual C++, gcc-cygwin32,
gcc-mingw
Y
gcc-cygwin64 N
Unix-like gcc, clang N
BUILDING C++ - LAYOUT
Need to change convention from traditional C++ projects
.cpp files go in src/${name}/cpp
Exported headers files go in src/${name}/headers
Local header files should be in src/${name}/cpp
Object files will end up in ${buildDir}/objs
Binary files will end up in ${buildDir}/binaries
BUILDING C++ - BASICS
apply plugin : 'cpp'
BUILDING C++ - EXECUTABLE
model {
components {
hello(NativeExecutableSpec)
}
}
BUILDING C++ - PROJECT LAYOUT
├── build.gradle
└── src
└─── hello
   ├── cpp
│ └─── hello.cpp
│
   └── headers
└─── hello.hpp
BUILDING C++ - EXISTING PROJECTS
Source directories can be adjusted
Alternative compiler locations
BUILDING C++ - ALTERNATIVE
SOURCE
sources {
cpp {
source {
srcDir "myDir"
include "**/*.cpp"
}
}
}
BUILDING C++ - OTHER FEATURES
Cross compilation
Multi-architecture targets
Set compiler & linker flags
Multi-variant builds
BUILDING C++ - WEAKNESS
Currently only have built-in support for CUnit
Only platform configuration tool support is CMake
No Autotools equivalent
DSL can be slicker
BUILDING RUBY
BUILDING JRUBY
buildscript {
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:1.1.4'
}
}
import com.github.jrubygradle.JRubyExec
BUILDING JRUBY
apply plugin: "com.github.jruby-gradle.base"
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)
OTHER LANGUAGES
C / ASM / Resources (built-in)
Clojure (plugin)
Frege (plugin)
Golang (plugin)
Scala (built-in)
Gosu (plugin)
SUPPORT FOR OTHER
BUILDSYSTEMS
ANT (built-in)
GNU Make
MSBuild / xBuild
Grunt
Anything else craftable via Exec or JavaExec task
DOCUMENTATION
BUILDING DOCUMENTATION
Doxygen
Markdown
Asciidoctor
ASCIIDOCTOR
BUILDING WITH ASCIIDOCTOR
plugins {
id 'org.asciidoctor.convert' version '1.5.2'
}
BUILDING WITH ASCIIDOCTOR
repositories {
jcenter()
}
asciidoctor {
sources {
include 'example.adoc'
}
backends 'html5'
}
BUILDING WITH DOXYGEN
plugins {
id "org.ysb33r.doxygen" version "0.2"
}
doxygen {
source file('src/hello/cpp')
source file('src/hello/headers')
generate_xml true
generate_html true
file_patterns '*.cpp', '*.hpp'
html_colorstyle_sat 100
}
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.
PUBLISHING VIA VFS
plugins {
id "org.ysb33r.vfs" version "1.0-beta3"
}
task publishToWebserver {
vfs {
cp "${buildDir}/website",
"ftp://${username}:${password}@int.someserver.com/var/www",
recursive : true, overwrite : true
}
}
MORE SUPPORT…​
Official buildsystem for Android
Docker
Hadoop
ENDGAME
Gradle is breaking new ground
Ever improving native support
Continuous performance improvements
Go find some more plugins at https://plugins.gradle.org
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/AccuLondon
THANK YOU
Email:
Twitter / Ello : @ysb33r
ysb33r@gmail.com
Keep an eye out for https://leanpub.com/idiomaticgradle
MIGRATIONS
ANT TO GRADLE
Reflect Ant Build into Gradle
ant.importBuild('build.xml')
MAVEN TO GRADLE
Go to directory where pom.xml is and type
gradle init --type pom
GNUMAKE TO GRADLE
Call current Makefile from Gradle
plugins {
id "org.ysb33r.gnumake" version "1.0.2"
}
import org.ysb33r.gradle.gnumake.GnuMakeBuild
task runMake (type:GnuMakeBuild) {
targets 'build','install'
flags DESTDIR : '/copy/files/here', BUILD_NUMBER : '12345'
}

More Related Content

What's hot

Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin WritingSchalk Cronjé
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
parenscript-tutorial
parenscript-tutorialparenscript-tutorial
parenscript-tutorialtutorialsruby
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golangTing-Li Chou
 
JVM Dive for mere mortals
JVM Dive for mere mortalsJVM Dive for mere mortals
JVM Dive for mere mortalsJakub Kubrynski
 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applicationsrohitnayak
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinKai Koenig
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf Conference
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
API management with Taffy and API Blueprint
API management with Taffy and API BlueprintAPI management with Taffy and API Blueprint
API management with Taffy and API BlueprintKai Koenig
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)Ontico
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingLuciano Mammino
 
Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on AndroidSam Lee
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Johnny Sung
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Codemotion
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 

What's hot (20)

Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
parenscript-tutorial
parenscript-tutorialparenscript-tutorial
parenscript-tutorial
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
JVM Dive for mere mortals
JVM Dive for mere mortalsJVM Dive for mere mortals
JVM Dive for mere mortals
 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applications
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
API management with Taffy and API Blueprint
API management with Taffy and API BlueprintAPI management with Taffy and API Blueprint
API management with Taffy and API Blueprint
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
 
Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on Android
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 

Similar to Gradle in a Polyglot World

Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionSchalk Cronjé
 
Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle pluginDmytro Zaitsev
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyJames Williams
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finessemzgubin
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finessemzgubin
 
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
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introductionIgor Popov
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
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
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Tino Isnich
 

Similar to Gradle in a Polyglot World (20)

Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
 
Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle plugin
 
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?
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
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
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introduction
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
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!
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
GradleFX
GradleFXGradleFX
GradleFX
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Groovy to gradle
Groovy to gradleGroovy to gradle
Groovy to gradle
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 

More from Schalk Cronjé

DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldSchalk 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é
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Schalk Cronjé
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You TestSchalk 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é
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk 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é
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk 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é
 

More from Schalk Cronjé (20)

DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
 
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
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You Test
 
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
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
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
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
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
 

Recently uploaded

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
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
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
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
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
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 ...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
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
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

Gradle in a Polyglot World

  • 1. GRADLE IN A POLYGLOT WORLD 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. GRADLE Not just for building JVM projects
  • 4. 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.
  • 5. GROOVY VS JAVA In Groovy: All class members are public by default No need to create getters/setters for public fields Both static & dynamic typing supported def means Object
  • 6. 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 }
  • 7. 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. 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'
  • 9. 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'
  • 10. 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.
  • 11. 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 }
  • 12. 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' })
  • 13. 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' )
  • 14. 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' }
  • 15. GRADLE TASKS : CONFIGURATION VS ACTION Use of << {} adds action to be executed Tasks supplied by plugin will have default actions Use of {} configures a task
  • 16. 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 flexible.
  • 17. EXTENSIONS Extensions are global configuration 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' }
  • 18. JAVA PROJECT repositories { jcenter() } apply plugin : 'java' dependencies { testCompile 'junit:junit:4.1+' }
  • 19. GRADLE DEPENDENCY MANAGEMENT Easy to use Flexible to configure for exceptions Uses dependencies closure First word on line is usually name of a configuration. Configurations are usually supplied by plugins. Dependencies are downloaded from repositories Maven coordinates are used as format
  • 20. GRADLE REPOSITORIES Specified 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
  • 22. BUILDING C++ - TOOL SUPPORT Operating System Tool Chain Official Linux gcc, clang Y MacOS X Xcode Y gcc-macports, clang- macports N Windows Visual C++, gcc-cygwin32, gcc-mingw Y
  • 24. BUILDING C++ - LAYOUT Need to change convention from traditional C++ projects .cpp files go in src/${name}/cpp Exported headers files go in src/${name}/headers Local header files should be in src/${name}/cpp Object files will end up in ${buildDir}/objs Binary files will end up in ${buildDir}/binaries
  • 25. BUILDING C++ - BASICS apply plugin : 'cpp'
  • 26. BUILDING C++ - EXECUTABLE model { components { hello(NativeExecutableSpec) } }
  • 27. BUILDING C++ - PROJECT LAYOUT ├── build.gradle └── src └─── hello    ├── cpp │ └─── hello.cpp │    └── headers └─── hello.hpp
  • 28. BUILDING C++ - EXISTING PROJECTS Source directories can be adjusted Alternative compiler locations
  • 29. BUILDING C++ - ALTERNATIVE SOURCE sources { cpp { source { srcDir "myDir" include "**/*.cpp" } } }
  • 30. BUILDING C++ - OTHER FEATURES Cross compilation Multi-architecture targets Set compiler & linker flags Multi-variant builds
  • 31. BUILDING C++ - WEAKNESS Currently only have built-in support for CUnit Only platform configuration tool support is CMake No Autotools equivalent DSL can be slicker
  • 33. BUILDING JRUBY buildscript { repositories { jcenter() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath 'com.github.jruby-gradle:jruby-gradle-plugin:1.1.4' } } import com.github.jrubygradle.JRubyExec
  • 34. BUILDING JRUBY apply plugin: "com.github.jruby-gradle.base" 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)
  • 35. OTHER LANGUAGES C / ASM / Resources (built-in) Clojure (plugin) Frege (plugin) Golang (plugin) Scala (built-in) Gosu (plugin)
  • 36. SUPPORT FOR OTHER BUILDSYSTEMS ANT (built-in) GNU Make MSBuild / xBuild Grunt Anything else craftable via Exec or JavaExec task
  • 40. BUILDING WITH ASCIIDOCTOR plugins { id 'org.asciidoctor.convert' version '1.5.2' }
  • 41. BUILDING WITH ASCIIDOCTOR repositories { jcenter() } asciidoctor { sources { include 'example.adoc' } backends 'html5' }
  • 42. BUILDING WITH DOXYGEN plugins { id "org.ysb33r.doxygen" version "0.2" } doxygen { source file('src/hello/cpp') source file('src/hello/headers') generate_xml true generate_html true file_patterns '*.cpp', '*.hpp' html_colorstyle_sat 100 }
  • 43. 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.
  • 44. PUBLISHING VIA VFS plugins { id "org.ysb33r.vfs" version "1.0-beta3" } task publishToWebserver { vfs { cp "${buildDir}/website", "ftp://${username}:${password}@int.someserver.com/var/www", recursive : true, overwrite : true } }
  • 45. MORE SUPPORT…​ Official buildsystem for Android Docker Hadoop
  • 46. ENDGAME Gradle is breaking new ground Ever improving native support Continuous performance improvements Go find some more plugins at https://plugins.gradle.org
  • 47. 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/AccuLondon
  • 48. THANK YOU Email: Twitter / Ello : @ysb33r ysb33r@gmail.com Keep an eye out for https://leanpub.com/idiomaticgradle
  • 50. ANT TO GRADLE Reflect Ant Build into Gradle ant.importBuild('build.xml')
  • 51. MAVEN TO GRADLE Go to directory where pom.xml is and type gradle init --type pom
  • 52. GNUMAKE TO GRADLE Call current Makefile from Gradle plugins { id "org.ysb33r.gnumake" version "1.0.2" } import org.ysb33r.gradle.gnumake.GnuMakeBuild task runMake (type:GnuMakeBuild) { targets 'build','install' flags DESTDIR : '/copy/files/here', BUILD_NUMBER : '12345' }