Skip to content

Commit 581e92f

Browse files
committed
Always add junit-platform-runner dependency
1 parent 2a99138 commit 581e92f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/Dependencies.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ class JUnit5DependencyHandler(
9797
}
9898

9999
return listOf(
100-
versions.others.instrumentationTest
100+
versions.others.instrumentationTest,
101+
102+
// Required at runtime
103+
versions.platform.runner
101104
)
102105
}
103106

android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/Plugin.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,10 @@ class AndroidJUnitPlatformPlugin : Plugin<Project> {
139139
}
140140

141141
// Attach runtime-only dependency on JUnit 5 instrumentation test facade, unless disabled
142-
if (junit5.instrumentationTests.enabled) {
143-
val defaults = loadProperties(VERSIONS_RESOURCE_NAME)
144-
val rtOnly = configurations.findConfiguration(kind = ANDROID_TEST, scope = RUNTIME_ONLY)
145-
withLoadedVersions(defaults) {
146-
rtOnly.dependencies.add(it.others.instrumentationRunner)
147-
rtOnly.dependencies.add(it.platform.runner)
148-
}
142+
val defaults = loadProperties(VERSIONS_RESOURCE_NAME)
143+
val rtOnly = configurations.findConfiguration(kind = ANDROID_TEST, scope = RUNTIME_ONLY)
144+
withLoadedVersions(defaults) {
145+
rtOnly.dependencies.add(it.others.instrumentationRunner)
149146
}
150147
}
151148

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LICENSE_NAME = Apache-2.0
1212
PLUGIN_GROUP_ID = de.mannodermaus.gradle.plugins
1313
PLUGIN_ARTIFACT_ID = android-junit5
1414
PLUGIN_DESCRIPTION = Unit Testing with JUnit 5 for Android.
15-
PLUGIN_RUNTIME_VERSION_NAME = 1.0.31
16-
PLUGIN_RUNTIME_VERSION_NAME_LATEST_STABLE = 1.0.30
15+
PLUGIN_RUNTIME_VERSION_NAME = 1.0.31-SNAPSHOT
16+
PLUGIN_RUNTIME_VERSION_NAME_LATEST_STABLE = 1.0.31
1717

1818
# Artifact configuration (embedded-runtime)
1919
RUNTIME_GROUP_ID = de.mannodermaus.gradle.plugins

0 commit comments

Comments
 (0)