From 088d8606a6d7f42c372e82c36b9b9e28122c189a Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 25 Jun 2022 18:37:04 +0530 Subject: [PATCH] paparazzi-tests: init --- gradle/libs.versions.toml | 1 + paparazzi-tests/README.md | 7 +++++++ paparazzi-tests/build.gradle.kts | 26 ++++++++++++++++++++++++++ settings.gradle.kts | 2 ++ 4 files changed, 36 insertions(+) create mode 100644 paparazzi-tests/README.md create mode 100644 paparazzi-tests/build.gradle.kts diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 525a84d7..6d0cb462 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -73,3 +73,4 @@ compose = "org.jetbrains.compose:1.1.1" hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" } sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } aurora-svg-transcoder = { id = "org.pushing-pixels.aurora.tools.svgtranscoder.gradle", version.ref = "aurora" } +paparazzi = { id = "app.cash.paparazzi", version = "1.0.0" } diff --git a/paparazzi-tests/README.md b/paparazzi-tests/README.md new file mode 100644 index 00000000..0f90f36b --- /dev/null +++ b/paparazzi-tests/README.md @@ -0,0 +1,7 @@ +# paparazzi-tests + +[Paparazzi](https://github.com/cashapp/paparazzi) is a Gradle plugin and library that allows writing +Android UI tests that run on the JVM. However, it does not support Kotlin Multiplatform so we're +using this Android library module to hide the Multiplatform aspect of the project from Paparazzi. In +the future this will be natively supported and we can disperse the tests contained in this module +into existing ones. diff --git a/paparazzi-tests/build.gradle.kts b/paparazzi-tests/build.gradle.kts new file mode 100644 index 00000000..362e3834 --- /dev/null +++ b/paparazzi-tests/build.gradle.kts @@ -0,0 +1,26 @@ +@file:Suppress("DSL_SCOPE_VIOLATION") + +plugins { + id("dev.msfjarvis.claw.android-library") + id("dev.msfjarvis.claw.kotlin-android") + alias(libs.plugins.paparazzi) +} + +androidComponents { beforeVariants(selector().all()) { it.enable = it.buildType == "debug" } } + +android { + namespace = "dev.msfjarvis.claw.android.tests" + buildFeatures { compose = true } +} + +dependencies { + testImplementation(kotlin("test-junit")) + testImplementation(projects.android) + testImplementation(projects.common) + testImplementation(projects.model) + testImplementation(projects.database) +} + +tasks.withType().configureEach { + javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) }) +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 3303d56b..13f53a8a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -84,3 +84,5 @@ include(":database") include(":desktop") include(":model") + +include(":paparazzi-tests")