-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
84 lines (74 loc) · 2.46 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
plugins {
id("java")
id("signing")
id("maven-publish")
}
group = "one.cafebabe"
version = "17.0.0"
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
java.toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
dependencies {
compileOnly("org.slf4j:slf4j-api:2.0.2")
compileOnly("org.jetbrains:annotations:23.0.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.1")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("--module-version", version.toString()))
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "businessCalendar4j"
from(components["java"])
pom {
name.set("businessCalendar4j")
description.set("businessCalendar4j")
url.set("https://github.com/yusuke/businessCalendar4j")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("yusuke")
name.set("Yusuke Yamamoto")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/yusuke/businessCalendar4j")
connection.set("scm:git:git://github.com/yusuke/businessCalendar4j.git")
developerConnection.set("scm:git:[email protected]:yusuke/businessCalendar4j.git")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = project.findProperty("SONATYPE_USERNAME") as String? ?: "none"
password = project.findProperty("SONATYPE_PASSWORD") as String? ?: "none"
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}