-
Notifications
You must be signed in to change notification settings - Fork 60
/
build.gradle.kts
149 lines (131 loc) · 3.79 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 com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
}
group = "net.sizovs"
version = project.findProperty("version") ?: "UNSPECIFIED"
plugins {
java
jacoco
signing
id("com.diffplug.spotless") version "6.12.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("maven-publish")
}
spotless {
java {
googleJavaFormat()
}
}
tasks.register<ShadowJar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
tasks.register<ShadowJar>("javadocJar") {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
from(tasks.javadoc.get().destinationDir)
}
val projectUrl = "https://github.com/sizovs/pipelinr"
publishing {
publications {
create<MavenPublication>("mavenJava") {
project.extensions.configure<ShadowExtension>() {
component(this@create)
}
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set("PipelinR")
description.set("A lightweight command processing pipeline ❍ ⇢ ❍ ⇢ ❍ for your Java awesome app.")
url.set(projectUrl)
}
pom.licenses {
license {
name.set("MIT License")
url.set(projectUrl)
distribution.set("repo")
}
}
pom.developers {
developer {
id.set("sizovs")
name.set("Eduards Sizovs")
email.set("[email protected]")
}
}
pom.scm {
url.set(projectUrl)
connection.set(projectUrl)
developerConnection.set(projectUrl)
}
}
}
repositories {
maven {
name = "Nexus"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
val nexusUser: String? by project
val nexusPassword: String? by project
username = nexusUser
password = nexusPassword
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
tasks.create<ConfigureShadowRelocation>("relocateShadowJar") {
target = tasks["shadowJar"] as ShadowJar
prefix = "an.awesome.pipelinr.repack"
}
tasks {
named<Jar>("jar") {
enabled = false
}
withType<GenerateModuleMetadata> {
enabled = false
}
named<ShadowJar>("shadowJar") {
dependsOn("relocateShadowJar")
archiveClassifier.set("")
}
named<JacocoReport>("jacocoTestReport") {
reports {
xml.required.set(true)
html.required.set(false)
}
}
test {
useJUnitPlatform()
}
check {
dependsOn(jacocoTestReport)
}
}
repositories {
mavenLocal()
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation("com.google.guava:guava:33.3.1-jre")
testImplementation("org.junit.jupiter:junit-jupiter:5.4.0")
testImplementation("org.junit.platform:junit-platform-runner:1.4.0")
testImplementation("org.assertj:assertj-core:3.11.1")
testImplementation("org.mockito:mockito-core:2.24.0")
testImplementation("org.mockito:mockito-junit-jupiter:2.24.0")
}