mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
c4529b87b4
* Remove Roborazzi, use Paparazzi for Compound The new screenshots will be recorded with the rest of the Paparazzi ones. Note the names changed, since Paparazzi enforces a `$packagename.$testname.$name.$extension` format * Set a max width value for color previews * Merge the `verifyPaparazziDebug` CI steps * Update screenshots --------- Co-authored-by: ElementBot <android@element.io>
51 lines
1.7 KiB
Kotlin
51 lines
1.7 KiB
Kotlin
import extension.testCommonDependencies
|
|
|
|
/*
|
|
* Copyright (c) 2025 Element Creations Ltd.
|
|
* Copyright 2022, 2025 New Vector Ltd.
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
* Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
plugins {
|
|
id("io.element.android-compose-library")
|
|
alias(libs.plugins.paparazzi)
|
|
}
|
|
|
|
android {
|
|
namespace = "io.element.android.compound"
|
|
|
|
testOptions {
|
|
unitTests.isIncludeAndroidResources = true
|
|
}
|
|
}
|
|
|
|
// Paparazzi's layoutlib runtime conflicts with Robolectric, so during Paparazzi record/verify runs
|
|
// only execute the screenshot tests (which use Paparazzi) and leave the Robolectric-based unit tests
|
|
// out. On plain unit test runs the screenshot package is excluded in the root build.gradle.kts.
|
|
tasks.withType(Test::class).configureEach {
|
|
val isScreenshotTest = gradle.startParameter.taskNames.any { it.contains("paparazzi", ignoreCase = true) }
|
|
if (isScreenshotTest) {
|
|
include("**/screenshot/**")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testCommonDependencies(libs)
|
|
|
|
// Paparazzi 1.3.2 workaround (see https://github.com/cashapp/paparazzi/blob/master/CHANGELOG.md#132---2024-01-13)
|
|
constraints.add("testImplementation", "com.google.guava:guava") {
|
|
attributes {
|
|
attribute(
|
|
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
|
|
objects.named(TargetJvmEnvironment::class.java, TargetJvmEnvironment.STANDARD_JVM)
|
|
)
|
|
}
|
|
because(
|
|
"LayoutLib and sdk-common depend on Guava's -jre published variant." +
|
|
"See https://github.com/cashapp/paparazzi/issues/906."
|
|
)
|
|
}
|
|
}
|