forked from optimaize/language-detector
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
130 lines (118 loc) · 3.6 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
128
129
130
plugins {
`java-library`
`maven-publish`
signing
alias(libs.plugins.nexus.publish)
}
repositories {
mavenCentral()
}
dependencies {
implementation(libs.jsonic)
implementation(libs.jetbrains.annotations)
implementation(libs.guava)
implementation(libs.slf4j.api)
testImplementation(libs.testng)
testImplementation(libs.junit4)
testImplementation(libs.hamcrest.core)
testImplementation(libs.hamcrest.library)
testImplementation(libs.mockito)
testImplementation(libs.logback)
}
group = "org.omegat"
version = "0.6-2"
description = "language-detector"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
withSourcesJar()
withJavadocJar()
}
tasks.jar {
manifest {
attributes("Automatic-Module-Name" to "org.omegat.languagedetector")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("language-detector")
description.set("language-detector")
url.set("https://github.com/omegat-org/language-detector")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/")
distribution.set("repo")
}
}
developers {
developer {
id.set("miurahr")
name.set("Hiroshi Miura")
email.set("[email protected]")
}
developer {
name.set("Nakatani Shuyo")
}
developer {
name.set("Fabian Kessler")
}
developer {
name.set("François ROLAND")
}
developer {
name.set("Robert Theis")
}
}
scm {
connection.set("scm:git:git://github.com/omegat-org/language-detector.git")
developerConnection.set("scm:git:git://github.com/omegat-org/language-detector.git")
url.set("https://github.com/omegat-org/language-detector")
}
}
}
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-Xlint:deprecation")
options.compilerArgs.add("-Xlint:unchecked")
}
tasks.withType<Javadoc>() {
options.encoding = "UTF-8"
setFailOnError(false)
}
tasks.named<Test>("test") {
useTestNG()
}
val signKey = listOf("signingKey", "signing.keyId", "signing.gnupg.keyName").find {project.hasProperty(it)}
tasks.withType<Sign> {
onlyIf { signKey != null }
}
signing {
when (signKey) {
"signingKey" -> {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
"signing.keyId" -> {
}
"signing.gnupg.keyName" -> {
useGpgCmd()
}
}
sign(publishing.publications["mavenJava"])
}
nexusPublishing.repositories.sonatype {
val sonatypeUsername: String? by project
val sonatypePassword: String? by project
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(sonatypeUsername)
password.set(sonatypePassword)
}