-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
105 lines (97 loc) · 3.41 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
buildscript {
ext.versions = [
'kotlin' : '1.7.0',
'moshi' : '1.14.0',
'javapoet' : '1.13.0',
'autoservice' : '1.0',
'incap' : '0.3',
'retrofit' : '2.9.0',
'okhttp' : '3.14.9',
'jsr305' : '3.0.2',
'junit' : '4.13.2',
'assertj' : '3.19.0',
'compile_testing': '0.19'
]
ext.deps = [
'kotlin_reflect' : "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}",
'moshi' : "com.squareup.moshi:moshi:${versions.moshi}",
'moshi_kotlin_reflect' : "com.squareup.moshi:moshi-kotlin:${versions.moshi}",
'moshi_kotlin_codegen' : "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}",
'javapoet' : "com.squareup:javapoet:${versions.javapoet}",
'autoservice' : "com.google.auto.service:auto-service:${versions.autoservice}",
'incapRuntime' : "net.ltgt.gradle.incap:incap:${versions.incap}",
'incapProcessor' : "net.ltgt.gradle.incap:incap-processor:${versions.incap}",
'retrofit' : "com.squareup.retrofit2:retrofit:${versions.retrofit}",
'retrofit_converter_moshi': "com.squareup.retrofit2:converter-moshi:${versions.retrofit}",
'okhttp' : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
'mockwebserver' : "com.squareup.okhttp3:mockwebserver:${versions.okhttp}",
'jsr305' : "com.google.code.findbugs:jsr305:${versions.jsr305}",
'junit' : "junit:junit:${versions.junit}",
'assertj' : "org.assertj:assertj-core:${versions.assertj}",
'compile_testing' : "com.google.testing.compile:compile-testing:${versions.compile_testing}"
]
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.android.tools.build:gradle:7.2.2"
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.7.0"
classpath "com.vanniktech:gradle-maven-publish-plugin:0.17.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32"
}
}
allprojects {
repositories {
mavenCentral()
google()
}
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
}
}
}
subprojects {
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
apply plugin: "com.diffplug.spotless"
spotless {
kotlin {
target "**/*.kt"
targetExclude "**/gen/**/*.*", "**/generated/**/*.*"
targetExclude "$buildDir/**/*.kt"
targetExclude "bin/**/*.kt"
// This should all come from editorconfig which is not currently supported
// Related issue: https://github.com/diffplug/spotless/issues/142
ktlint("0.41.0").userData([
"indent_size" : "2",
"continuation_indent_size": "2"
])
indentWithSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
java {
target "**/src/**/*.java"
removeUnusedImports()
indentWithSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target "**/*.gradle"
trimTrailingWhitespace()
endWithNewline()
}
}