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
Gradle – Build Happiness (German)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Marc Philipp
January 28, 2019
Programming
240
1
Share
Gradle – Build Happiness (German)
Introduction to the Gradle Build Tool, Build Scans and the Build Cache
Marc Philipp
January 28, 2019
More Decks by Marc Philipp
See All by Marc Philipp
JUnit 6
marcphilipp
1
47
JUnit 6.0
marcphilipp
2
34
Catching up with JUnit
marcphilipp
0
270
Catching up with JUnit 5
marcphilipp
1
160
The JUnit Crew Presents What's New
marcphilipp
2
68
Behind the scenes of JUnit 5 – running an independent open source project by example
marcphilipp
0
100
Running an independent open source project by example
marcphilipp
1
80
Automatisierte Tests mit Machine Learning und verteilter Ausführung beschleunigen
marcphilipp
1
260
Meet the JUnit Team in Person!
marcphilipp
1
180
Other Decks in Programming
See All in Programming
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
340
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.4k
Kingdom of the Machine
yui_knk
2
250
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
1
120
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
770
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
230
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.5k
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
310
Angular Signal Forms
debug_mode
0
110
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
130
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
110
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
The agentic SEO stack - context over prompts
schlessera
0
740
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
510
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Docker and Python
trallard
47
3.8k
Ruling the World: When Life Gets Gamed
codingconduct
0
210
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
270
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
170
Transcript
GRADLE – BUILD HAPPINESS MARC PHILIPP, GRADLE INC.
MARC PHILIPP So ware Engineer bei Gradle, Inc. JUnit Maintainer
seit 2012 Twi er: Web: @marcphilipp marcphilipp.de
✋ SHOW OF HANDS
WAS IST GRADLE?
WAS IST GRADLE? Basiert auf der Java Virtual Machine (JVM)
Implemen ert in Java 100% Open Source (Apache 2.0) und kostenlos Gradle ist ein Build‑ und Automa sierungswerkzeug.
VIELSEITIG EINSETZBAR Java‑Ökosystem: Java, Groovy, Kotlin, Scala, … Na ve
Projekte: C, C++, Swi , … Android Sons ges: Go, Asciidoctor, …
GRADLE IN ZAHLEN Mehr als 7M Downloads/Monat OSS‑Projekt #17 weltweit
35+ Gradle Engineers 300K Builds/Woche @ LinkedIn
GRADLE INC. Vision: Build Happiness Mission: Accelerate Developer Produc vity
Produkte: Build Scans and Enterprise Build Cache [Consul ng, Support, Development Services etc.] [Training: online, öffentlich und in‑house]
AGENDA Kurze Einführung in Gradle Gradle Plugins Inkrementelle Builds Build
Scans Build Cache
KURZE EINFÜHRUNG IN GRADLE
HELLO WORLD tasks.register("helloWorld") { // in build.gradle doLast { println("Hello
World!") } } $ gradle helloWorld > Task :helloWorld Hello World! BUILD SUCCESSFUL in 0s 1 actionable task: 1 executed
TASKS Ein Gradle‑Build führt einen/mehrere Tasks aus. Tasks können von
anderen Tasks abhängen. Tasks haben Inputs und Outputs.
BUILDSCRIPTS Ein Gradle‑Projekt wird mi els Buildscripts konfiguriert: settings.gradle[.kts] :
Konfiguriert, welche Subprojekte Teile des Builds sind. build.gradle[.kts] : Konfiguriert Plugins und Tasks, die im Build verwendet werden.
GRADLE WRAPPER ./gradlew <tasks> sta gradle <tasks> Ermöglicht Ausführung des
Builds ohne vorherige Installa on von Gradle: Lädt ggfs. die benö gte Version herunter. Entwickler und Build‑Server verwenden immer diesselbe Version.
DATEISTRUKTUR $ gradle init --dsl=kotlin --type=java-application \ --test-framework=junit --package=com.example \
--project-name=new-project BUILD SUCCESSFUL in 0s 2 actionable tasks: 2 executed ├── build.gradle.kts // Buildscript ├── gradle/wrapper // Wrapper JAR und Konfiguration ├── gradlew // Wrapper script für Linux/macOS ├── gradlew.bat // Wrapper script für Windows ├── settings.gradle.kts // Settings └── src // Java source tree ├── main │ ├── java │ └── resources └── test ├── java └── resources
SETTINGS.GRADLE.KTS rootProject.name = "new-project"
BUILD.GRADLE.KTS plugins { java // zum Kompilieren von Java-Quellcode application
// zum Generieren von Startup-Scripts } repositories { jcenter() // zum Auffinden von Dependencies } dependencies { implementation("com.google.guava:guava:26.0-jre") testImplementation("junit:junit:4.12") } application { // Extension des 'application'-Plugins mainClassName = "com.example.App" }
GROOVY VS. KOTLIN DSL Buildscript verwenden eine Domain‑Specific‑ Language (DSL).
Ursprünglich wurde dazu Groovy verwendet. Groovy: Dynamisch typisiert, IDE‑Support schwierig Seit Gradle 5.0 gibt es eine stabile DSL in Kotlin.
GRADLE PLUGINS
PLUGINS Definieren Tasks, z.B. compileJava Stellen Möglichkeiten zur Konfigura on
bereit, z.B. die application ‑Extension Wenden andere Plugins an plugins { java // zum Kompilieren von Java-Quellcode application // zum Generieren von Startup-Scripts }
EIGENE PLUGINS Ziel: Vereinheitlichung der Build‑Logik über Projekt‑ Grenzen hinweg
plugins { id("com.example.myplugin") version "1.0" } public class MyPlugin implements Plugin<Project> { @Override public void apply(Project project) { project.getPluginManager().apply(JavaPlugin.class); project.getTasks().register("myTask", task -> ...); // ... } }
PLUGIN PORTAL Über 3000 Community‑Plugins
INKREMENTELLE BUILDS
INKREMENTELLE BUILDS Führe nur Tasks aus, die von Änderungen zwischen
zwei Builds betroffen sind. Behalte die Ergebnisdateien aller Tasks die up‑to‑ date sind.
ERSTER BUILD $ ./gradlew --console=plain build > Task :compileJava >
Task :processResources NO-SOURCE > Task :classes > Task :jar [...] > Task :compileTestJava > Task :testClasses > Task :test > Task :check > Task :build BUILD SUCCESSFUL in 5s 7 actionable tasks: 7 executed
INKREMENTELLER BUILD $ ./gradlew --console=plain build > Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE > Task :classes UP-TO-DATE > Task :jar UP-TO-DATE [...] > Task :compileTestJava UP-TO-DATE > Task :testClasses UP-TO-DATE > Task :test UP-TO-DATE > Task :check UP-TO-DATE > Task :build UP-TO-DATE BUILD SUCCESSFUL in 0s 7 actionable tasks: 7 up-to-date
WENN WIR ZEIT HÄTTEN… Compile avoidance & incremental compiler Gradle
Daemon Con nuous Builds Composite Builds Tooling API / IDE integra on Worker API
BUILD SCANS
BUILD SCAN: AKTIVIERUNG › $ ./gradlew build --scan BUILD SUCCESSFUL
in 1s 7 actionable tasks: 5 executed, 2 up-to-date Publishing build scan... https://gradle.com/s/lu7dxy7quyoju h ps:/ /gradle.com/s/lu7dxy7quyoju
BUILD SCAN: TIMELINE
BUILD SCAN: DEPENDENCIES
BUILD SCANS (KOSTENLOS) Beschleunigen die Lösung von Build‑Problemen Einfach mit
Kollegen teilbarer Link Kostenlose Nutzung auf scans.gradle.com
ENTERPRISE BUILD SCANS Gradle Enterprise bietet zusätzliche Features: Hos ng
auf eigenem Server Vergleich zweier Build Scans Entwicklung von Build‑Metriken über die Zeit
BUILDS ÜBER DIE ZEIT
VERGLEICH ZWEIER BUILDS
BUILD CACHE
MORGENS HALB 10 IN DEUTSCHLAND… Give every developer back one
hour a day! $ git pull [...] 185 files changed, 4320 insertions(+), 1755 deletions(-) $ ./gradlew --build-cache sanityCheck BUILD SUCCESSFUL in 1m 11s 1338 actionable tasks: 238 executed, 1100 from cache
BUILD CACHE Verwende Ergebnisse aller vorherigen Builds
INPUTS → TASK → OUTPUTS Berechne cacheKey eines Tasks aus
dessen Inputs: cacheKey(javaCompile) = hash(sourceFiles, …) Verwende Ergebnisdateien als cacheEntry: cacheEntry(javaCompile) = fileTree(classFiles)
REMOTE BUILD CACHE
LOKAL UND REMOTE CI‑Server speichern Task‑Ergebnisse im Remote Build Cache
Lokale Builds verwenden Ergebnisse aus dem Remote Build Cache Ergebnisse werden für zukün ige Builds im lokalen Build Cache gespeichert
GRADLE ENTERPRISE
NEU: JETZT AUCH FÜR APACHE MAVEN™ › 0:00 / 0:34
h ps:/ /gradle.com/blog/maven/
GRADLE ENTERPRISE KUNDEN › gradle.com
Q & A