-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
95 lines (82 loc) · 2.89 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
plugins {
`java-library`
`maven-publish`
`signing`
}
group = "kr.jclab.javautils"
version = Version.PROJECT
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks.withType<JavaCompile>() {
options.encoding = "UTF-8"
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.20")
annotationProcessor("org.projectlombok:lombok:1.18.20")
testCompileOnly("org.projectlombok:lombok:1.18.20")
testAnnotationProcessor("org.projectlombok:lombok:1.18.20")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
implementation("org.apache.commons:commons-lang3:3.11")
implementation("commons-io:commons-io:2.8.0")
implementation("net.java.dev.jna:jna:5.6.0")
implementation("net.java.dev.jna:jna-platform:5.6.0")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.name)
description.set("cross-platform system information")
url.set("https://github.com/jc-lab/javautils-system-information")
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("jclab")
name.set("Joseph Lee")
email.set("joseph@jc-lab.net")
}
}
scm {
connection.set("scm:git:https://github.com/jc-lab/javautils-system-information.git")
developerConnection.set("scm:git:ssh://git@github.com/jc-lab/javautils-system-information.git")
url.set("https://github.com/jc-lab/javautils-system-information")
}
}
}
}
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".endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = findProperty("ossrhUsername") as String?
password = findProperty("ossrhPassword") as String?
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications)
}
tasks.withType<Sign>().configureEach {
onlyIf { project.hasProperty("signing.gnupg.keyName") || project.hasProperty("signing.keyId") }
}