Skip to content

Commit b69d0bd

Browse files
authored
Merge pull request #13 from dwursteisen/main
Bump dependencies
2 parents c0b9119 + eda84ab commit b69d0bd

File tree

9 files changed

+113
-71
lines changed

9 files changed

+113
-71
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
test:
2+
./gradlew test functionalTest
3+
14
deploy:
25
./gradlew publishToMavenLocal

developer-plugin/build.gradle.kts

Lines changed: 35 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
import org.gradle.jvm.toolchain.JvmVendorSpec.ADOPTOPENJDK
2-
3-
/*
4-
* This file was generated by the Gradle 'init' task.
5-
*
6-
* This generated file contains a sample Gradle plugin project to get you started.
7-
* For more details take a look at the Writing Custom Plugins chapter in the Gradle
8-
* User Manual available at https://docs.gradle.org/6.8.2/userguide/custom_plugins.html
9-
*/
10-
1+
@Suppress("DSL_SCOPE_VIOLATION")
112
plugins {
12-
// Plugin publication plugin.
13-
id("com.gradle.plugin-publish") version "0.13.0"
14-
3+
alias(libs.plugins.gradle.publish)
154
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
165
`java-gradle-plugin`
176

187
`maven-publish`
198

20-
// Apply the Kotlin JVM plugin to add support for Kotlin.
21-
id("org.jetbrains.kotlin.jvm") version "1.4.20"
9+
alias(libs.plugins.kotlin.jvm)
2210
}
2311

2412
group = "com.github.minigdx"
@@ -33,76 +21,63 @@ repositories {
3321

3422
dependencies {
3523
// Align versions of all Kotlin components
36-
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
24+
implementation(platform(libs.kotlin.bom))
3725

3826
// Use the Kotlin JDK 8 standard library.
39-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
27+
implementation(libs.kotlin.stdlib)
4028

41-
implementation("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.4.20")
42-
implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:9.4.1")
43-
implementation("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.4.30")
44-
?.because("The 1.4.20 required Java 11 because of an issue with a dependency which faultly require Java 11.")
29+
implementation(libs.kotlin.plugin.mpp)
30+
implementation(libs.kotlin.plugin.dokka)
31+
implementation(libs.ktlint.plugin)
4532

46-
implementation(platform("me.champeau.jdoctor:jdoctor-bom:0.1"))
47-
implementation("me.champeau.jdoctor:jdoctor-core")
48-
implementation("me.champeau.jdoctor:jdoctor-utils:0.1")
33+
implementation(platform(libs.jdoctor.bom))
34+
implementation(libs.jdoctor.core)
35+
implementation(libs.jdoctor.utils)
4936

5037
// Use the Kotlin test library.
51-
testImplementation("org.jetbrains.kotlin:kotlin-test")
52-
53-
// Use the Kotlin JUnit integration.
54-
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
38+
testImplementation(libs.bundles.test)
5539
}
5640

5741
gradlePlugin {
5842
// Define the plugin
5943
val developer by plugins.creating {
6044
id = "com.github.minigdx.gradle.plugin.developer"
6145
implementationClass = "com.github.minigdx.gradle.plugin.MiniGdxDeveloperPlugin"
46+
displayName = "MiniGDX Developer plugin"
47+
description = """Configure MiniGDX libs with a common set of configuration and tasks.
48+
| The usage is mainly for MiniGDX contributors.
49+
""".trimMargin()
6250
}
6351

6452
val mpp by plugins.creating {
6553
id = "com.github.minigdx.gradle.plugin.developer.mpp"
6654
implementationClass = "com.github.minigdx.gradle.plugin.MiniGdxKotlinMppPlugin"
55+
displayName = "MiniGDX Kotlin JVM Developer plugin"
56+
description = """Configure MiniGDX libs to build for the JVM only.
57+
| The usage is mainly for MiniGDX contributors.
58+
""".trimMargin()
6759
}
6860

6961
val jvm by plugins.creating {
7062
id = "com.github.minigdx.gradle.plugin.developer.jvm"
7163
implementationClass = "com.github.minigdx.gradle.plugin.MiniGdxKotlinJvmPlugin"
64+
displayName = "MiniGDX Kotlin Multiplatform Developer plugin"
65+
description = """Configure MiniGDX libs to build for different platforms.
66+
| The usage is mainly for MiniGDX contributors.
67+
""".trimMargin()
7268
}
7369
}
7470

7571
pluginBundle {
7672
website = "https://github.com/minigdx/minigdx-developer-gradle-plugin"
7773
vcsUrl = "https://github.com/minigdx/minigdx-developer-gradle-plugin"
7874

79-
(plugins) {
80-
// first plugin
81-
"developer" {
82-
// id is captured from java-gradle-plugin configuration
83-
displayName = "MiniGDX Developer plugin"
84-
description = """Configure MiniGDX libs with a common set of configuration and tasks.
85-
| The usage is mainly for MiniGDX contributors.
86-
""".trimMargin()
87-
tags = listOf("minigdx", "developer")
88-
}
75+
tags = listOf("minigdx", "developer")
8976

90-
"jvm" {
91-
displayName = "MiniGDX Kotlin JVM Developer plugin"
92-
description = """Configure MiniGDX libs to build for the JVM only.
93-
| The usage is mainly for MiniGDX contributors.
94-
""".trimMargin()
95-
tags = listOf("minigdx", "developer", "kotlin", "jvm")
96-
}
97-
98-
"mpp" {
99-
displayName = "MiniGDX Kotlin Multiplatform Developer plugin"
100-
description = """Configure MiniGDX libs to build for different platforms.
101-
| The usage is mainly for MiniGDX contributors.
102-
""".trimMargin()
103-
tags = listOf("minigdx", "developer", "kotlin", "jvm", "mpp", "ios", "js", "android", "native")
104-
}
105-
}
77+
pluginTags = mapOf(
78+
"jvm" to listOf("kotlin", "jvm"),
79+
"mpp" to listOf("kotlin", "jvm", "mpp", "ios", "js", "android", "native")
80+
)
10681
}
10782

10883
val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks
@@ -135,6 +110,11 @@ tasks.withType<JavaCompile> {
135110
java {
136111
toolchain {
137112
languageVersion.set(JavaLanguageVersion.of(11))
138-
vendor.set(ADOPTOPENJDK)
113+
}
114+
}
115+
116+
kotlin {
117+
jvmToolchain {
118+
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(11))
139119
}
140120
}

developer-plugin/src/main/kotlin/com/github/minigdx/gradle/plugin/MiniGdxDeveloperPlugin.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
137137
it.includeVersionByRegex("com.github.minigdx.(.*)", "(.*)", "LATEST-SNAPSHOT")
138138
}
139139
project.repositories.mavenLocal()
140-
// Will be deprecated soon... Required for dokka
141-
project.repositories.jcenter()
142140
}
143141

144142
private fun configureLinter(project: Project) {

developer-plugin/src/main/kotlin/com/github/minigdx/gradle/plugin/MiniGdxKotlinJvmPlugin.kt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.github.minigdx.gradle.plugin
22

3+
import com.github.minigdx.gradle.plugin.internal.Constants.JAVA_VERSION
34
import org.gradle.api.Plugin
45
import org.gradle.api.Project
56
import org.gradle.api.publish.PublishingExtension
67
import org.gradle.api.publish.maven.MavenPublication
78
import org.gradle.api.tasks.compile.JavaCompile
9+
import org.gradle.jvm.toolchain.JavaLanguageVersion
10+
import org.gradle.jvm.toolchain.JavaToolchainService
811
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
912
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
13+
import org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain
1014

1115
/**
1216
* Configure projects using only Kotlin for the JVM
@@ -23,9 +27,13 @@ class MiniGdxKotlinJvmPlugin : Plugin<Project> {
2327
private fun configureJava(project: Project) {
2428
// Ensure "org.gradle.jvm.version" is set to "8" in Gradle metadata.
2529
project.afterEvaluate {
30+
val toolchainService = project.extensions.getByType(JavaToolchainService::class.java)
2631
project.tasks.withType(JavaCompile::class.java) {
2732
it.sourceCompatibility = "1.8"
2833
it.targetCompatibility = "1.8"
34+
val javaCompiler = toolchainService.compilerFor {
35+
it.languageVersion.set(JavaLanguageVersion.of(JAVA_VERSION)) }
36+
it.javaCompiler.set(javaCompiler)
2937
}
3038
}
3139
}
@@ -54,6 +62,14 @@ class MiniGdxKotlinJvmPlugin : Plugin<Project> {
5462
}
5563

5664
project.tasks.withType(KotlinCompile::class.java).forEach {
65+
it as UsesKotlinJavaToolchain
66+
val toolchainService = project.extensions.getByType(JavaToolchainService::class.java)
67+
it.kotlinJavaToolchain.toolchain.use(
68+
toolchainService.launcherFor {
69+
it.languageVersion.set(JavaLanguageVersion.of(JAVA_VERSION))
70+
}
71+
)
72+
5773
it.kotlinOptions {
5874
this as KotlinJvmOptions
5975
this.jvmTarget = "1.8"
@@ -66,8 +82,8 @@ class MiniGdxKotlinJvmPlugin : Plugin<Project> {
6682

6783
private val COMPILATION_FLAGS = listOf(
6884
"-Xjsr305=strict",
69-
"-Xopt-in=kotlin.ExperimentalStdlibApi",
70-
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
85+
"-opt-in=kotlin.ExperimentalStdlibApi",
86+
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
7187
)
7288
}
7389
}

developer-plugin/src/main/kotlin/com/github/minigdx/gradle/plugin/MiniGdxKotlinMppPlugin.kt

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package com.github.minigdx.gradle.plugin
22

3+
import com.github.minigdx.gradle.plugin.internal.Constants.JAVA_VERSION
34
import org.gradle.api.Plugin
45
import org.gradle.api.Project
56
import org.gradle.api.tasks.compile.JavaCompile
7+
import org.gradle.jvm.toolchain.JavaLanguageVersion
8+
import org.gradle.jvm.toolchain.JavaToolchainService
69
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
710
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
11+
import org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain
812

913
/**
1014
* Configure project with Kotlin multiplatform
@@ -36,7 +40,7 @@ class MiniGdxKotlinMppPlugin : Plugin<Project> {
3640
this.binaries.executable()
3741
this.compilations.all {
3842
it.kotlinOptions {
39-
freeCompilerArgs += COMPILATION_FLAGS
43+
freeCompilerArgs = freeCompilerArgs + COMPILATION_FLAGS
4044
}
4145
}
4246
this.browser {
@@ -52,11 +56,11 @@ class MiniGdxKotlinMppPlugin : Plugin<Project> {
5256
mpp.jvm {
5357
this.compilations.getByName("main").kotlinOptions.apply {
5458
jvmTarget = "1.8"
55-
freeCompilerArgs += COMPILATION_FLAGS
59+
freeCompilerArgs = freeCompilerArgs + COMPILATION_FLAGS
5660
}
5761
this.compilations.getByName("test").kotlinOptions.apply {
5862
jvmTarget = "1.8"
59-
freeCompilerArgs += COMPILATION_FLAGS
63+
freeCompilerArgs = freeCompilerArgs + COMPILATION_FLAGS
6064
}
6165
}
6266

@@ -115,7 +119,6 @@ class MiniGdxKotlinMppPlugin : Plugin<Project> {
115119

116120
getByName("iosTest") {
117121

118-
119122
}
120123
}
121124

@@ -135,32 +138,42 @@ class MiniGdxKotlinMppPlugin : Plugin<Project> {
135138
}
136139
mpp.sourceSets.all {
137140
it.languageSettings.apply {
138-
this.useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
139-
this.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
141+
this.optIn("kotlin.ExperimentalStdlibApi")
142+
this.optIn("kotlinx.serialization.ExperimentalSerializationApi")
140143
}
141144
}
142145
}
143146

144147
project.afterEvaluate {
148+
val toolchainService = project.extensions.getByType(JavaToolchainService::class.java)
145149
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).all {
150+
it as UsesKotlinJavaToolchain
151+
it.kotlinJavaToolchain.toolchain.use(
152+
toolchainService.launcherFor {
153+
it.languageVersion.set(JavaLanguageVersion.of(JAVA_VERSION))
154+
}
155+
)
146156
it.kotlinOptions {
147157
jvmTarget = "1.8"
148-
freeCompilerArgs += COMPILATION_FLAGS
158+
freeCompilerArgs = freeCompilerArgs + COMPILATION_FLAGS
149159
}
150160
}
151161

152162
project.tasks.withType(JavaCompile::class.java) {
153163
it.sourceCompatibility = "1.8"
154164
it.targetCompatibility = "1.8"
165+
val javaCompiler = toolchainService.compilerFor {
166+
it.languageVersion.set(JavaLanguageVersion.of(JAVA_VERSION)) }
167+
it.javaCompiler.set(javaCompiler)
155168
}
156169
}
157170
}
158171

159172
companion object {
160173

161174
private val COMPILATION_FLAGS = listOf(
162-
"-Xopt-in=kotlin.ExperimentalStdlibApi",
163-
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
175+
"-opt-in=kotlin.ExperimentalStdlibApi",
176+
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
164177
)
165178
}
166179
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.github.minigdx.gradle.plugin.internal
2+
3+
object Constants {
4+
const val JAVA_VERSION = 11
5+
}

developer-plugin/src/main/kotlin/com/github/minigdx/gradle/plugin/internal/MiniGdxProblem.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ class MiniGdxProblem(
1515
reason: Supplier<String>,
1616
docUrl: Supplier<String?>,
1717
solutions: List<Supplier<JSolution>>
18-
) : BaseProblem<MiniGdxProblem.ProblemId, Severity, Context, MiniGdxProblem.Payload>(
18+
) : BaseProblem<MiniGdxProblem.ProblemId, Severity, Context>(
1919
ProblemId.PROBLEM,
2020
severity,
2121
context,
22-
Payload(),
2322
shortDescription,
2423
Supplier { -> null },
2524
reason,

gradle/libs.versions.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[versions]
2+
kotlin = "1.6.21"
3+
ktlint = "11.0.0"
4+
jdoctor = "0.1.2"
5+
gradlePublish = "1.0.0"
6+
7+
[libraries]
8+
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom" }
9+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" }
10+
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit" }
11+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
12+
kotlin-plugin-mpp = { module = "org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin", version.ref = "kotlin" }
13+
kotlin-plugin-dokka = { module = "org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin", version.ref = "kotlin" }
14+
15+
ktlint-plugin = { module = "org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin", version.ref = "ktlint" }
16+
17+
jdoctor-bom = {module = "me.champeau.jdoctor:jdoctor-bom", version.ref = "jdoctor" }
18+
jdoctor-core = {module = "me.champeau.jdoctor:jdoctor-core" }
19+
jdoctor-utils = {module = "me.champeau.jdoctor:jdoctor-utils", version.ref = "jdoctor" }
20+
21+
22+
[bundles]
23+
test = ["kotlin-test", "kotlin-test-junit"]
24+
25+
[plugins]
26+
gradle-publish = { id = "com.gradle.plugin-publish", version.ref = "gradlePublish" }
27+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
4+
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)