-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
112 lines (101 loc) · 2.62 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
plugins {
`java-library`
`java-test-fixtures`
checkstyle
pmd
alias(libs.plugins.spotbugs)
`maven-publish`
signing
}
group = "io.github.fluxroot"
version = "1.1.0-SNAPSHOT"
dependencies {
testImplementation(libs.junit)
testImplementation(libs.assertj)
testImplementation(libs.mockito)
testFixturesImplementation(libs.assertj)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
withSourcesJar()
withJavadocJar()
}
tasks.jar {
manifest {
attributes("Automatic-Module-Name" to "io.github.fluxroot.result")
}
}
tasks.test {
useJUnitPlatform()
}
checkstyle {
config = resources.text.fromFile("$rootDir/config/checkstyle/checkstyle.xml")
configDirectory.set(file("$rootDir/config/checkstyle"))
}
pmd {
ruleSets = listOf()
ruleSetConfig = resources.text.fromFile("$rootDir/config/pmd/main-ruleset.xml")
}
tasks.pmdTest {
ruleSets = listOf()
ruleSetConfig = resources.text.fromFile("$rootDir/config/pmd/test-ruleset.xml")
}
tasks.pmdTestFixtures {
ruleSets = listOf()
ruleSetConfig = resources.text.fromFile("$rootDir/config/pmd/testFixtures-ruleset.xml")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("Result")
description.set("A Result monad implementation for Java")
url.set("https://github.com/fluxroot/result")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("fluxroot")
name.set("Phokham Nonava")
}
}
scm {
connection.set("scm:git:git@github.com:fluxroot/result.git")
developerConnection.set("scm:git:git@github.com:fluxroot/result.git")
url.set("https://github.com/fluxroot/result")
}
}
}
}
repositories {
maven {
val releasesRepository = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotRepository = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotRepository else releasesRepository
credentials {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
if (ossrhUsername != null && ossrhPassword != null) {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
signing {
val signingKeyId: String? by project
val signingKey: String? by project
val signingPassword: String? by project
if (signingKeyId != null && signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
}