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
Paris Kotlin Meetup de mai: Gradle 💙 Kotlin
Search
mbonnin
May 11, 2023
Technology
3
68
Paris Kotlin Meetup de mai: Gradle 💙 Kotlin
Tout ce que vous voulez savoir (ou pas) sur le Gradle Kotlin DSL (ou build scripts!)
mbonnin
May 11, 2023
Tweet
Share
More Decks by mbonnin
See All by mbonnin
Metadataquoi??
martinbonnin
0
110
Harmonizing APIs, a comparison of GraphQL and OpenAPI through the Spotify API
martinbonnin
1
46
Construisez votre bibliothèque Java/Kotlin
martinbonnin
2
89
Building libraries for the next 25 years
martinbonnin
2
59
Gratatouille: metaprogramming for your build-logic
martinbonnin
2
150
GraphQL 💙 Kotlin, 2024 edition
martinbonnin
1
69
GraphQL_nullability__state_of_the_union.pdf
martinbonnin
1
33
Offline and Reactive apps with Apollo Kotlin
martinbonnin
1
57
What's new in Apollo Kotlin 3
martinbonnin
2
210
Other Decks in Technology
See All in Technology
Introduction to Bill One Development Engineer
sansan33
PRO
0
300
初めてのDatabricks Apps開発
taka_aki
1
220
事業開発におけるDify活用事例
kentarofujii
4
1.1k
速習AGENTS.md:5分で精度を上げる "3ブロック" テンプレ
ismk
6
1.9k
「魔法少女まどか☆マギカ Magia Exedra」の多様なバトルの開発を柔軟かつ効率的に実現するためのPure C#とUnityの分離について
gree_tech
PRO
0
150
Node.js 2025: What's new and what's next
ruyadorno
0
700
Zephyr(RTOS)にEdge AIを組み込んでみた話
iotengineer22
0
220
エンタメとAIのための3Dパラレルワールド構築(GPU UNITE 2025 特別講演)
pfn
PRO
0
600
Biz職でもDifyでできる! 「触らないAIワークフロー」を実現する方法
igarashikana
3
1.2k
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
1.1k
難しいセキュリティ用語をわかりやすくしてみた
yuta3110
0
340
Performance Insights 廃止から Database Insights 利用へ/transition-from-performance-insights-to-database-insights
emiki
0
340
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
630
Building Adaptive Systems
keathley
44
2.8k
Navigating Team Friction
lara
190
15k
Rails Girls Zürich Keynote
gr2m
95
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
RailsConf 2023
tenderlove
30
1.3k
Balancing Empowerment & Direction
lara
5
700
Producing Creativity
orderedlist
PRO
347
40k
Gamification - CAS2011
davidbonilla
81
5.5k
Fireside Chat
paigeccino
40
3.7k
How to Ace a Technical Interview
jacobian
280
24k
Become a Pro
speakerdeck
PRO
29
5.6k
Transcript
Bienvenue 🤗
Kotlin DSL Tout ce que vous avez toujours voulu savoir
sur le Gradle Kotlin DSL sans jamais le oser le demander.
@MartinBonnin apollographql/apollo-kotlin
Gradle
Google
Jetbrains
Changes • gradle init • Android Studio/IntelliJ templates • API
docs • Documentation!
plugins { id 'org.jetbrains.kotlin.jvm' version '1.5.31' } dependencies { implementation(’com.squareup.okio:okio:3.0.0’)
} kotlin { explicitApi() } tasks { compileKotlin { kotlinOptions { apiVersion = '1.3' } } }
plugins { id("org.jetbrains.kotlin.jvm").version("1.5.31") } dependencies { implementation("com.squareup.okio:okio:3.0.0") } kotlin {
explicitApi() } tasks { compileKotlin { kotlinOptions { apiVersion = "1.3" } } }
It’s good?
It’s (mostly) good! • Autocomplete • Only one language
None
Kotlin DSL (Gradle Kotlin) != Kotlin build scripts (Jetbrains Kotlin)
Kotlin DSL = Kotlin build scripts + generated accessors +
sam-with-receiver + assignment operator + gradleKotlinDSL() + apiVersion + -Xsam-conversions=class
Demo
Wrap up
None
None
None
https://github.com/gradle/gradle/issues/15886#issuecomment-954833377
Pour aller plus loin https://www.youtube.com/watch?v=oavqsLKRuDU
Merci! @MartinBonnin
Resources • https://android-developers.googleblog.com/2023/04/kotlin-dsl-is-now-default-for-new-gradle-builds.html • https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds • https://blog.jetbrains.com/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/ • https://docs.gradle.org/current/userguide/kotlin_dsl.html •
https://github.com/gradle/gradle/pull/24286 • https://gradle.github.io/kotlin-dsl-docs/api/ • https://storage.googleapis.com/martin-public/userguide/writing_in_kotlin.html • https://github.com/gradle/gradle/blob/master/subprojects/kotlin-dsl-provider-plugins/src/main/kotlin/org/gradle/k otlin/dsl/provider/plugins/DefaultProjectSchemaProvider.kt • https://www.youtube.com/watch?v=oavqsLKRuDU