forked from zalando/zally
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
180 lines (155 loc) · 5.91 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "1.6.20"
val klintVersion = "10.2.1"
// The buildscript is also kotlin, so we apply at the root level
kotlin("jvm") version kotlinVersion
kotlin("kapt") version kotlinVersion
// We need to declare these here since we are configuring them for
// subprojects from the top level.
jacoco
`maven-publish`
signing
id("com.github.ben-manes.versions") version "0.20.0"
id("org.jetbrains.dokka") version "1.6.10" apply false
// We apply this so that ktlint can format the top level buildscript
id("org.jlleitschuh.gradle.ktlint") version klintVersion
id("org.jlleitschuh.gradle.ktlint-idea") version klintVersion
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
group = "org.zalando"
apply(plugin = "kotlin")
apply(plugin = "kotlin-kapt")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "com.github.ben-manes.versions")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")
apply(plugin = "jacoco")
apply(plugin = "signing")
kapt {
includeCompileClasspath = false
}
tasks.withType<KotlinCompile>().configureEach() {
kotlinOptions.jvmTarget = "11"
}
tasks.withType<DokkaTask>().configureEach {
outputDirectory.set(buildDir.resolve("dokka"))
}
tasks.register("javadocJar", Jar::class) {
dependsOn(tasks["dokkaJavadoc"])
archiveClassifier.set("javadoc")
from(tasks["dokkaJavadoc"])
}
tasks.register("sourcesJar", Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
artifacts {
add("archives", tasks["javadocJar"])
add("archives", tasks["sourcesJar"])
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
description.set("OpenAPI linter service")
url.set("https://github.com/zalando/zally")
name.set("OpenAPI linter")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
name.set("Felix Müller")
email.set("[email protected]")
}
developer {
name.set("Mikhail Chernykh")
email.set("[email protected]")
}
developer {
name.set("Maxim Tschumak")
email.set("[email protected]")
}
developer {
name.set("Rui Araujo")
email.set("[email protected]")
}
developer {
name.set("Tronje Krop")
email.set("[email protected]")
}
developer {
name.set("Gregor Zeitlinger")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/zalando/zally.git")
developerConnection.set("scm:git:ssh://github.com:zalando/zally.git")
url.set("https://github.com/zalando/zally/tree/master")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
// defined in travis project settings or in $HOME/.gradle/gradle.properties
username = System.getenv("OSSRH_JIRA_USERNAME")
password = System.getenv("OSSRH_JIRA_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
configurations.all {
resolutionStrategy {
force("com.github.java-json-tools:json-schema-core:1.2.14")
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// We define this here so all subprojects use the same version of jackson
implementation(platform("com.fasterxml.jackson:jackson-bom:2.13.2.20220328"))
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("com.fasterxml.jackson.module:jackson-module-parameter-names")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.yaml:snakeyaml:1.30")
testImplementation("com.jayway.jsonpath:json-path-assert:2.7.0")
testImplementation("org.mockito:mockito-core:2.28.2")
}
jacoco {
toolVersion = "0.8.2"
}
tasks.test {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
}
}
tasks.jar {
archiveBaseName.set(project.name)
}
}