Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

object libs {
object versions {
const val kotlin = "2.1.21"
const val kotlin = "2.3.0"
const val junitJupiter = "5.14.0"
const val junitVintage = "5.14.0"
const val junitPlatform = "1.14.0"

const val compose = "1.7.8"
const val compose = "1.10.0"
const val androidXMultidex = "2.0.1"
const val androidXTestAnnotation = "1.0.1"
const val androidXTestCore = "1.6.1"
Expand Down
13 changes: 7 additions & 6 deletions build-logic/src/main/kotlin/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ enum class SupportedAgp(
AGP_8_8("8.8.2", gradle = "8.10.2"),
AGP_8_9("8.9.3", gradle = "8.11.1"),
AGP_8_10("8.10.1", gradle = "8.11.1"),
AGP_8_11("8.11.1", gradle = "8.13"),
AGP_8_12("8.12.2", gradle = "8.13"),
AGP_8_13("8.13.0", gradle = "8.13"),
AGP_9_0("9.0.0-alpha04", gradle = "9.0.0"),
AGP_8_11("8.11.2", gradle = "8.13"),
AGP_8_12("8.12.3", gradle = "8.13"),
AGP_8_13("8.13.2", gradle = "8.13"),
AGP_9_0("9.0.0-rc01", gradle = "9.1.0"),
AGP_9_1("9.1.0-alpha01", gradle = "9.1.0"),
;

companion object {
Expand All @@ -45,7 +46,7 @@ enum class SupportedAgp(
object Android {
const val compileSdkVersion = 35
const val targetSdkVersion = 35
const val sampleMinSdkVersion = 21
const val sampleMinSdkVersion = 23
val testRunnerMinSdkVersion = (Artifacts.Instrumentation.Runner.platform as Android).minSdk
val testCoreMinSdkVersion = (Artifacts.Instrumentation.Core.platform as Android).minSdk
val testComposeMinSdkVersion = (Artifacts.Instrumentation.Compose.platform as Android).minSdk
Expand Down Expand Up @@ -134,7 +135,7 @@ object Artifacts {
)

val Compose = Deployed(
platform = Android(minSdk = 21),
platform = Android(minSdk = 23),
groupId = groupId,
artifactId = "android-test-compose",
currentVersion = currentVersion,
Expand Down
4 changes: 4 additions & 0 deletions instrumentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Change Log

## Unreleased

- Removed deprecated `runComposeTest` API from `ComposeExtension`
- Update to Kotlin 2.3
- Update to Compose 1.10

## 1.9.0 (2025-10-10)

- Adjust constructor of `ModifiedTestPlan` to conform to newly added interface from JUnit 5.14 (#390)
Expand Down
12 changes: 6 additions & 6 deletions instrumentation/compose/api/compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public final class de/mannodermaus/junit5/compose/AndroidComposeExtension : de/m
public final fun getActivity ()Landroidx/activity/ComponentActivity;
public final fun getScenario ()Landroidx/test/core/app/ActivityScenario;
public fun resolveParameter (Lorg/junit/jupiter/api/extension/ParameterContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;
public fun runComposeTest (Lkotlin/jvm/functions/Function1;)V
public fun supportsParameter (Lorg/junit/jupiter/api/extension/ParameterContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Z
public fun use (Lkotlin/jvm/functions/Function1;)V
}
Expand All @@ -30,10 +29,16 @@ public abstract interface class de/mannodermaus/junit5/compose/ComposeContext :
public abstract fun waitForIdle ()V
public abstract fun waitUntil (JLkotlin/jvm/functions/Function0;)V
public abstract fun waitUntil (Ljava/lang/String;JLkotlin/jvm/functions/Function0;)V
public static synthetic fun waitUntil$default (Lde/mannodermaus/junit5/compose/ComposeContext;JLkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public static synthetic fun waitUntil$default (Lde/mannodermaus/junit5/compose/ComposeContext;Ljava/lang/String;JLkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public abstract fun waitUntilAtLeastOneExists (Landroidx/compose/ui/test/SemanticsMatcher;J)V
public static synthetic fun waitUntilAtLeastOneExists$default (Lde/mannodermaus/junit5/compose/ComposeContext;Landroidx/compose/ui/test/SemanticsMatcher;JILjava/lang/Object;)V
public abstract fun waitUntilDoesNotExist (Landroidx/compose/ui/test/SemanticsMatcher;J)V
public static synthetic fun waitUntilDoesNotExist$default (Lde/mannodermaus/junit5/compose/ComposeContext;Landroidx/compose/ui/test/SemanticsMatcher;JILjava/lang/Object;)V
public abstract fun waitUntilExactlyOneExists (Landroidx/compose/ui/test/SemanticsMatcher;J)V
public static synthetic fun waitUntilExactlyOneExists$default (Lde/mannodermaus/junit5/compose/ComposeContext;Landroidx/compose/ui/test/SemanticsMatcher;JILjava/lang/Object;)V
public abstract fun waitUntilNodeCount (Landroidx/compose/ui/test/SemanticsMatcher;IJ)V
public static synthetic fun waitUntilNodeCount$default (Lde/mannodermaus/junit5/compose/ComposeContext;Landroidx/compose/ui/test/SemanticsMatcher;IJILjava/lang/Object;)V
}

public final class de/mannodermaus/junit5/compose/ComposeContext$DefaultImpls {
Expand All @@ -46,11 +51,6 @@ public final class de/mannodermaus/junit5/compose/ComposeContext$DefaultImpls {
}

public abstract interface class de/mannodermaus/junit5/compose/ComposeExtension : org/junit/jupiter/api/extension/Extension {
public abstract fun runComposeTest (Lkotlin/jvm/functions/Function1;)V
public abstract fun use (Lkotlin/jvm/functions/Function1;)V
}

public final class de/mannodermaus/junit5/compose/ComposeExtension$DefaultImpls {
public static fun runComposeTest (Lde/mannodermaus/junit5/compose/ComposeExtension;Lkotlin/jvm/functions/Function1;)V
}

11 changes: 7 additions & 4 deletions instrumentation/compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.library")
Expand Down Expand Up @@ -33,10 +34,6 @@ android {
targetCompatibility = javaVersion
}

kotlinOptions {
jvmTarget = javaVersion.toString()
}

testOptions {
unitTests.isReturnDefaultValues = true
targetSdk = Android.targetSdkVersion
Expand All @@ -52,6 +49,12 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(javaVersion.toString())
}
}

junitPlatform {
// Using local dependency instead of Maven coordinates
instrumentationTests.enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,4 @@ public interface ComposeExtension : Extension {
* With this function, you can pass an arbitrary composable tree to the extension and evaluate it afterwards.
*/
public fun use(block: ComposeContext.() -> Unit)

@Deprecated(message = "Change to use()", replaceWith = ReplaceWith("use(block)"))
public fun runComposeTest(block: ComposeContext.() -> Unit) {
use(block)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package de.mannodermaus.junit5.internal.discovery

import androidx.annotation.RequiresApi
import org.junit.platform.engine.ConfigurationParameters
import org.junit.platform.engine.OutputDirectoryCreator
import org.junit.platform.engine.TestDescriptor
import org.junit.platform.engine.reporting.OutputDirectoryProvider
import org.junit.platform.launcher.TestPlan
import java.io.File
import java.util.Optional
Expand All @@ -17,7 +17,7 @@ import java.util.Optional
internal object EmptyTestPlan : TestPlan(
false,
emptyConfigurationParameters,
emptyOutputDirectoryProvider
emptyOutputDirectoryCreator
)

@RequiresApi(26)
Expand All @@ -31,7 +31,7 @@ private val emptyConfigurationParameters = object : ConfigurationParameters {
}

@RequiresApi(26)
private val emptyOutputDirectoryProvider = object : OutputDirectoryProvider {
private val emptyOutputDirectoryCreator = object : OutputDirectoryCreator {
private val path = File.createTempFile("empty-output", ".nop").toPath()
override fun getRootDirectory() = path
override fun createOutputDirectory(testDescriptor: TestDescriptor?) = path
Expand Down
7 changes: 5 additions & 2 deletions instrumentation/sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand Down Expand Up @@ -48,9 +49,11 @@ android {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
}

kotlinOptions {
jvmTarget = javaVersion.toString()
kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(javaVersion.toString())
}
}

Expand Down
2 changes: 2 additions & 0 deletions plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Change Log
==========

## Unreleased
- Update to Kotlin 2.3
- Internal: Replace deprecated `OutputDirectoryProvider` with its correct replacement

## 1.14.0.0 (2025-10-10)
- JUnit 5.14.0
Expand Down