forked from richardstartin/multi-matcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
156 lines (136 loc) · 5.39 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
import com.jfrog.bintray.gradle.BintrayExtension
plugins {
id("net.researchgate.release") version "2.8.0"
id("com.jfrog.bintray") version "1.8.4" apply false
id("com.github.kt3k.coveralls") version "2.8.4" apply false
}
// some parts of the Kotlin DSL don't work inside a `subprojects` block yet, so we do them the old way
// (without typesafe accessors)
subprojects {
// used in per-subproject dependencies
@Suppress("UNUSED_VARIABLE") val deps by extra {
mapOf(
"jupiter" to "5.5.2",
"jackson" to "2.10.0",
"guava" to "28.1-jre",
"roaringbitmap" to "0.8.13",
"fastutil" to "8.3.1",
"commons-collections" to "4.2"
)
}
apply(plugin = "java-library")
apply(plugin = "jacoco")
apply(plugin = "com.github.kt3k.coveralls")
repositories {
jcenter()
}
tasks.withType<JavaCompile> {
options.isDeprecation = true
options.isWarnings = true
if (JavaVersion.current().isJava9Compatible) {
options.compilerArgs = listOf("--release", "11")
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
group = "io.github.richardstartin"
}
tasks.named<JacocoReport>("jacocoTestReport") {
reports {
// used by coveralls
xml.isEnabled = true
}
}
}
subprojects.filter { listOf("multi-matcher-core").contains(it.name) }.forEach { project ->
project.run {
apply(plugin = "maven-publish")
apply(plugin = "com.jfrog.bintray")
tasks {
register<Jar>("sourceJar") {
from(project.the<SourceSetContainer>()["main"].allJava)
archiveClassifier.set("sources")
}
register<Jar>("docJar") {
from(project.tasks["javadoc"])
archiveClassifier.set("javadoc")
}
}
configure<PublishingExtension> {
publications {
register<MavenPublication>("bintray") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
artifact(tasks["sourceJar"])
artifact(tasks["docJar"])
// requirements for maven central
// https://central.sonatype.org/pages/requirements.html
pom {
name.set("${project.group}:${project.name}")
description.set("Fast classification/tagging of objects.")
url.set("https://github.com/richardstartin/multi-matcher")
issueManagement {
system.set("GitHub Issue Tracking")
url.set("https://github.com/richardstartin/multi-matcher/issues")
}
licenses {
license {
name.set("Apache 2")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("richardstartin")
name.set("Richard Startin")
email.set("richard@openkappa.co.uk")
url.set("https://richardstartin.github.io/multi-matcher")
roles.addAll("architect", "developer", "maintainer")
timezone.set("0")
}
}
scm {
connection.set("scm:git:https://github.com/richardstartin/multi-matcher.git")
developerConnection.set("scm:git:https://github.com/richardstartin/multi-matcher.git")
url.set("https://github.com/richardstartin/multi-matcher")
}
}
}
}
}
configure<BintrayExtension> {
user = rootProject.findProperty("bintrayUser")?.toString()
key = rootProject.findProperty("bintrayApiKey")?.toString()
setPublications("bintray")
with(pkg) {
repo = "maven"
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/richardstartin/multi-matcher"
// use "bintray package per artifact" to match the auto-gen'd pkg structure inherited from
// Maven Central's artifacts
name = "uk.co.openkappa:${project.name}"
userOrg = "multi-matcher"
with(version) {
name = project.version.toString()
released = java.util.Date().toString()
vcsTag = "multi-matcher-${project.version}"
}
}
}
}
}
tasks {
create("build") {
// dummy build task to appease release plugin
}
}
release {
tagTemplate = "multi-matcher-\$version"
}
tasks.afterReleaseBuild {
dependsOn(tasks.named("bintrayUpload"))
}