forked from lucene-gosen/lucene-gosen
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
173 lines (154 loc) · 5.19 KB
/
build.gradle
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
id 'base'
id 'java-library'
id 'maven-publish'
id 'signing'
alias(libs.plugins.nexus.publish)
id 'idea'
}
repositories {
mavenCentral()
}
group 'org.omegat.lucene.lucene-gosen'
description 'Japanese analysis for Apache Lucene'
version = "8.11.0"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
withJavadocJar()
}
dependencies {
implementation(libs.lucene.core)
implementation(libs.lucene.analyzers.common)
implementation(libs.lucene.codecs)
implementation(libs.icu4j)
testImplementation(libs.junit)
testImplementation(libs.lucene.test.framework)
testImplementation(libs.randomizedtesting)
}
javadoc {
options.locale = 'en_US'
}
// Re-build dictionary with user custom dictionaries, without copy
tasks.register('rebuildNaistChasenDic') {
doLast {
println "rebuilding dictionary"
}
dependsOn(compileJava, ":dictionary:cleanCompiledNaistChasen", ":dictionary:compileNaistChasen")
}
tasks.register('rebuildIpadicDic') {
doLast {
println "rebuilding dictionary"
}
dependsOn(compileJava, ":dictionary:cleanCompiledIpadic", ":dictionary:compileIpadic")
}
// Create Jar library without dictionary
tasks.register('jarWithNaistChasen', Jar) {
archiveClassifier = naistDictype
from files(sourceSets.main.output,
fileTree("dictionary" + File.separator
+ naistDictype + File.separator + compiledDicDir).include('**/*.sen')
)
dependsOn(compileJava, ":dictionary:compileNaistChasen")
}
tasks.register('jarWithIpadic', Jar) {
archiveClassifier = ipadicDictype
from files(sourceSets.main.output,
fileTree("dictionary" + File.separator
+ ipadicDictype + File.separator + compiledDicDir).include('**/*.sen')
)
dependsOn(compileJava, ":dictionary:compileIpadic")
}
// Make packages for distribution
tasks.build.dependsOn(jarWithIpadic, jarWithNaistChasen)
tasks.classes.dependsOn(":dictionary:compileNaistChasen", ":dictionary:compileIpadic")
configurations {
conf
}
def ipadicArtifact = artifacts.add('conf', jarWithIpadic.archiveFile.get().asFile) {
type ipadicDictype
builtBy jarWithIpadic
}
def naistArtifact = artifacts.add('conf', jarWithNaistChasen.archiveFile.get().asFile) {
type naistDictype
builtBy jarWithNaistChasen
}
artifacts {
archives jar, sourcesJar, javadocJar
archives file: jarWithIpadic.archivePath, name: ipadicDictype, builtBy: jarWithIpadic
archives file: jarWithNaistChasen.archivePath, name: naistDictype, builtBy: jarWithNaistChasen
}
javadoc {
failOnError = false
options {
jFlags('-Duser.language=en')
addStringOption('locale', 'en_US')
addStringOption('bottom', '<span>Copyright 2000-2024, OmegaT project and contributors</span>')
addStringOption('encoding', 'UTF-8')
addBooleanOption("Xdoclint:none", true)
addBooleanOption('frames', false)
addBooleanOption('public', true)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
publishing {
publications {
mavenJava(MavenPublication) { publication ->
groupId = 'org.omegat.lucene'
artifactId = 'lucene-gosen'
from components.java
artifact ipadicArtifact
artifact naistArtifact
pom {
name = 'Lucene-Gosen'
description = 'Lucene-Gosen'
url = 'https://omegat.org'
scm {
connection = "scm:git:https://github.com/omegat-org/lucene-gosen"
developerConnection = "scm:git:https://github.com/omegat-org/lucene-gosen"
url = "https://github.com/omegat-org/lucene-gosen"
}
licenses {
license {
name = 'The GNU Lesser General Public License, Version 2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html'
}
}
developers {
developer {
id = 'omegat'
name = 'OmegaT Developers'
email = '[email protected]'
}
}
}
}
}
}
nexusPublishing {
repositories.sonatype {
// stagingProfileId = '15818299f2c2bb'
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
signing {
if (project.hasProperty("signingKey")) {
def signingKey = findProperty("signingKey").toString()
def signingPassword = findProperty("signingPassword").toString()
useInMemoryPgpKeys(signingKey, signingPassword)
} else {
useGpgCmd()
}
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
def hasKey = project.hasProperty("signingKey") || project.hasProperty("signing.gnupg.keyName")
onlyIf { hasKey && !project.version.toString().endsWith("-SNAPSHOT") }
}