-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
163 lines (142 loc) · 5.17 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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("java-library")
id("maven-publish")
id("com.github.ben-manes.versions") version "0.51.0"
id("com.jfrog.bintray") version "1.8.5"
id("org.springframework.boot") version "2.7.18"
id("com.adarshr.test-logger") version "4.0.0"
}
group = "de.inoxio"
version = "1.2.0"
description = "A java-spring library to push metrics to cloudwatch"
apply {
plugin("io.spring.dependency-management")
}
repositories {
mavenCentral()
}
dependencies {
// spring
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-json")
// aws
implementation("software.amazon.awssdk:cloudwatch:2.26.20")
// test
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("nl.jqno.equalsverifier:equalsverifier:3.16.1")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
val sourcesJar by tasks.registering(Jar::class) {
dependsOn + "classes"
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
dependsOn + "javadoc"
archiveClassifier.set("javadoc")
from(tasks.withType<Javadoc>().first().destinationDir)
}
publishing {
publications {
register("publication", MavenPublication::class) {
groupId = project.group as String
artifactId = project.name
version = project.version as String
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
pom.withXml {
asNode().apply {
appendNode("description", project.description)
appendNode("name", "$groupId:$artifactId")
appendNode("url", "https://github.com/inoxio/${project.name}")
val license = appendNode("licenses").appendNode("license")
license.appendNode("name", "The Apache Software License, Version 2.0")
license.appendNode("url", "http://www.apache.org/licenses/LICENSE-2.0.txt")
val developer = appendNode("developers").appendNode("developer")
developer.appendNode("name", "Michael Kunze")
developer.appendNode("email", "[email protected]")
developer.appendNode("organization", "inoxio Quality Services GmbH")
developer.appendNode("organizationUrl", "https://www.inoxio.de")
val scm = appendNode("scm")
scm.appendNode("connection", "scm:git:git://github.com/inoxio/${project.name}.git")
scm.appendNode("developerConnection", "scm:git:ssh://github.com:inoxio/${project.name}.git")
scm.appendNode("url", "http://github.com/inoxio/${project.name}/tree/master")
}
}
}
}
}
bintray {
user = properties["bintray.user"] as String?
?: System.getenv("BINTRAY_USER")
key = properties["bintray.api-key"] as String?
?: System.getenv("BINTRAY_API_KEY")
setPublications("publication")
publish = true
override = false
pkg.apply {
repo = "maven"
name = project.name
userOrg = "inoxio"
desc = project.description
websiteUrl = "https://github.com/inoxio/${project.name}"
issueTrackerUrl = "https://github.com/inoxio/${project.name}/issues"
vcsUrl = "https://github.com/inoxio/${project.name}.git"
setLicenses("Apache-2.0")
githubRepo = "inoxio/${project.name}"
version.apply {
name = project.version as String
vcsTag = project.version as String
gpg.apply {
sign = true
}
mavenCentralSync.apply {
sync = true
user = properties["oss.user"] as String?
?: System.getenv("OSS_USER")
password = properties["oss.password"] as String?
?: System.getenv("OSS_PASSWORD")
close = "1"
}
}
}
}
tasks {
withType<JavaCompile> {
options.apply {
isFork = true
isIncremental = true
encoding = "UTF-8"
compilerArgs = mutableListOf("-Xlint")
}
}
withType<Jar> {
enabled = true
}
withType<BootJar> {
enabled = false
}
withType<Test> {
useJUnitPlatform()
}
withType<DependencyUpdatesTask> {
rejectVersionIf {
listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea", "pr")
.any { qualifier -> "(?i).*[.-]$qualifier[.\\d-+]*".toRegex().matches(candidate.version) }
}
}
withType<Wrapper> {
distributionType = ALL
gradleVersion = "8.9"
}
withType<Javadoc> {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}