-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
146 lines (128 loc) · 3.43 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
buildscript {
if (gradle.includedBuilds.any { it.name == "plugins" }) {
plugins {
id("com.hivemq.version-updater")
}
}
}
plugins {
`java-library`
`maven-publish`
signing
alias(libs.plugins.nexusPublish)
alias(libs.plugins.defaults)
alias(libs.plugins.metadata)
alias(libs.plugins.javadocLinks)
alias(libs.plugins.license)
}
plugins.withId("com.hivemq.version-updater") {
project.ext["versionUpdaterFiles"] = arrayOf("README.adoc")
}
group = "com.hivemq"
description = "SDK for developing HiveMQ Swarm extensions."
metadata {
readableName = "HiveMQ Swarm Extension SDK"
organization {
name = "HiveMQ GmbH"
url = "https://www.hivemq.com/"
}
license {
apache2()
}
developers {
register("yweber") {
fullName = "Yannick Weber"
email = "[email protected]"
}
register("flimpoeck") {
fullName = "Florian Limpoeck"
email = "[email protected]"
}
register("lbrandl") {
fullName = "Lukas Brandl"
email = "[email protected]"
}
register("SgtSilvio") {
fullName = "Silvio Giebl"
email = "[email protected]"
}
register("dkrueger") {
fullName = "Daniel Krüger"
email = "[email protected]"
}
register("tseeberger") {
fullName = "Till Seeberger"
email = "[email protected]"
}
}
github {
issues()
}
}
repositories {
mavenCentral()
}
dependencies {
api(libs.dropwizard.metrics)
api(libs.slf4j.api)
implementation(libs.jetbrains.annotations)
}
/* ******************** java ******************** */
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
withJavadocJar()
withSourcesJar()
}
tasks.withType<Jar>().configureEach {
manifest.attributes(
"Implementation-Title" to project.name,
"Implementation-Vendor" to metadata.organization.provider.flatMap { it.name },
"Implementation-Version" to provider { project.version.toString() },
)
}
tasks.javadoc {
title = "${metadata.readableName.get()} ${project.version} API"
doLast {
javaexec {
classpath("gradle/tools/javadoc-cleaner-1.0.jar")
}
}
doLast { // javadoc search fix for jdk 11 https://bugs.openjdk.java.net/browse/JDK-8215291
copy {
from(destinationDir!!.resolve("search.js"))
into(temporaryDir)
filter { line -> line.replace("if (ui.item.p == item.l) {", "if (item.m && ui.item.p == item.l) {") }
}
delete(destinationDir!!.resolve("search.js"))
copy {
from(temporaryDir.resolve("search.js"))
into(destinationDir!!)
}
}
}
/* ******************** publishing ******************** */
publishing {
publications {
register<MavenPublication>("maven") {
from(components["java"])
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["maven"])
}
nexusPublishing {
repositories {
sonatype()
}
}
/* ******************** checks ******************** */
license {
header = file("HEADER")
mapping("java", "SLASHSTAR_STYLE")
}