diff --git a/build.gradle.kts b/build.gradle.kts index edfcec1..6f43abe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ plugins { alias(libs.plugins.android.application) apply false // https://youtrack.jetbrains.com/issue/KT-31643/Unable-to-load-class-com.android.build.gradle.BaseExtension-with-Kotlin-plugin-applied-to-root-Gradle-project alias(libs.plugins.android.library) apply false // see above url alias(libs.plugins.kotlinAndroid) apply false + alias(libs.plugins.paparazzi) apply false alias(libs.plugins.kapt) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.hilt) apply false // fun https://github.com/google/dagger/issues/3068 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 365b916..eeba7c2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,7 +12,7 @@ arrow = "1.1.2" assertk = "0.25" coil = "2.2.2" compose = "1.5.1" -composeCompiler = "1.5.3" +composeCompiler = "1.5.14" composeMaterial3 = "1.1.1" composeUiTestJUnit4 = "1.5.1" daggerHilt = "2.48" @@ -24,7 +24,7 @@ espresso-runner = "1.5.2" firebaseBom = "32.2.3" glance = "1.0.0" glance-tools = "0.2.2" -gradlePlugins-agp = "8.4.0-alpha09" +gradlePlugins-agp = "8.4.2" gradlePlugins-crashlytics = "2.9.9" gradlePlugins-detekt = "1.23.1" gradlePlugins-gms = "4.3.15" @@ -40,7 +40,7 @@ gradlePlugins-versionsBenManes = "0.47.0" hilt = "1.0.0" hiltNavigationCompose = "1.0.0" junit = "4.13.2" -kotlin = "1.9.10" +kotlin = "1.9.24" kotlinxCoroutinesTest = "1.7.1" kotlinxSerialization = "1.5.0" lifecycle = "2.6.2" @@ -182,6 +182,7 @@ googleServices = { id = "com.google.gms.google-services", version.ref = "gradleP hilt = { id = "dagger.hilt.android.plugin", version.ref = "gradlePlugins-hilt" } kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +paparazzi = { id = "app.cash.paparazzi", version = "1.3.4" } kotlinxSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "gradlePlugins-kotlinxSerialization" } kotlinter = { id = "org.jmailen.kotlinter", version.ref = "gradlePlugins-kotlinter" } ksp = { id = "com.google.devtools.ksp", version.ref = "gradlePlugins-ksp" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6557180..d01699f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Nov 03 16:26:13 CET 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/shared-ui/build.gradle.kts b/shared-ui/build.gradle.kts index b8b36ed..397a9b6 100644 --- a/shared-ui/build.gradle.kts +++ b/shared-ui/build.gradle.kts @@ -1,11 +1,12 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlinAndroid) + alias(libs.plugins.paparazzi) } android { namespace = "dev.sebastiano.bundel.ui" - compileSdk = 33 + compileSdk = 34 defaultConfig { minSdk = 26 diff --git a/shared-ui/src/test/kotlin/dev/sebastiano/bundel/ui/composables/OnboardingPreviewsTest.kt b/shared-ui/src/test/kotlin/dev/sebastiano/bundel/ui/composables/OnboardingPreviewsTest.kt new file mode 100644 index 0000000..6436b40 --- /dev/null +++ b/shared-ui/src/test/kotlin/dev/sebastiano/bundel/ui/composables/OnboardingPreviewsTest.kt @@ -0,0 +1,27 @@ +package dev.sebastiano.bundel.ui.composables + +import app.cash.paparazzi.Paparazzi +import com.android.ide.common.rendering.api.SessionParams +import org.junit.Rule +import org.junit.Test + +class OnboardingPreviewsTest { + @get:Rule + val paparazzi = Paparazzi( + renderingMode = SessionParams.RenderingMode.SHRINK + ) + + @Test + fun active() { + paparazzi.snapshot { + OnboardingPreviews().TimeRangeRowOnboardingActivePreview() + } + } + + @Test + fun inactive() { + paparazzi.snapshot { + OnboardingPreviews().TimeRangeRowOnboardingInactivePreview() + } + } +} diff --git a/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_active.png b/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_active.png new file mode 100644 index 0000000..fde26df Binary files /dev/null and b/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_active.png differ diff --git a/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_inactive.png b/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_inactive.png new file mode 100644 index 0000000..96506fb Binary files /dev/null and b/shared-ui/src/test/snapshots/images/dev.sebastiano.bundel.ui.composables_OnboardingPreviewsTest_inactive.png differ