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
55
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
76
Building libraries for the next 25 years
martinbonnin
1
38
Gratatouille: metaprogramming for your build-logic
martinbonnin
1
98
GraphQL 💙 Kotlin, 2024 edition
martinbonnin
0
48
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
230
Everything you didn't want to know about the Kotlin DSL
martinbonnin
3
620
Other Decks in Technology
See All in Technology
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
生成AIのガバナンスの全体像と現実解
fnifni
1
180
MLOps の現場から
asei
6
640
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
120
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
Mobile First: as difficult as doing things right
swwweet
222
9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Being A Developer After 40
akosma
87
590k
Building an army of robots
kneath
302
44k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Site-Speed That Sticks
csswizardry
2
190
Large-scale JavaScript Application Architecture
addyosmani
510
110k
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