Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Paris Kotlin Meetup de mai: Gradle 💙 Kotlin

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

More Decks by mbonnin

Other Decks in Technology

Transcript

  1. Kotlin DSL Tout ce que vous avez toujours voulu savoir

    sur le Gradle Kotlin DSL sans jamais le oser le demander.
  2. 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' } } }
  3. Kotlin DSL = Kotlin build scripts + generated accessors +

    sam-with-receiver + assignment operator + gradleKotlinDSL() + apiVersion + -Xsam-conversions=class
  4. 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