Skip to content

Commit 6ee9296

Browse files
authored
Update to JUnit 5.13 RC1 & Kotlin 2.x (#374)
* Update to JUnit 5.13 and Kotlin 2.x * Bump minimum supported AGP/Gradle version to 8.2 * Update instrumentation to use Compose Compiler This is required from Kotlin 2.x * Update Kotlinx Binary Compatibility Validator plugin
1 parent bff31b0 commit 6ee9296

File tree

13 files changed

+34
-27
lines changed

13 files changed

+34
-27
lines changed

README.md.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ before filing an issue with the latest one.
280280

281281
|Your AGP Version|Suggested JUnit5 Plugin Version|
282282
|---|---|
283-
|`>= 8.0.0`|`${pluginVersion}`|
283+
|`>= 8.2.0`|`${pluginVersion}`|
284+
|`8.0.0` - `8.1.4`|`1.12.2.0`|
284285
|`7.0.0` - `7.4.2`|`1.10.0.0`|
285286
|`4.0.0` - `4.2.2`|`1.8.2.1`|
286287
|`3.5.0` - `3.6.4`|`1.7.1.1`|

build-logic/src/main/kotlin/Dependencies.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22

33
object libs {
44
object versions {
5-
const val kotlin = "1.9.25" // Can only once minimum supported AGP is >= 8.2
6-
const val junitJupiter = "5.12.2"
7-
const val junitVintage = "5.12.2"
8-
const val junitPlatform = "1.12.2"
5+
const val kotlin = "2.1.21"
6+
const val junitJupiter = "5.13.0-RC1"
7+
const val junitVintage = "5.13.0-RC1"
8+
const val junitPlatform = "1.13.0-RC1"
99

1010
const val composeBom = "2025.03.00"
1111
const val androidXMultidex = "2.0.1"
1212
const val androidXTestAnnotation = "1.0.1"
1313
const val androidXTestCore = "1.6.1"
1414
const val androidXTestMonitor = "1.7.2"
1515
const val androidXTestRunner = "1.6.2"
16-
const val composeCompiler = "1.5.15"
1716

1817
const val activityCompose = "1.10.1"
1918
const val apiGuardian = "1.1.2"
20-
const val coroutines = "1.8.1" // Can only update once minimum supported AGP is >= 8.2
19+
const val coroutines = "1.10.2"
2120
const val dokka = "2.0.0"
2221
const val espresso = "3.6.1"
2322
const val javaSemver = "0.10.2"
2423
const val junit4 = "4.13.2"
2524
const val konfToml = "1.1.2"
25+
const val kotlinxBinaryCompatibilityValidator = "0.17.0"
26+
const val nexusPublish = "2.0.0"
2627
const val korte = "2.4.12"
2728
const val mockitoCore = "5.16.0"
2829
const val mockitoKotlin = "5.4.0"
@@ -33,6 +34,7 @@ object libs {
3334

3435
object plugins {
3536
fun android(version: SupportedAgp) = "com.android.tools.build:gradle:${version.version}"
37+
const val composeCompiler = "org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${versions.kotlin}"
3638
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin}"
3739
const val shadow = "com.github.johnrengelman:shadow:${libs.versions.shadow}"
3840
const val dokka = "org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.dokka}"

build-logic/src/main/kotlin/Environment.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ enum class SupportedAgp(
99
val gradle: String,
1010
val compileSdk: Int? = null
1111
) {
12-
AGP_8_0("8.0.2", gradle = "8.0", compileSdk = 33),
13-
AGP_8_1("8.1.4", gradle = "8.0"),
1412
AGP_8_2("8.2.2", gradle = "8.2"),
1513
AGP_8_3("8.3.2", gradle = "8.4"),
1614
AGP_8_4("8.4.2", gradle = "8.6"),

build-logic/src/main/kotlin/Tasks.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import java.io.File
1717
import java.time.ZonedDateTime
1818
import java.util.*
1919

20-
private const val minimumGradleVersion = "8.0"
20+
private const val minimumGradleVersion = "8.2"
2121

2222
@Suppress("DEPRECATION")
2323
fun Project.configureTestResources() {

instrumentation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Log
44
## Unreleased
55

66
- Compile with SDK 35
7+
- Update to Kotlin 2.x
78

89
## 1.7.0 (2025-03-01)
910

instrumentation/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
plugins {
2-
id("io.github.gradle-nexus.publish-plugin").version("2.0.0")
3-
id("org.jetbrains.kotlinx.binary-compatibility-validator").version("0.14.0")
2+
id("io.github.gradle-nexus.publish-plugin").version(libs.versions.nexusPublish)
3+
id("org.jetbrains.kotlinx.binary-compatibility-validator").version(libs.versions.kotlinxBinaryCompatibilityValidator)
44
}
55

66
buildscript {
77
dependencies {
88
classpath(libs.plugins.kotlin)
99
classpath(libs.plugins.dokka)
10+
classpath(libs.plugins.composeCompiler)
1011
classpath(libs.plugins.android(SupportedAgp.newestStable))
1112
}
1213
}

instrumentation/compose/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66
kotlin("android")
77
id("explicit-api-mode")
88
id("de.mannodermaus.android-junit5").version(Artifacts.Plugin.latestStableVersion)
9+
id("org.jetbrains.kotlin.plugin.compose")
910
}
1011

1112
val javaVersion = JavaVersion.VERSION_11
@@ -36,10 +37,6 @@ android {
3637
jvmTarget = javaVersion.toString()
3738
}
3839

39-
composeOptions {
40-
kotlinCompilerExtensionVersion = libs.versions.composeCompiler
41-
}
42-
4340
testOptions {
4441
unitTests.isReturnDefaultValues = true
4542
targetSdk = Android.targetSdkVersion

plugin/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Change Log
22
==========
33

44
## Unreleased
5+
- JUnit 5.13.0
6+
- Update to Kotlin 2.x
7+
- Raise minimum supported versions for AGP and Gradle to 8.2.x and 8.2, respectively
58

69
## 1.12.2.0 (2025-05-18)
710
- JUnit 5.12.2

plugin/android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/internal/config/Constants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
package de.mannodermaus.gradle.plugins.junit5.internal.config
44

5-
internal const val MIN_REQUIRED_GRADLE_VERSION = "8.0" // When updating this, check buildSrc/Tasks.kt and update it there, too
6-
internal const val MIN_REQUIRED_AGP_VERSION = "8.0.0"
5+
internal const val MIN_REQUIRED_GRADLE_VERSION = "8.2" // When updating this, check buildSrc/Tasks.kt and update it there, too
6+
internal const val MIN_REQUIRED_AGP_VERSION = "8.2.0"
77

88
internal const val EXTENSION_NAME = "junitPlatform"
99

plugin/android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/internal/config/PluginConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private constructor(
5050
val hasJacocoPlugin get() = project.plugins.hasPlugin("jacoco")
5151
private val hasKotlinPlugin get() = project.plugins.findPlugin("kotlin-android") != null
5252

53-
fun finalizeDsl(block: (CommonExtension<*, *, *, *>) -> Unit) {
53+
fun finalizeDsl(block: (CommonExtension<*, *, *, *, *>) -> Unit) {
5454
componentsExtension.finalizeDsl(block)
5555
}
5656

plugin/android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/internal/configureJUnit5.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal fun configureJUnit5(
5858

5959
/* Private */
6060

61-
private typealias AndroidExtension = CommonExtension<*, *, *, *>
61+
private typealias AndroidExtension = CommonExtension<*, *, *, *, *>
6262

6363
private fun AndroidJUnitPlatformExtension.prepareBuildTypeDsl(android: AndroidExtension) {
6464
// This will add filters for build types (e.g. "debug" or "release")

plugin/android-junit5/src/test/kotlin/de/mannodermaus/gradle/plugins/junit5/VersionCheckerTests.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ class VersionCheckerTests {
2020
"7.0.0-rc01, false",
2121
"7.0.0, false",
2222
"8.0.0-beta01, false",
23-
"8.0.0, true",
24-
"8.0.1, true",
25-
"8.0.1-alpha01, true",
26-
"8.1.0, true",
27-
"8.1.0-beta01, true",
23+
"8.0.0, false",
24+
"8.0.1, false",
25+
"8.0.1-alpha01, false",
26+
"8.1.0, false",
27+
"8.1.0-beta01, false",
2828
"8.2.0, true",
2929
"8.3.0-rc01, true",
3030
"8.4.0-alpha05, true",
31+
"8.10.1-alpha01, true",
32+
"8.10.0, true",
33+
"8.11.0-beta01, true",
34+
"8.11.0, true",
3135
)
3236
@ParameterizedTest
3337
fun `check AGP compatibility`(version: String, compatible: Boolean) {

plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id("io.github.gradle-nexus.publish-plugin").version("2.0.0")
3-
id("org.jetbrains.kotlinx.binary-compatibility-validator").version("0.14.0")
2+
id("io.github.gradle-nexus.publish-plugin").version(libs.versions.nexusPublish)
3+
id("org.jetbrains.kotlinx.binary-compatibility-validator").version(libs.versions.kotlinxBinaryCompatibilityValidator)
44
}
55

66
buildscript {

0 commit comments

Comments
 (0)