-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
109 lines (91 loc) · 2.92 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
import java.net.URI
plugins {
id("java-library")
id("com.diffplug.spotless") version "6.25.0"
id("maven-publish")
id("signing")
}
group = "io.github.spiderpig86"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation("com.google.guava:guava:32.1.2-jre")
testImplementation(platform("org.junit:junit-bom:5.11.4"))
testImplementation("org.junit.jupiter:junit-jupiter")
testCompileOnly("org.projectlombok:lombok:1.18.34")
testAnnotationProcessor("org.projectlombok:lombok:1.18.34")
testImplementation("org.mockito:mockito-core:5.+")
testImplementation("org.mockito:mockito-junit-jupiter:5.5.0")
}
tasks.test {
useJUnitPlatform()
}
spotless {
java {
target("src/**/*.java") // configure the files to apply the formatting to
googleJavaFormat() // apply the Google Java formatter
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "jayflake"
version = "0.1"
from(components["java"])
pom {
name.set("Jayflake")
description.set("Snowflake ids for Java.")
url.set("https://github.com/Spiderpig86/jayflake")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/Spiderpig86/jayflake/blob/master/LICENSE")
}
}
developers {
developer {
id.set("spiderpig86")
name.set("Stanley Lim")
}
}
scm {
connection.set("scm:git:git:https://github.com/Spiderpig86/jayflake.git")
developerConnection.set("scm:git:ssh://github.com:Spiderpig86/jayflake.git")
url.set("https://github.com/Spiderpig86/jayflake")
}
}
}
}
repositories {
maven {
name = "OSSHR"
url = URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["ossrhUsername"].toString()
password = project.properties["ossrhPassword"].toString()
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
// For debugging
task("printProperties") {
println(project.findProperty("signing"))
println(project.findProperty("ossrhUsername").toString())
}