forked from omc/elasticsearch-stored-synonyms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
108 lines (91 loc) · 2.25 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
plugins {
id "java"
id "eclipse"
id "com.diffplug.spotless" version "5.6.1"
}
ext {
versions = [
"elasticsearch": System.getenv("esVersion") ?: project.properties['esVersion'],
"log4j" : "2.6.2"
]
}
spotless {
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
configurations {
releaseJars {
extendsFrom runtime
exclude group: "org.elasticsearch"
exclude group: "org.apache.logging.log4j"
}
}
version = pluginVersion + '_es' + versions.elasticsearch
dependencies {
compile "org.elasticsearch:elasticsearch:${versions.elasticsearch}"
compile "org.apache.logging.log4j:log4j-api:${versions.log4j}"
testCompile "org.codelibs:elasticsearch-cluster-runner:${versions.elasticsearch}.0"
testCompile "junit:junit:4.13"
testCompile "org.mockito:mockito-all:1.9.5"
releaseJars "${project.group}:${project.name}:${version}"
}
repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases-local' }
jcenter()
}
//-------------------
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked,deprecation"
}
task javadocJar(type: Jar, dependsOn: classes) {
from javadoc
into "build/tmp"
classifier "javadoc"
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
into "build/tmp/sources"
classifier "sources"
}
task copyPluginFiles(type: Copy) {
from "src/main/templates"
into "build/tmp/plugin"
expand([
"descriptor": [
"name" : pluginName,
"classname" : pluginClassname,
"description" : pluginDescription,
"version" : version,
"javaVersion" : project.property("targetCompatibility"),
"elasticsearchVersion": versions.elasticsearch
]
])
outputs.upToDateWhen { false }
}
task buildPluginZip(type: Zip, dependsOn: [":jar", "copyPluginFiles"]) {
from configurations.releaseJars
from "build/tmp/plugin"
from "src/main/config"
}
artifacts {
archives sourcesJar, buildPluginZip
}
test {
testLogging {
showStandardStreams = false
events "passed", "skipped", "failed"
exceptionFormat = 'full'
}
maxHeapSize = '2g'
useJUnit()
failFast = true
}