forked from rundeck-plugins/rundeck-ec2-nodes-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
92 lines (80 loc) · 2.76 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
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public"}
}
}
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'pl.allegro.tech.build.axion-release'
sourceCompatibility = 1.6
defaultTasks 'clean', 'build'
ext.rundeckPluginVersion = '1.1'
scmVersion {
tag {
prefix = 'v'
versionSeparator = ''
def origDeserialize=deserialize
//apend .0 to satisfy semver if the tag version is only X.Y
deserialize = { config, position, tagName ->
def orig = origDeserialize(config, position, tagName)
if (orig.split('\\.').length < 3) {
orig += ".0"
}
orig
}
}
}
project.version = scmVersion.version
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
}
}
repositories {
mavenCentral()
ivy {
url = "file:$projectDir/third-party"
name = 'thirdparty'
layout 'pattern', {
artifact "[module]-[revision]/[module]-[revision](-[classifier]).[ext]"
}
}
}
dependencies {
compile group: 'org.rundeck', name: 'rundeck-core', version: '2.11.14'
pluginLibs group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
pluginLibs group: 'dom4j', name: 'dom4j', version: '1.6.1'
pluginLibs group: 'apache-log4j', name: 'apache-log4j', version: '1.2.15'
pluginLibs group: 'stax', name: 'stax', version: '1.2.0'
pluginLibs group: 'stax-api', name: 'stax-api', version: '1.0.1'
pluginLibs group: 'com.amazonaws', name: 'aws-java-sdk-ec2', version: '1.12.778'
pluginLibs group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: '1.12.778'
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
//include contents of output dir
from "$buildDir/output"
manifest {
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true', 'Rundeck-Plugin-Libs-Load-First':'false'
//create space-separated list of pluginLibs
def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
attributes 'Rundeck-Plugin-Classnames': 'com.dtolabs.rundeck.plugin.resources.ec2.EC2ResourceModelSourceFactory', 'Rundeck-Plugin-Libs': "${libList}"
attributes 'Rundeck-Plugin-File-Version': version
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}