File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
build-logic/src/main/kotlin
kotlin/de/mannodermaus/gradle/plugins/junit5/internal Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ fun Copy.configureCreateVersionClassTask(
166166 // Find an appropriate version of the instrumentation library,
167167 // depending on the version of how the plugin is configured
168168 " INSTRUMENTATION_VERSION" to instrumentationVersion,
169+
170+ // JUnit 5.12+ requires the platform launcher on the runtime classpath;
171+ // to prevent issues with version mismatching, the plugin applies this for users
172+ " JUNIT_PLATFORM_LAUNCHER" to libs.junitPlatformLauncher
169173 )
170174 ), ReplaceTokens ::class .java
171175 )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Change Log
33
44## Unreleased
55- JUnit 5.12.0
6+ - Add dependency on JUnit Platform Launcher to runtime classpath, accommodating an upstream change
67
78## 1.11.3.0 (2024-12-23)
89- JUnit 5.11.3
Original file line number Diff line number Diff line change @@ -148,13 +148,15 @@ private fun AndroidJUnitPlatformExtension.attachDependencies(
148148 includeRunner : Boolean ,
149149) {
150150 if (project.usesJUnitJupiterIn(configurationName)) {
151+ val runtimeOnlyConfigurationName = configurationName.replace(" Implementation" , " RuntimeOnly" )
151152 val version = instrumentationTests.version.get()
152153
154+ project.dependencies.add(runtimeOnlyConfigurationName, Libraries .junitPlatformLauncher)
153155 project.dependencies.add(configurationName, " ${Libraries .instrumentationCore} :$version " )
154156
155157 if (includeRunner) {
156158 project.dependencies.add(
157- configurationName.replace( " Implementation " , " RuntimeOnly " ) ,
159+ runtimeOnlyConfigurationName ,
158160 " ${Libraries .instrumentationRunner} :$version " ,
159161 )
160162 }
Original file line number Diff line number Diff line change @@ -6,4 +6,6 @@ internal object Libraries {
66 const val instrumentationCore = " @INSTRUMENTATION_GROUP@:@INSTRUMENTATION_CORE@"
77 const val instrumentationExtensions = " @INSTRUMENTATION_GROUP@:@INSTRUMENTATION_EXTENSIONS@"
88 const val instrumentationRunner = " @INSTRUMENTATION_GROUP@:@INSTRUMENTATION_RUNNER@"
9+
10+ const val junitPlatformLauncher = " @JUNIT_PLATFORM_LAUNCHER@"
911}
You can’t perform that action at this time.
0 commit comments