-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
237 lines (219 loc) · 8.02 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
jacoco
signing
kotlin(PluginLibs.jvm) version PluginLibs.Version.jvm
id(PluginLibs.sonarQube) version PluginLibs.Version.sonarQube
id(PluginLibs.nexusPublish) version PluginLibs.Version.nexusPublish
id(PluginLibs.gradlePluginPublish) version PluginLibs.Version.gradlePluginPublish
}
repositories {
mavenLocal()
maven { url = uri("https://oss.sonatype.org/content/groups/public/") }
gradlePluginPortal()
}
group = "cloud.playio"
version = "$version${prop(project, "semanticVersion")}"
gradlePlugin {
plugins {
create("oss") {
id = "cloud.playio.gradle.oss"
displayName = "OSS Project plugin"
description = "This plugin adds some utilities in project for build/maven distribution"
implementationClass = "cloud.playio.gradle.OSSProjectPlugin"
}
create("root") {
id = "cloud.playio.gradle.root"
displayName = "Root Project plugin"
description = "This plugin adds some utilities in root project in a multi-project build"
implementationClass = "cloud.playio.gradle.RootProjectPlugin"
}
create("app") {
id = "cloud.playio.gradle.qwe.app"
displayName = "QWE Application plugin"
description = "This plugin adds Generator/Bundle capabilities to QWE Application"
implementationClass = "cloud.playio.gradle.qwe.app.QWEAppPlugin"
}
create("docker") {
id = "cloud.playio.gradle.qwe.docker"
displayName = "QWE Docker plugin"
description = "This plugin adds Docker capabilities to build/push Docker image for QWE application"
implementationClass = "cloud.playio.gradle.qwe.docker.QWEDockerPlugin"
}
create("antora") {
id = "cloud.playio.gradle.antora"
displayName = "Antora plugin"
description =
"This plugin adds Antora capabilities to generate Asciidoc and construct Antora document component"
implementationClass = "cloud.playio.gradle.antora.AntoraPlugin"
}
create("pandoc") {
id = "cloud.playio.gradle.pandoc"
displayName = "Pandoc plugin"
description = "This plugin adds Pandoc capabilities to convert from one markup format to another"
implementationClass = "cloud.playio.gradle.pandoc.PandocPlugin"
}
create("docgen") {
id = "cloud.playio.gradle.docgen"
displayName = "Docgen plugin"
description = "This plugin adds document gen capabilities"
implementationClass = "cloud.playio.gradle.generator.docgen.DocgenPlugin"
}
create("codegen") {
id = "cloud.playio.gradle.codegen"
displayName = "Codegen plugin"
description = "This plugin adds code gen capabilities"
implementationClass = "cloud.playio.gradle.generator.codegen.CodegenPlugin"
}
}
}
pluginBundle {
website = "https://github.com/play-iot/gradle-plugin"
vcsUrl = "https://github.com/play-iot/gradle-plugin.git"
tags = listOf("playio")
pluginTags = mapOf(
"oss" to listOf("mapOf"),
"root" to listOf("abc"),
"antora" to listOf("documentation", "antora"),
"pandoc" to listOf("documentation", "pandoc"),
"docgen" to listOf("documentation", "docgen", "asciidoc"),
"codegen" to listOf("codegen", "vertx-codegen"),
"app" to listOf("app", "playio-app"),
"docker" to listOf("docker", "playio-containerized-app"),
)
}
dependencies {
api(PluginLibs.Depends.nexusPublish)
api(PluginLibs.Depends.testLogger)
api(PluginLibs.Depends.jacocoLogger)
api(PluginLibs.Depends.sonarQube)
api(PluginLibs.Depends.shadow)
api(PluginLibs.Depends.yaml)
api(PluginLibs.Depends.testcontainers)
api(PluginLibs.Depends.docker)
compileOnly(PluginLibs.Depends.jooq)
testImplementation(TestLibs.junit5Api)
testImplementation(TestLibs.junit5Engine)
constraints {
implementation("org.apache.logging.log4j:log4j-core") {
version {
strictly("[2.17, 3[")
}
because("CVE-2021-44228, CVE-2021-45046, CVE-2021-45105: Log4j vulnerable to remote code execution and other critical security vulnerabilities")
}
}
}
sourceSets {
main { java.srcDirs("src/main/java", "src/main/kotlin") }
test { java.srcDirs("src/test/java", "src/test/kotlin") }
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks {
test {
useJUnitPlatform()
finalizedBy(jacocoTestReport)
}
jacocoTestReport {
dependsOn(test)
reports {
csv.required.set(false)
xml.required.set(true)
html.outputLocation.set(file("${buildDir}/jacocoHtml"))
}
}
named("sonarqube") {
group = "analysis"
dependsOn(assemble, jacocoTestReport)
}
withType<Sign>().configureEach {
onlyIf { project.hasProperty("release") }
}
register("publishToGitHub") {
group = "publishing"
dependsOn("publishMavenPublicationToGitHubPackagesRepository")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group as String?
artifactId = project.name
version = project.version as String?
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
afterEvaluate {
withType<MavenPublication> {
pom {
name.set(prop(project, "title"))
description.set(prop(project, "description"))
url.set("https://github.com/play-iot/gradle-plugin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/play-iot/gradle-plugin/blob/main/LICENSE")
}
}
developers {
developer {
id.set("playio-dev")
email.set("dev@playio.cloud")
organization.set("playio")
organizationUrl.set("playio.cloud")
}
}
scm {
connection.set("scm:git:git://git@github.com:play-iot/gradle-plugin.git")
url.set("https://github.com/play-iot/gradle-plugin")
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("${project.property("github.nexus.url")}/${project.property("github.repo")}")
credentials {
username = project.property("nexus.username") as String?
password = project.property("nexus.password") as String?
}
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications)
}
sonarqube {
properties {
property("jacocoHtml", "false")
property("sonar.sourceEncoding", "UTF-8")
property("sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/coverage.xml")
}
}
nexusPublishing {
packageGroup.set("cloud.playio")
repositories {
sonatype {
nexusUrl.set(uri(prop(project, "ossrh.release.url")))
snapshotRepositoryUrl.set(uri(prop(project, "ossrh.snapshot.url")))
username.set(project.property("nexus.username") as String?)
password.set(project.property("nexus.password") as String?)
}
}
}