-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
77 lines (66 loc) · 1.76 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
plugins {
java
signing
distribution
maven
id("com.diffplug.spotless") version "6.12.0"
id("org.omegat.gradle") version "1.5.11"
}
version = "0.0.1"
omegat {
version = "6.0.0"
pluginClass = "org.omegat.filters2.text.dokuwiki.DokuWikiFilter"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
dependencies {
packIntoJar("org.slf4j:slf4j-api:2.0.7")
implementation("commons-io:commons-io:2.5")
implementation("commons-lang:commons-lang:2.6")
implementation("org.slf4j:slf4j-nop:2.0.7")
testImplementation("junit:junit:4.13")
testImplementation("xmlunit:xmlunit:1.6")
testImplementation("org.madlonkay.supertmxmerge:supertmxmerge:2.0.1")
testImplementation("com.alibaba:fastjson:1.2.17")
}
distributions {
main {
contents {
from(tasks["jar"], "README.md", "COPYING", "CHANGELOG.md")
}
}
}
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" -> {/* do nothing */
}
"signing.gnupg.keyName" -> {
useGpgCmd()
}
}
sign(tasks.distZip.get())
sign(tasks.jar.get())
}
val jar by tasks.getting(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
spotless {
java {
target(listOf("src/*/java/**/*.java"))
removeUnusedImports()
palantirJavaFormat()
importOrder("org.omegat", "java", "javax", "", "\\#")
}
}