forked from gschueler/rundeck-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
68 lines (55 loc) · 1.96 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
version = '1.5.4-SNAPSHOT'
defaultTasks 'clean','build'
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.5
ext.rundeckPluginVersion= '1.1'
/**
* Set this to a comma-separated list of full classnames of your implemented Rundeck
* plugins.
*/
ext.pluginClassNames='com.example.rundeck.plugin.MyExamplePlugin'
repositories {
mavenLocal()
mavenCentral()
//use the local third-party directory for included pre-built jars
add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) {
name = 'thirdparty'
addArtifactPattern "$projectDir/third-party/[module]-[revision]/[module]-[revision](-[classifier]).[ext]"
descriptor = 'optional'
checkmodified = true
}
}
configurations{
//declare custom pluginLibs configuration to include only libs for this plugin
pluginLibs
//declare compile to extend from pluginLibs so it inherits the dependencies
compile{
extendsFrom pluginLibs
}
}
dependencies {
// add any third-party jar dependencies you wish to include in the plugin
// using the `pluginLibs` configuration as shown here:
//pluginLibs group: 'commons-httpclient', name: 'commons-httpclient', version: '3.0.1'
//the compile dependency won't add the rundeck-core jar to the plugin contents
compile group: 'org.rundeck', name: 'rundeck-core', version: '1.5'
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.3'
}