forked from sscarduzio/elasticsearch-readonlyrest-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
146 lines (126 loc) · 4.45 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
/*
* This file is part of ReadonlyREST.
*
* ReadonlyREST is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ReadonlyREST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ReadonlyREST. If not, see http://www.gnu.org/licenses/
*/
buildscript {
ext {
publishedPluginVersion = project.properties['pluginVersion']
pluginVersion = project.properties['pluginVersion']
esVersion = project.properties['esVersion']
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'org.elasticsearch.gradle:build-tools:' + esVersion
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.10.0'
}
}
group = 'org.elasticsearch.plugin'
version = pluginVersion + '_es' + esVersion
apply plugin: 'java'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'license'
repositories {
mavenCentral()
maven { url 'http://repo.gradle.org/gradle/libs-releases-local' }
}
esplugin {
name project.properties['pluginName']
description 'Safely expose Elasticsearch REST API'
classname 'org.elasticsearch.plugin.readonlyrest.es.ReadonlyRestPlugin'
}
license {
header rootProject.file('ReadonlyRESTLicenseHeader.txt')
skipExistingHeaders true
useDefaultMappings = false
mapping {
java = 'SLASHSTAR_STYLE'
}
}
task customJarHellCheck(type: JavaExec) {
main = "org.elasticsearch.bootstrap.JarHell"
classpath = project.sourceSets.main.runtimeClasspath.filter { it.exists() }
}
test {
dependsOn customJarHellCheck
systemProperty "project.dir", rootProject.projectDir
systemProperty "java.io.tmpdir", "/tmp"
}
configurations.all {
resolutionStrategy {
force "commons-logging:commons-logging:1.1.3"
force "junit:junit:4.12"
force "org.slf4j:slf4j-api:1.7.21"
force "commons-io:commons-io:2.5"
force "com.google.guava:guava:21.0"
}
}
dependencies {
compile 'com.google.guava:guava:21.0'
compile 'com.jayway.jsonpath:json-path:2.2.0'
compile 'com.unboundid:unboundid-ldapsdk:3.2.0'
compile 'net.minidev:accessors-smart:1.2'
compile 'net.minidev:json-smart:2.3'
compile 'org.elasticsearch.plugin:transport-netty4-client:' + esVersion
compile 'org.elasticsearch.client:rest:' + esVersion
compile 'org.jooq:jool:0.9.12'
compile 'org.yaml:snakeyaml:1.15'
compile ('org.reflections:reflections:0.9.11'){
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'org.slf4j', module: 'slf4j-simple'
exclude group: 'dom4j', module: 'dom4j'
exclude group: 'com.google.code.gson', module: 'gson'
}
compile 'org.slf4j:slf4j-api:1.7.25'
testCompile 'org.mockito:mockito-all:1.10.19'
testCompile 'junit:junit:4.12'
testCompile 'org.apache.httpcomponents:httpclient:4.5.2'
testCompile 'org.gradle:gradle-tooling-api:3.5'
testRuntime 'org.gradle:gradle-tooling-api:3.5'
testCompile('org.testcontainers:testcontainers:1.2.1')
testRuntime('org.testcontainers:testcontainers:1.2.1')
}
run {
systemProperty "java.security.policy", "src/main/plugin-metadata/plugin-security.policy"
systemProperty "es.path.home", "src/test/eshome"
jvmArgs += " -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
}
tasks.withType(Zip) { task ->
task.doLast {
ant.checksum file: it.archivePath, algorithm: 'sha1'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
// Set to false to not use elasticsearch checkstyle rules
checkstyleMain.enabled = true
checkstyleTest.enabled = true
// FIXME dependency license check needs to be enabled
dependencyLicenses.enabled = true
// FIXME thirdparty audit needs to be enabled
thirdPartyAudit.enabled = false
// Uncomment this to skip license header checks
licenseHeaders.enabled = false
namingConventions.enabled = false
forbiddenApisMain.enabled = false
forbiddenApisTest.enabled = false
integTest.enabled = false
jarHell.enabled = false