aboutsummaryrefslogtreecommitdiff
path: root/integration_tests/roborazzi/build.gradle
blob: 7c7000c5b2c906ebeb851639a36b69043445c71f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import org.robolectric.gradle.AndroidProjectConfigPlugin

apply plugin: 'com.android.library'
apply plugin: AndroidProjectConfigPlugin
apply plugin: 'kotlin-android'
apply plugin: "com.diffplug.spotless"
apply plugin: "io.github.takahirom.roborazzi"

spotless {
    kotlin {
        target '**/*.kt'
        ktfmt('0.42').googleStyle()
    }
}

android {
    compileSdk 34
    namespace 'org.robolectric.integration.roborazzi'

    defaultConfig {
        minSdk 21
        targetSdk 34
    }

    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
            all {
                // For Roborazzi users, please use Roborazzi plugin and gradle.properties instead of this.
                // https://takahirom.github.io/roborazzi/how-to-use.html#roborazzi-gradle-properties-options

                // Change naming strategy of screenshots.
                // org.robolectric.....RoborazziCaptureTest.checkDialogRendering.png -> RoborazziCaptureTest.checkDialogRendering.png
                systemProperty 'roborazzi.record.namingStrategy', 'testClassAndMethod'

                // Use RoborazziRule's base path when you use captureRoboImage(path).
                systemProperty 'roborazzi.record.filePathStrategy', 'relativePathFromRoborazziContextOutputDirectory'
            }
        }
    }
    androidComponents {
        beforeVariants(selector().all()) { variantBuilder ->
            // Roborazzi does not support AndroidTest.
            variantBuilder.enableAndroidTest = false
        }
    }
}

dependencies {
    api project(":robolectric")
    testImplementation libs.androidx.test.core
    testImplementation libs.junit4
    testImplementation libs.truth
    testImplementation libs.roborazzi
    testImplementation libs.roborazzi.rule
}