-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathbuild.gradle
More file actions
209 lines (183 loc) · 6.39 KB
/
Copy pathbuild.gradle
File metadata and controls
209 lines (183 loc) · 6.39 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '2.4.10' // only for tests, see gradle.properties
id 'jacoco'
id 'org.sonarqube' version '7.5.0.8588'
id 'com.diffplug.spotless' version '7.2.1'
id 'distribution'
id 'signing'
id 'me.champeau.jmh' version "0.7.3"
id 'io.github.gradle-nexus.publish-plugin' version "2.0.0"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'org.glassfish:javax.json:1.1.4'
implementation 'com.worksap.nlp:jdartsclone:1.2.0'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation 'org.hamcrest:hamcrest-library:3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.openjdk.jmh:jmh-core:1.37'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.4.10'
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:2.4.10'
}
group = 'com.worksap.nlp'
version = '0.8.2-SNAPSHOT'
description = 'Sudachi Japanese Morphological Analyzer'
java.sourceCompatibility = JavaVersion.VERSION_1_8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release.set(8)
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
}
}
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
jacocoTestReport {
reports {
xml.required = true
}
}
sonar {
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "worksapplications"
property "sonar.projectKey", "com.worksap.nlp.sudachi"
property "sonar.language", "java"
property "sonar.links.homepage", "https://github.com/WorksApplications/Sudachi"
property "sonar.links.ci", "https://github.com/WorksApplications/Sudachi/actions"
property "sonar.links.issue", "https://github.com/WorksApplications/Sudachi/issues"
}
}
// See https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
// triggers https://github.com/diffplug/spotless/issues/911
// ratchetFrom 'origin/develop'
encoding 'UTF-8' // all formats will be interpreted as UTF-8
format 'misc', {
target '*.gradle', '*.md', '.gitignore', '*.txt', '*.csv'
trimTrailingWhitespace()
leadingTabsToSpaces(2)
endWithNewline()
}
java {
// don't need to set target, it is inferred from java
// version list: https://github.com/diffplug/spotless/tree/main/lib-extra/src/main/resources/com/diffplug/spotless/extra/eclipse_jdt_formatter
eclipse('4.21').configFile('.formatter/eclipse-formatter.xml')
licenseHeaderFile('.formatter/license-header')
}
kotlin {
// by default the target is every '.kt' and '.kts` file in the java sourcesets
ktfmt('0.36')
licenseHeaderFile('.formatter/license-header')
}
}
jar {
manifest {
attributes "Main-Class": 'com.worksap.nlp.sudachi.SudachiCommandLine'
attributes "Class-Path": configurations.runtimeClasspath.collect { it.name }.join(" ")
}
}
distributions {
executable {
contents {
from jar
from configurations.runtimeClasspath
from fileTree('.') {
include "README*"
include "LICENSE*"
include "licenses/*"
}
from fileTree("src/main/resources") {
include "sudachi.json"
}
into "/"
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/WorksApplications/Sudachi")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
maven(MavenPublication) {
from(components.java)
pom {
url = "https://github.com/WorksApplications/Sudachi"
name = 'Sudachi'
description = project.description
packaging = 'jar'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'kazuma-t'
name = 'Kazuma TAKAOKA'
email = 'takaoka_k@worksap.co.jp'
timezone = 'Asia/Tokyo'
}
}
scm {
connection = 'scm:git:https://github.com/WorksApplications/Sudachi.git'
developerConnection = 'scm:git:ssh://git@github.com:WorksApplications/Sudachi.git'
url = 'https://github.com/WorksApplications/Sudachi'
}
issueManagement {
system = 'Github Issues'
url = 'https://github.com/WorksApplications/Sudachi/issues'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
username = project.findProperty("maven.user") ?: System.getenv("MAVEN_USERNAME")
password = project.findProperty("maven.password") ?: System.getenv("MAVEN_USER_PASSWORD")
}
}
}
signing {
def signingKey = project.findProperty("gpg.key") ?: System.getenv("MAVEN_GPG_PRIVATE_KEY")
def signingPassword = project.findProperty("gpg.password") ?: System.getenv("MAVEN_GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
required = { !project.version.endsWith("-SNAPSHOT") }
sign publishing.publications.maven
}
jmh {
jmhVersion = "1.37"
includeTests = true
}