-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
107 lines (93 loc) · 3.11 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
/*
* Copyright (C) 2019 Knot.x Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
`java-platform`
id("io.knotx.maven-publish")
id("io.knotx.release-base")
}
defaultTasks("publishToMavenLocal")
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
group = "io.knotx"
description = "Knot.x Dependencies - BOM containing external Knot.x dependencies versions."
javaPlatform {
allowDependencies()
}
dependencies {
constraints {
api("io.vertx:vertx-rx-java2-gen:${prop("vertx.stack.version")}")
api("ch.qos.logback:logback-classic:${prop("logback-classic.version")}")
api("com.google.guava:guava:${prop("guava.version")}")
api("org.apache.commons:commons-lang3:${prop("commons-lang3.version")}")
api("org.apache.commons:commons-collections4:${prop("commons-collections4.version")}")
api("commons-io:commons-io:${prop("commons-io.version")}")
api("com.typesafe:config:${prop("typesafe.version")}")
api("org.mockito:mockito-core:${prop("mockito2.version")}")
api("org.mockito:mockito-junit-jupiter:${prop("mockito2.version")}")
api("org.wiremock:wiremock:${prop("wiremock.version")}")
api("me.alexpanov:free-port-finder:${prop("free-port-finder.version")}")
api("org.assertj:assertj-core:${prop("assertj.version")}")
}
api(platform("io.vertx:vertx-dependencies:${prop("vertx.stack.version")}"))
api(platform("org.junit:junit-bom:${prop("junit5.version")}"))
}
publishing {
publications {
getByName<MavenPublication>("mavenJava") {
pom {
inceptionYear.set("2016")
withXml {
asNode().apply {
appendNode("distributionManagement")
.apply {
appendNode("repository")
.apply {
appendNode("id", "ossrh")
appendNode("url", "https://oss.sonatype.org/service/local/staging/deploy/maven2/")
}
}
}
}
}
from(components["javaPlatform"])
}
}
}
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT")
tasks.withType<Sign>().configureEach {
onlyIf { project.extra["isReleaseVersion"] as Boolean }
}
fun prop(id: String): String = project.properties[id] as String
tasks {
named("build") {
mustRunAfter("setVersion")
}
named("updateChangelog") {
dependsOn("build", "setVersion")
}
register("prepare") {
group = "release"
dependsOn("updateChangelog", "publishToMavenLocal")
}
register("publishArtifacts") {
group = "release"
dependsOn("publish")
logger.lifecycle("Publishing java artifacts")
}
}