forked from cashapp/paparazzi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
74 lines (64 loc) · 1.79 KB
/
build.gradle
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
71
72
73
74
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()
//mavenLocal()
}
dependencies {
classpath libs.plugin.kotlin
classpath libs.plugin.android
classpath libs.plugin.versions
classpath libs.plugin.spotless
// Normally you would declare a version here, but we use dependency substitution in
// settings.gradle to use the version built from inside the repo.
classpath 'app.cash.paparazzi:paparazzi-gradle-plugin'
}
}
subprojects {
repositories {
mavenCentral()
google()
//mavenLocal()
}
tasks.withType(Test).configureEach {
testLogging {
events "failed"
exceptionFormat "full"
showExceptions true
showStackTraces true
showCauses true
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = libs.versions.javaTarget.get()
targetCompatibility = libs.versions.javaTarget.get()
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile).configureEach {
kotlinOptions {
jvmTarget = libs.versions.javaTarget.get()
}
}
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target("src/**/*.kt")
// ktlint doesn't honour .editorconfig yet: https://github.com/diffplug/spotless/issues/142
ktlint(libs.versions.ktlint.get()).editorConfigOverride([
'insert_final_newline': 'true',
'end_of_line': 'lf',
'charset': 'utf-8',
'indent_size': '2',
'trim_trailing_whitespace': 'true',
'ij_kotlin_imports_layout': '*,java.**,javax.**,kotlin.**,kotlinx.**,^'
])
}
}
}
tasks.register("clean", Delete).configure {
delete rootProject.buildDir
}
tasks.named("wrapper").configure {
distributionType = Wrapper.DistributionType.ALL
}