Skip to content

Commit 0c68447

Browse files
Patrick RypallaPatrick Rypalla
authored andcommitted
gradle buildPluginZip
1 parent f87debf commit 0c68447

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

build.gradle

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'maven'
23
apply plugin: 'eclipse'
34

45
sourceCompatibility = 1.8
@@ -18,8 +19,17 @@ jar {
1819
}
1920

2021
configurations {
21-
releaseJars {
22-
extendsFrom runtime
22+
wagon
23+
releaseJars {
24+
extendsFrom runtime
25+
exclude group: 'org.elasticsearch'
26+
exclude group: 'org.apache.lucene'
27+
exclude module: 'commons-logging'
28+
exclude module: 'commons-codec'
29+
exclude module: 'commons-lang3'
30+
exclude module: 'httpclient'
31+
exclude module: 'httpcore'
32+
exclude module: 'junit'
2333
}
2434
}
2535

@@ -49,7 +59,6 @@ dependencies {
4959
compile("org.apache.httpcomponents:httpclient:4.5.2")
5060

5161
// stuff
52-
compile("org.apache.commons:commons-lang3:3.4")
5362
compile("com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.3.4")
5463

5564
//test
@@ -74,7 +83,7 @@ uploadArchives {
7483

7584
task makePluginDescriptor(type: Copy) {
7685
from 'src/main/templates'
77-
into 'src/main/resources'
86+
into 'build/tmp/plugin'
7887
expand([
7988
'descriptor': [
8089
'name': pluginName,
@@ -89,3 +98,17 @@ task makePluginDescriptor(type: Copy) {
8998
]
9099
])
91100
}
101+
102+
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
103+
from configurations.releaseJars
104+
from 'build/tmp/plugin'
105+
classifier = 'plugin'
106+
}
107+
108+
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
109+
delete "plugins"
110+
from configurations.releaseJars
111+
from 'build/tmp/plugin'
112+
into "plugins/${pluginName}"
113+
}
114+

0 commit comments

Comments
 (0)