From 5fbad44baaf54c7c3fa534067dd787dc26ea0886 Mon Sep 17 00:00:00 2001 From: takahirom Date: Thu, 29 Feb 2024 18:34:46 +0900 Subject: [PATCH] Check robolectric.screenshot.hwrdr.native=true with 4.12-SNAPSHOT --- gradle/libs.versions.toml | 2 +- .../java/io/github/takahirom/roborazzi/RoborazziPlugin.kt | 1 + include-build/settings.gradle | 2 ++ .../com/github/takahirom/roborazzi/sample/ManualTest.kt | 7 ++++++- settings.gradle | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 18a0d11f..1341bd2a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ kotlin = "1.8.22" mavenPublish = "0.25.3" composeCompiler = "1.4.8" composeDesktop = "1.4.3" -robolectric = "4.10.3" +robolectric = "4.12-SNAPSHOT" robolectric-android-all = "Q-robolectric-5415296" roborazzi-for-replacing-by-include-build = "1.0.0" diff --git a/include-build/roborazzi-gradle-plugin/src/main/java/io/github/takahirom/roborazzi/RoborazziPlugin.kt b/include-build/roborazzi-gradle-plugin/src/main/java/io/github/takahirom/roborazzi/RoborazziPlugin.kt index aabe4fe4..cff6b2e9 100644 --- a/include-build/roborazzi-gradle-plugin/src/main/java/io/github/takahirom/roborazzi/RoborazziPlugin.kt +++ b/include-build/roborazzi-gradle-plugin/src/main/java/io/github/takahirom/roborazzi/RoborazziPlugin.kt @@ -322,6 +322,7 @@ abstract class RoborazziPlugin : Plugin { test.systemProperties["roborazzi.test.verify"] = isVerifyRun.get() || isVerifyAndRecordRun.get() } + test.systemProperties["robolectric.logging.enabled"] = true test.systemProperties["roborazzi.output.dir"] = outputDirRelativePathFromProjectProvider.get() test.systemProperties["roborazzi.result.dir"] = diff --git a/include-build/settings.gradle b/include-build/settings.gradle index 39a77cac..3e4c6ea8 100644 --- a/include-build/settings.gradle +++ b/include-build/settings.gradle @@ -3,6 +3,7 @@ pluginManagement { gradlePluginPortal() google() mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } } dependencyResolutionManagement { @@ -13,6 +14,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } } diff --git a/sample-android/src/test/java/com/github/takahirom/roborazzi/sample/ManualTest.kt b/sample-android/src/test/java/com/github/takahirom/roborazzi/sample/ManualTest.kt index 7bd95b6e..1d0cb54a 100644 --- a/sample-android/src/test/java/com/github/takahirom/roborazzi/sample/ManualTest.kt +++ b/sample-android/src/test/java/com/github/takahirom/roborazzi/sample/ManualTest.kt @@ -41,13 +41,18 @@ import java.io.File @RunWith(AndroidJUnit4::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) @Config( - sdk = [30], + sdk = [33], qualifiers = RobolectricDeviceQualifiers.NexusOne ) class ManualTest { @get:Rule val composeTestRule = createAndroidComposeRule() + init { + val USE_HARDWARE_RENDERER_NATIVE_ENV = "robolectric.screenshot.hwrdr.native" + System.setProperty(USE_HARDWARE_RENDERER_NATIVE_ENV, "false") + } + @Test @Config(qualifiers = "+land") fun captureScreenLevelImageWithEspresso() { diff --git a/settings.gradle b/settings.gradle index 97c68d51..fc08e3b2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,6 +3,7 @@ pluginManagement { gradlePluginPortal() google() mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } } dependencyResolutionManagement { @@ -10,6 +11,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } } rootProject.name = "roborazzi"