Skip to content

Commit

Permalink
build: manage Kotlin plugins in the catalog (#10610)
Browse files Browse the repository at this point in the history
With the build plugin 6.7.0 we can add managed plugins to the catalog, and these can be used in downstream modules.

This means we can stop defining the version of Kotlin in most modules, and fight to keep them all updated, and instead use:

```
alias(mn.plugins.kotlin.jvm)
```

or

```
alias(mn.plugins.ksp)
```
  • Loading branch information
timyates authored Mar 14, 2024
1 parent 850567b commit 2c3ceb1
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion aop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "io.micronaut.build.internal.convention-core-library"
id "org.jetbrains.kotlin.jvm"
alias libs.plugins.managed.kotlin.jvm
}

micronautBuild {
Expand Down
6 changes: 0 additions & 6 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ dependencies {
implementation "org.tomlj:tomlj:1.1.1"
implementation "me.champeau.gradle:japicmp-gradle-plugin:0.4.2"
implementation "org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin:0.10.0"

// Kotlin plugins
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.managed.kotlin.asProvider().get()}"
implementation "org.jetbrains.kotlin:kotlin-allopen:${libs.versions.managed.kotlin.asProvider().get()}"
implementation "org.jetbrains.kotlin:kotlin-noarg:${libs.versions.managed.kotlin.asProvider().get()}"
implementation "com.google.devtools.ksp:symbol-processing-gradle-plugin:${libs.versions.managed.ksp.get()}"
}
4 changes: 2 additions & 2 deletions context-propagation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.kapt"
alias libs.plugins.managed.kotlin.jvm
alias libs.plugins.managed.kotlin.kapt
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion core-reactive/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id "org.jetbrains.kotlin.jvm"
alias libs.plugins.managed.kotlin.jvm
}

dependencies {
Expand Down
7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,10 @@ wiremock = { module = "com.github.tomakehurst:wiremock-jre8", version.ref = "wir

[bundles]
asm = ["asm", "asm-commons"]

[plugins]
managed-kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "managed-kotlin" }
managed-kotlin-noarg = { id = "org.jetbrains.kotlin.plugin.noarg", version.ref = "managed-kotlin" }
managed-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "managed-kotlin" }
managed-kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "managed-kotlin" }
managed-ksp = { id = "com.google.devtools.ksp", version.ref = "managed-ksp" }
2 changes: 1 addition & 1 deletion http/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id "org.jetbrains.kotlin.jvm"
alias libs.plugins.managed.kotlin.jvm
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion inject-kotlin-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id "org.jetbrains.kotlin.jvm"
alias libs.plugins.managed.kotlin.jvm
}

dependencies {
Expand Down
5 changes: 2 additions & 3 deletions inject-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id "org.jetbrains.kotlin.jvm"
id "com.google.devtools.ksp"

alias libs.plugins.managed.kotlin.jvm
alias libs.plugins.managed.ksp
}

micronautBuild {
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ pluginManagement {
}

plugins {
id 'io.micronaut.build.shared.settings' version '6.6.2'
id 'io.micronaut.build.shared.settings' version '6.7.0'
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")


rootProject.name = 'micronaut'

include "aop"
Expand Down
4 changes: 2 additions & 2 deletions test-suite-kotlin-ksp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "io.micronaut.build.internal.convention-test-library"
id "org.jetbrains.kotlin.jvm"
id("com.google.devtools.ksp")
alias libs.plugins.managed.kotlin.jvm
alias libs.plugins.managed.ksp
}

micronautBuild {
Expand Down
4 changes: 2 additions & 2 deletions test-suite-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "io.micronaut.build.internal.convention-test-library"
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.kapt"
alias libs.plugins.managed.kotlin.jvm
alias libs.plugins.managed.kotlin.kapt
}

micronautBuild {
Expand Down

0 comments on commit 2c3ceb1

Please sign in to comment.