1import org.robolectric.gradle.AndroidProjectConfigPlugin 2apply plugin: 'com.android.library' 3apply plugin: AndroidProjectConfigPlugin 4apply plugin: 'kotlin-android' 5apply plugin: "io.github.takahirom.roborazzi" 6android { 7 compileSdk 34 8 namespace 'org.robolectric.integration.roborazzi' 9 10 defaultConfig { 11 minSdk 21 12 targetSdk 34 13 } 14 15 compileOptions { 16 sourceCompatibility = '1.8' 17 targetCompatibility = '1.8' 18 } 19 20 kotlinOptions { 21 jvmTarget = '1.8' 22 } 23 24 testOptions { 25 unitTests { 26 includeAndroidResources = true 27 all { 28 // For Roborazzi users, please use Roborazzi plugin and gradle.properties instead of this. 29 // https://takahirom.github.io/roborazzi/how-to-use.html#roborazzi-gradle-properties-options 30 31 // Change naming strategy of screenshots. 32 // org.robolectric.....RoborazziCaptureTest.checkDialogRendering.png -> RoborazziCaptureTest.checkDialogRendering.png 33 systemProperty 'roborazzi.record.namingStrategy', 'testClassAndMethod' 34 35 // Use RoborazziRule's base path when you use captureRoboImage(path). 36 systemProperty 'roborazzi.record.filePathStrategy', 'relativePathFromRoborazziContextOutputDirectory' 37 } 38 } 39 } 40 androidComponents { 41 beforeVariants(selector().all()) { variantBuilder -> 42 // Roborazzi does not support AndroidTest. 43 variantBuilder.enableAndroidTest = false 44 } 45 } 46} 47dependencies { 48 api project(":robolectric") 49 testImplementation libs.androidx.test.core 50 testImplementation libs.junit4 51 testImplementation libs.truth 52 testImplementation libs.roborazzi 53 testImplementation libs.roborazzi.rule 54} 55