-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
149 lines (130 loc) · 4.23 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
import java.util.*
plugins {
java
`maven-publish`
id("com.jfrog.bintray") version Version.bintray
id("io.freefair.lombok") version Version.freefairPlugin
id("com.github.johnrengelman.shadow") version Version.shadow
}
allprojects {
if ("$version".startsWith("v")) {
version = "$version".substring(1)
}
repositories {
jcenter()
}
pluginManager.withPlugin("io.freefair.lombok") {
lombok {
config.put("lombok.anyConstructor.addConstructorProperties", "true")
}
}
pluginManager.withPlugin("com.jfrog.bintray") {
bintray {
user = bintrayUser
key = bintrayApiKey
setPublications("maven")
pkg.apply {
userOrg = bintrayUser
repo = "Java"
name = "HiRezAPI"
desc = rootProject.description
setLicenses("MIT")
publicDownloadNumbers = true
vcsUrl = "${RootProject.githubUrl}.git"
version.apply {
name = "${project.version}"
vcsTag = "v${project.version}"
released = "${Date()}"
}
}
}
}
}
subprojects {
apply(plugin = "maven-publish")
apply(plugin = "com.jfrog.bintray")
if (name != "bom") {
apply(plugin = "java")
apply(plugin = "io.freefair.lombok")
apply(plugin = "com.github.johnrengelman.shadow")
java {
if (name != "all") {
withSourcesJar()
}
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
base {
archivesBaseName = artifactId
}
dependencies {
if (name != "all") {
compileOnly(lombok)
annotationProcessor(lombok)
compile(slf4j)
compile("com.google.code.findbugs:jsr305:3.0.2")
testImplementation("ch.qos.logback:logback-classic:${Version.logback}")
}
}
publishing.publications.withType<MavenPublication> {
from(components["java"])
}
tasks {
withType<JavaCompile> {
options.apply {
isIncremental = true
encoding = "UTF-8"
}
}
jar {
manifest {
attributes(
"Manifest-Version" to "1.0",
"Created-By" to "Gradle ${gradle.gradleVersion} - JDK ${System.getProperty("java.specification.version")} (${System.getProperty("java.version")})",
"Implementation-Title" to rootProject.name,
"Implementation-Vendor" to base.archivesBaseName,
"Implementation-Version" to project.version,
"Implementation-Date" to project.currentTimestamp
)
}
}
shadowJar {
isEnabled = name != "api"
archiveClassifier.set("shaded")
}
withType<Javadoc> {
options {
encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible) {
(this as StandardJavadocDocletOptions).addBooleanOption("-no-module-directories", true)
}
}
}
}
}
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = project.artifactId
pom {
default()
}
}
}
}
}
tasks {
wrapper {
gradleVersion = "6.5"
distributionType = Wrapper.DistributionType.ALL
}
create<ReleaseAssets>("releaseAssets") {
dependsOn(shadowJar)
onlyIf { !githubToken.isNullOrBlank() }
jarFiles = files(*globalProjects.mapNotNull {
if (it.name == "api") null
else (it.tasks.findByName("shadowJar") as? org.gradle.jvm.tasks.Jar)?.archiveFile?.get()?.asFile
}.toTypedArray())
}
}