-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
189 lines (168 loc) · 5.64 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
buildscript {
ext {
pluginName = 'analysis-morfologik'
pluginClassname = 'pl.allegro.tech.elasticsearch.plugin.analysis.morfologik.AnalysisMorfologikPlugin'
pluginDescription = 'Morfologik Polish Lemmatizer plugin for Elasticsearch'
versions = [
'elasticsearch' : '8.16.1',
'lucene' : '8.11.3',
'log4j' : '2.20.0',
'spock' : '2.3-groovy-3.0',
'groovy' : '3.0.21',
'testcontainers': '1.19.7'
]
}
}
plugins {
id 'signing'
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin' version '1.2.0'
id 'com.adarshr.test-logger' version '4.0.0'
}
apply plugin: 'java'
apply plugin: 'groovy'
group = 'pl.allegro.tech.elasticsearch.plugin'
version = versions.elasticsearch
repositories {
mavenCentral()
}
configurations {
providedCompile
wagon
releaseJars {
extendsFrom implementation
exclude group: 'org.elasticsearch'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'org.slf4j'
exclude group: 'log4j'
exclude module: 'lucene-core'
exclude module: 'lucene-analyzers-common'
}
}
dependencies {
implementation(group: 'org.elasticsearch', name: 'elasticsearch', version: versions.elasticsearch) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-preallocate'
}
implementation(group: 'org.apache.lucene', name: 'lucene-analyzers-morfologik', version: versions.lucene) {
exclude group: 'ua.net.nlp'
}
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: versions.testcontainers
testImplementation group: 'org.apache.commons', name: 'commons-compress', version: '1.26.1'
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: versions.log4j
testImplementation group: 'org.spockframework', name: 'spock-core', version: versions.spock
testImplementation group: 'org.codehaus.groovy', name: 'groovy-all', version: versions.groovy
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(GroovyCompile).configureEach {
options.compilerArgs << "-proc:none"
}
test {
systemProperties['path.home'] = System.getProperty("user.dir")
systemProperties['elasticsearchVersion'] = versions.elasticsearch
useJUnitPlatform()
testLogging {
showStandardStreams = false
exceptionFormat = 'full'
}
}
testlogger {
theme 'mocha'
}
tasks.register('makePluginDescriptor', Copy) {
from 'src/main/templates'
into layout.buildDirectory.dir("tmp/plugin")
expand([
'descriptor': [
'name' : pluginName,
'classname' : pluginClassname,
'description' : pluginDescription,
'version' : project.property('version'),
'javaVersion' : JavaVersion.VERSION_17,
'elasticsearchVersion': versions.elasticsearch
]
])
}
task buildPluginZip(type: Zip, dependsOn: [':javadocJar', ':sourcesJar', ':jar', ':makePluginDescriptor']) {
from layout.buildDirectory.dir("libs")
from configurations.releaseJars
from 'build/tmp/plugin'
}
tasks.register('unpackPlugin', Copy) {
dependsOn[':buildPluginZip']
delete "plugins"
from layout.buildDirectory.dir("libs")
from configurations.releaseJars
from 'build/tmp/plugin'
into "plugins/${pluginName}"
}
tasks.withType(Test).configureEach {
testLogging {
exceptionFormat = 'full'
events = ["failed", "skipped", "passed"]
showCauses = true
showStackTraces = true
}
}
java {
withSourcesJar()
withJavadocJar()
}
artifacts {
archives buildPluginZip
}
wrapper {
gradleVersion = '8.9'
distributionType = Wrapper.DistributionType.ALL
}
publishing {
publications {
sonatype(MavenPublication) {
from components.java
artifact buildPluginZip
pom {
name = 'elasticsearch-analysis-morfologik'
description = 'Morfologik Polish Lemmatizer plugin for Elasticsearch'
url = 'https://github.com/allegro/elasticsearch-analysis-morfologik'
inceptionYear = '2017'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "pbobruk"
name = "Paweł Bobruk"
}
}
scm {
connection = "scm:[email protected]:allegro/elasticsearch-analysis-morfologik.git"
developerConnection = "scm:[email protected]:allegro/elasticsearch-analysis-morfologik.git"
url = "https://github.com/allegro/elasticsearch-analysis-morfologik"
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
if (System.getenv("GPG_KEY_ID")) {
signing {
useInMemoryPgpKeys(
System.getenv("GPG_KEY_ID"),
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_KEY_PASSWORD")
)
sign publishing.publications
}
}