-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·128 lines (108 loc) · 3.48 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
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
id "org.sonarqube" version "2.6.1"
id "io.codearte.nexus-staging" version "0.11.0"
}
printf "Date: %s\nHost: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGradle: %s Groovy: %s Java: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
InetAddress.getLocalHost(),
System.getProperty("os.name"),
System.getProperty("os.arch"),
System.getProperty("os.version"),
System.getProperty("java.version"),
System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"),
gradle.gradleVersion, GroovySystem.getVersion(), JavaVersion.current()
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
repositories {
mavenCentral()
}
configurations {
wagon
distJars {
extendsFrom runtime
exclude group: 'org.elasticsearch'
exclude module: 'lucene-core'
exclude module: 'lucene-analyzers-common'
exclude module: 'jts'
exclude module: 'log4j-api'
exclude module: 'log4j-core'
exclude module: 'jna'
exclude module: 'jackson-core'
exclude module: 'jackson-dataformat-smile'
exclude module: 'jackson-dataformat-yaml'
}
}
apply from: 'gradle/ext.gradle'
dependencies {
implementation "org.elasticsearch:elasticsearch:${project.property('elasticsearch.version')}"
testImplementation "junit:junit:${project.property('junit.version')}"
testImplementation "org.elasticsearch.plugin:transport-netty4-client:${project.property('elasticsearch.version')}"
distJars "${project.group}:${project.name}:${project.version}"
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-profile" << "compact2"
}
test {
systemProperties['path.home'] = System.getProperty("user.dir")
testLogging {
showStandardStreams = false
exceptionFormat = 'full'
}
}
task makePluginDescriptor(type: Copy) {
from 'src/main/templates'
into 'build/tmp/plugin'
expand([
'descriptor': [
'name': pluginName,
'classname': pluginClassname,
'description': pluginDescription,
'version': project.property('version'),
'javaVersion': project.property('targetCompatibility'),
'elasticsearchVersion' : project.property('elasticsearch.version')
]
])
}
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
from configurations.distJars
from 'build/tmp/plugin'
into 'elasticsearch'
classifier = 'plugin'
}
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
delete "plugins"
from configurations.distJars
from 'build/tmp/plugin'
into "plugins/${pluginName}"
}
clean {
delete "plugins"
delete "data"
delete "logs"
}
task javadocJar(type: Jar, dependsOn: classes) {
from javadoc
classifier 'javadoc'
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier 'sources'
}
artifacts {
archives javadocJar, sourcesJar, buildPluginZip
}
if (project.hasProperty('signing.keyId')) {
signing {
sign configurations.archives
}
}