-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
95 lines (78 loc) · 2.73 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
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.7.1'
}
version = '2.10.0'
defaultTasks 'clean','build'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'pl.allegro.tech.build.axion-release'
sourceCompatibility = 1.8
ext.rundeckPluginVersion= '1.1'
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
}
testCompile
}
repositories {
mavenCentral()
}
dependencies {
compile(
[group: 'org.rundeck', name: 'rundeck-core', version: version, ext: 'jar'],
[group: 'com.hashicorp.nomad', name: 'nomad-sdk', version: '0.7.0', ext: 'jar']
)
pluginLibs(
[group: 'com.hashicorp.nomad', name: 'nomad-sdk', version: '0.7.0', ext: 'jar'],
[group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3']
)
testCompile(
[group: 'junit', name: 'junit', version: '4.12', ext: 'jar'],
[group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3', ext: 'jar'],
[group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3', ext: 'jar'],
[group: 'com.hashicorp.nomad', name: 'nomad-sdk', version: '0.7.0', ext: 'jar'],
[group: 'org.jbundle.util.osgi.wrapped', name: 'org.jbundle.util.osgi.wrapped.org.apache.http.client', version: '4.1.2']
)
}
scmVersion {
tag {
prefix = 'v'
versionSeparator = ''
def origDeserialize=deserialize
//append .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
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
ext.pluginClassNames=[
'io.github.valfadeev.rundeck.plugin.nomad.NomadDockerStepPlugin',
'io.github.valfadeev.rundeck.plugin.nomad.NomadJavaStepPlugin'
].join(",")
jar {
//include contents of output dir
from "$buildDir/output"
manifest {
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.0.2'
}
jar.dependsOn(copyToLib)