-
Notifications
You must be signed in to change notification settings - Fork 683
/
Copy pathbuild.gradle.kts
136 lines (123 loc) · 4.9 KB
/
build.gradle.kts
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import coil.by
import coil.groupId
import coil.versionName
import com.android.build.gradle.BaseExtension
import kotlinx.validation.ApiValidationExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import java.net.URL
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.1")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.13.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.10.1")
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:0.2.3")
classpath("org.jlleitschuh.gradle:ktlint-gradle:9.4.1")
classpath(kotlin("gradle-plugin", version = "1.4.20"))
}
}
apply(plugin = "binary-compatibility-validator")
extensions.configure<ApiValidationExtension> {
ignoredProjects = mutableSetOf("coil-sample", "coil-test")
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
group = project.groupId
version = project.versionName
extensions.configure<KtlintExtension>("ktlint") {
version by "0.39.0"
enableExperimentalRules by true
disabledRules by setOf(
"experimental:annotation",
"experimental:argument-list-wrapping",
"import-ordering",
"indent",
"max-line-length",
"parameter-list-wrapping"
)
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
allWarningsAsErrors = true
val arguments = mutableListOf("-progressive", "-Xopt-in=kotlin.RequiresOptIn")
if (project.name != "coil-test") {
arguments += "-Xopt-in=coil.annotation.ExperimentalCoilApi"
arguments += "-Xopt-in=coil.annotation.InternalCoilApi"
}
freeCompilerArgs = arguments
jvmTarget = "1.8"
}
}
tasks.withType<Test>().configureEach {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.PASSED, TestLogEvent.FAILED)
showStandardStreams = true
}
}
// Must be afterEvaluate or else com.vanniktech.maven.publish will overwrite our dokka configuration.
afterEvaluate {
tasks.withType<DokkaTask>().configureEach {
configuration {
jdkVersion = 8
reportUndocumented = false
skipDeprecated = true
skipEmptyPackages = true
outputDirectory = "$rootDir/docs/api"
outputFormat = "gfm"
externalDocumentationLink {
url = URL("https://developer.android.com/reference/")
packageListUrl = URL("https://developer.android.com/reference/androidx/package-list")
}
externalDocumentationLink {
url = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/")
packageListUrl = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/package-list")
}
externalDocumentationLink {
url = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
packageListUrl = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/package-list")
}
externalDocumentationLink {
url = URL("https://square.github.io/okhttp/3.x/okhttp/")
packageListUrl = URL("https://square.github.io/okhttp/3.x/okhttp/package-list")
}
externalDocumentationLink {
url = URL("https://square.github.io/okio/2.x/okio/")
packageListUrl = URL("file://$rootDir/package-list-okio")
}
// Include the coil-base documentation link for extension artifacts.
if (project.name != "coil-base") {
externalDocumentationLink {
url = URL("https://coil-kt.github.io/coil/api/coil-base/")
packageListUrl = URL("file://$rootDir/package-list-coil-base")
}
}
}
}
}
}
subprojects {
afterEvaluate {
extensions.configure<BaseExtension> {
// Require that all Android projects target Java 8.
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}
}