Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rock the Gradle, Rule the World
Search
Xavier Gouchet
April 01, 2019
Programming
1
34
Rock the Gradle, Rule the World
Xavier Gouchet
April 01, 2019
Tweet
Share
More Decks by Xavier Gouchet
See All by Xavier Gouchet
Libérez votre créativité
xgouchet
0
61
Unleash your Programming Creativity
xgouchet
0
95
Demystifying the Test Pyramid
xgouchet
1
330
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
58
Property Based Testing in Practice
xgouchet
0
49
Develop your CI tools
xgouchet
2
360
How to write a safe and reliable Open Source Library
xgouchet
1
230
Benchmarking your app's performance
xgouchet
0
170
Benchmarking your app's performance
xgouchet
0
81
Other Decks in Programming
See All in Programming
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
130
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
330
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.4k
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
Identifying User Idenity
moro
6
7.9k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
Piniaの現状と今後
waka292
5
1.5k
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
110
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
425
64k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
GraphQLとの向き合い方2022年版
quramy
43
13k
Docker and Python
trallard
40
3.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Unsuck your backbone
ammeep
668
57k
Transcript
Rock the Gradle Rule the world
About… Lead Android Engineer at WorkWell Fluent in Android since
Cupcake 2
A brief introduction 1
Dependency Management System What is Gradle General Purpose Build management
4
5 General purpose Language agnostic Feature agnostic
6 Dependency management system Knows how to graph and resolve
dependencies ◇ code ◇ tasks ◇ …
7 Build management Based on tasks created by plugins
Configuration Gradle flow Initialisation Execution 8
9 Initialisation Launches the JVM (with proper params) Analyse the
working directory Reads the settings.gradle file Creates the Project object(s) that will be used Compiles, test and add buildSrc to the classpath
10 Configuration Execute all the build.gradle scripts in the project
Create all the Task objects and configure the Project object(s) Resolves the tasks dependencies
11 Execution List the Task to run based on the
invocation (and their dependencies) Execute each of the tasks
Meet the buildSrc folder 2
Project structure ┬ MyProject ├┬ app/ │├── src/ │└── build.gradle
├┬ buildSrc/ │├── src/ │├── build.gradle │└── settings.gradle ├─ build.gradle └─ settings.gradle 13
Purposes… ◇ Better dependency management ◇ Helper classes / methods
◇ Custom tasks in dedicated classes ◇ Custom plugin ■ Locally versionned with the project 14
How does it work? ◇ Works like any module in
your project ◇ Compiled and tested before any gradle task ◇ Groovy, Java, Kotlin, … ◇ Any public class / method becomes availble in gradle scripts 15
“ A change in buildSrc causes the whole project to
become out-of-date. 16
apply plugin: 'groovy' dependencies { compile gradleApi() compile localGroovy() }
17 Default build.gradle
Writin a Plugin 3
Hands On 19
Thanks! Any questions? ◇ https://github.com/xgouchet/RockTheGradle ◇ @xgouchet 20