-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
127 lines (115 loc) · 3.65 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
plugins {
`java-library`
`maven-publish`
signing
jacoco
}
val junitVersion = "5.6.2"
group = "io.github.kaginawa"
version = "0.2.0"
repositories {
mavenCentral()
}
dependencies {
implementation("jakarta.json.bind:jakarta.json.bind-api:1.0.2")
runtimeOnly("org.eclipse:yasson:1.0.8")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation("org.mockito:mockito-junit-jupiter:3.4.6")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
tasks {
withType<JavaCompile> {
options.compilerArgs = listOf("--module-path", classpath.asPath)
}
withType<Javadoc> {
options.locale = "en_US"
options.modulePath = classpath.toList()
(options as StandardJavadocDocletOptions).apply {
links("https://docs.oracle.com/en/java/javase/11/docs/api/")
}
}
test {
useJUnitPlatform()
finalizedBy(jacocoTestReport)
jvmArgs = listOf("--add-opens", "java.base/java.util=ALL-UNNAMED")
}
jacocoTestReport {
dependsOn(test)
reports {
xml.isEnabled = true
}
}
}
configurations {
implementation {
resolutionStrategy.failOnVersionConflict()
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "kaginawa-sdk-java"
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Kaginawa SDK for Java")
description.set("API client library for Kaginawa Server written in Java.")
url.set("https://github.com/kaginawa")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("mikan")
name.set("Yutaka Kato")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/kaginawa/kaginawa-sdk-java.git")
developerConnection.set("scm:git:ssh://github.com/kaginawa/kaginawa-sdk-java.git")
url.set("https://github.com/kaginawa/kaginawa-sdk-java")
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/kaginawa/kaginawa-sdk-java")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
sign(publishing.publications)
}