diff --git a/README.md b/README.md index 7f9b59730..fd25099f9 100644 --- a/README.md +++ b/README.md @@ -991,10 +991,11 @@ After that, you can run the `recordRoborazziDebug` task to generate screenshots ### Customizing the Preview screenshot test -You can customize the generated test by adding the following configuration to your `build.gradle` file: +You can customize the generated test by adding the following configuration to your `build.gradle.kts` file: ```kotlin roborazzi { + @OptIn(ExperimentalRoborazziApi::class) generateComposePreviewRobolectricTests { enable = true // The package names to scan for Composable Previews. @@ -1013,6 +1014,12 @@ roborazzi { } ``` +> **Note** +> If you are using build.gradle instead of build.gradle.kts, you need to use the set method for each assignment, like +> ```kotlin +> generateComposePreviewRobolectricTests.packages.set(["com.example"]) +> ``` + ## Manually adding Compose Preview screenshot tests Roborazzi provides a helper function for ComposablePreviewScanner. diff --git a/docs/topics/preview_support.md b/docs/topics/preview_support.md index 1cf33e8f1..42ec43c28 100644 --- a/docs/topics/preview_support.md +++ b/docs/topics/preview_support.md @@ -22,10 +22,11 @@ After that, you can run the `recordRoborazziDebug` task to generate screenshots ### Customizing the Preview screenshot test -You can customize the generated test by adding the following configuration to your `build.gradle` file: +You can customize the generated test by adding the following configuration to your `build.gradle.kts` file: ```kotlin roborazzi { + @OptIn(ExperimentalRoborazziApi::class) generateComposePreviewRobolectricTests { enable = true // The package names to scan for Composable Previews. @@ -44,6 +45,12 @@ roborazzi { } ``` +> **Note** +> If you are using build.gradle instead of build.gradle.kts, you need to use the set method for each assignment, like +> ```kotlin +> generateComposePreviewRobolectricTests.packages.set(["com.example"]) +> ``` + ## Manually adding Compose Preview screenshot tests Roborazzi provides a helper function for ComposablePreviewScanner.