summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/groovy/the_jk.android-conventions.gradle
blob: ef18b0999dc339757b8dd0b544d93f39c1a68a04 (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
66
67
68
69
70
import org.gradle.api.tasks.testing.logging.TestExceptionFormat

plugins {
    id("io.gitlab.arturbosch.detekt")
    id("org.jetbrains.kotlin.android")
}

android {
    compileSdk = 36

    defaultConfig {
        minSdk = 29

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }
    kotlinOptions {
        jvmTarget = "21"
    }

    testOptions {
        unitTests {
            all { test ->
                test.testLogging {
                    showStandardStreams = true
                    exceptionFormat = TestExceptionFormat.FULL
                }
            }
        }

        animationsDisabled = true
        execution 'ANDROIDX_TEST_ORCHESTRATOR'
    }
}

dependencies {
    testImplementation(libs.androidx.espresso.core)
    testImplementation(libs.junit)
    testImplementation(libs.robolectric)
    testImplementation(libs.truth)

    androidTestImplementation(libs.androidx.espresso.core)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.test.core)
    androidTestImplementation(libs.androidx.test.rules)
    androidTestImplementation(libs.androidx.test.runner)
    androidTestImplementation(libs.truth)
    androidTestUtil(libs.androidx.orchestrator)
}

detekt {
    config.setFrom(rootProject.file("detekt.yaml"))
}

def detektPlugin = project.plugins['io.gitlab.arturbosch.detekt']
def detektCls = Class.forName('io.gitlab.arturbosch.detekt.Detekt', true, detektPlugin.class.classLoader)

tasks.withType(detektCls).configureEach {
    jvmTarget = "21"
}

def detektCreateBaselineTaskCls = Class.forName('io.gitlab.arturbosch.detekt.DetektCreateBaselineTask', true, detektPlugin.class.classLoader)

tasks.withType(detektCreateBaselineTaskCls).configureEach {
    jvmTarget = "21"
}