Skip to content

Commit

Permalink
Configure Roborazzi compose preview
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartinbTEF committed Oct 2, 2024
1 parent 54074d1 commit f3f44ef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ buildscript {
coil_version = '2.5.0'
constraintComposeVersion = '1.0.1'
detekt_version = '1.23.7'
roborazzi_version = "1.26.0"
roborazzi_version = "1.27.0"
}
repositories {
google()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:8.1.4"
Expand All @@ -31,7 +32,7 @@ buildscript {
plugins {
id 'org.jetbrains.kotlin.android' version '1.5.21' apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false
id "io.github.takahirom.roborazzi" version '1.26.0' apply false
id "io.github.takahirom.roborazzi" version '1.27.0' apply false
id "io.gitlab.arturbosch.detekt" version '1.23.7'
}

Expand All @@ -40,6 +41,11 @@ dependencies {
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}

group = 'com.telefonica.mistica'
if (System.getProperty("SNAPSHOT_VERSION") != null) {
Expand Down
11 changes: 11 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ plugins {
id 'io.github.takahirom.roborazzi'
}


roborazzi {
generateComposePreviewRobolectricTests.enable = true
generateComposePreviewRobolectricTests.packages.set(["com.telefonica.mistica.compose.feedback.error"])
}

android {
compileSdk target_sdk_version
namespace "com.telefonica.mistica"
Expand Down Expand Up @@ -61,6 +67,7 @@ android {
includeAndroidResources = true
all {
systemProperty 'robolectric.graphicsMode', 'NATIVE'
it.systemProperties["robolectric.pixelCopyRenderMode"] = "hardware"
}
}
}
Expand All @@ -72,6 +79,10 @@ task sourceJar(type: Jar) {
}

dependencies {
testImplementation "com.github.sergio-sastre.ComposablePreviewScanner:android:0.3.2"
testImplementation "io.github.takahirom.roborazzi:roborazzi-compose-preview-scanner-support:$roborazzi_version"


api "com.google.android.material:material:1.6.1"
api 'androidx.constraintlayout:constraintlayout:2.0.4'
api 'androidx.constraintlayout:constraintlayout-solver:2.0.4'
Expand Down

0 comments on commit f3f44ef

Please sign in to comment.