-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
101 lines (86 loc) · 2.69 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '2.4.4'
def pluginDescription = 'Plugin to enable HTTP basic authentication and/or Ip based authentication'
def pluginClassname = 'com.asquera.elasticsearch.plugins.http.HttpBasicServerPlugin'
def pluginName = 'elasticsearch-http-basic'
def elasticVersion = '2.4.4'
def httpclientVersion = '4.5.3'
jar {
jar.baseName = "elasticsearch-http-basic"
manifest {
attributes 'Implementation-Title': 'elasticsearch-http-basic',
'Implementation-Version': version
}
}
configurations {
wagon
releaseJars {
extendsFrom runtime
exclude group: 'org.elasticsearch'
exclude group: 'org.apache.lucene'
exclude module: 'commons-logging'
exclude module: 'commons-codec'
exclude module: 'commons-lang3'
exclude module: 'httpclient'
exclude module: 'httpcore'
exclude module: 'junit'
}
}
repositories {
mavenCentral()
}
dependencies {
// elastic search
compile("org.elasticsearch:elasticsearch:$elasticVersion")
// httpclient
compile("org.apache.httpcomponents:httpclient:$httpclientVersion")
//test
testCompile(group: 'junit', name: 'junit', version: '4.+') { exclude group: 'org.hamcrest', module: 'hamcrest-core' }
testCompile(group: 'org.elasticsearch', name: 'elasticsearch', version: '2.3.5', classifier: 'tests')
testCompile(group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3')
testCompile(group: 'org.apache.lucene', name: 'lucene-test-framework', version: '5.5.0')
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
task makePluginDescriptor(type: Copy) {
from 'src/main/templates'
into 'build/tmp/plugin'
expand([
'descriptor': [
'name': pluginName,
'classname': pluginClassname,
'description': pluginDescription,
'jvm': true,
'site': false,
'isolated': true,
'version': version,
'javaVersion': project.property('targetCompatibility'),
'elasticsearchVersion' : elasticVersion
]
])
}
task plugin(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
from configurations.releaseJars
from 'build/tmp/plugin'
from 'build/libs'
classifier = 'plugin'
}
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
delete "plugins"
from configurations.releaseJars
from 'build/tmp/plugin'
into "plugins/${pluginName}"
}
plugin.setVersion('')