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
2
52
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
Construisez votre bibliothèque Java/Kotlin
martinbonnin
1
75
Building libraries for the next 25 years
martinbonnin
1
37
Gratatouille: metaprogramming for your build-logic
martinbonnin
1
89
GraphQL 💙 Kotlin, 2024 edition
martinbonnin
0
44
GraphQL_nullability__state_of_the_union.pdf
martinbonnin
0
20
Offline and Reactive apps with Apollo Kotlin
martinbonnin
0
42
What's new in Apollo Kotlin 3
martinbonnin
1
170
Offline and Reactive apps with Apollo Kotlin
martinbonnin
2
220
Everything you didn't want to know about the Kotlin DSL
martinbonnin
3
610
Other Decks in Technology
See All in Technology
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
The Rise of LLMOps
asei
7
1.4k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
200
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
強いチームと開発生産性
onk
PRO
34
11k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Fireside Chat
paigeccino
34
3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Visualization
eitanlees
145
15k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Faster Mobile Websites
deanohume
305
30k
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