forked from rundeck-plugins/rundeck-winrm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (137 loc) · 4.99 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
ext.pluginClassNames='com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor'
defaultTasks 'clean','build'
version = '1.1'
ext.rundeckPluginVersion= '1.1'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'project-report'
sourceCompatibility = 1.5
archivesBaseName = "rundeck-winrm-plugin"
ext.rundeckVersion='1.5.3'
task wrapper(type: Wrapper) {
gradleVersion = '1.7'
}
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 {
mavenLocal()
mavenCentral()
}
dependencies {
pluginLibs(group: 'com.xebialabs.overthere', name: 'overthere', version: '2.2.2'){
exclude( module: 'bcprov-jdk16')
exclude( module: 'jzlib')
exclude( module: 'sshj')
exclude( module: 'commons-net')
exclude( module: 'servlet-api')
exclude( module: 'xom')
exclude( module: 'jdom')
exclude( module: 'dom4j')
exclude( module: 'jaxen')
exclude( module: 'icu4j')
exclude( module: 'jcl-over-slf4j')
}
// pluginLibs(group: 'org.slf4j', name: 'slf4j-simple', version: '1.6.3')
pluginLibs(group: 'org.slf4j', name: 'slf4j-nop', version: '1.6.3')
//nb: commons-codec 1.6 is a transitive of overthere 2.2.2 via httpclient 4.2.1. but maven only uses explicit deps, and overthere 2.2.2 declares 1.5
//TODO: remove this explicit dep after updating overthere to 2.2.3+
pluginLibs(group: 'commons-codec', name: 'commons-codec', version: '1.6')
compile(group: 'org.rundeck', name: 'rundeck-core', version: rundeckVersion)
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
from "$buildDir/output"
metaInf {
from "LICENSE.txt"
from("thirdparty"){
include "*"
}
}
manifest {
def libList = configurations.pluginLibs.collect {'lib/' + it.name}.join(' ')
attributes 'Rundeck-Plugin-File-Version': version,
'Rundeck-Plugin-Version': rundeckPluginVersion,
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-Classnames': pluginClassNames,
'Rundeck-Plugin-Libs': "${libList}"
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
apply plugin: 'maven'
task mappings << {
println conf2ScopeMappings.mappings
}
conf2ScopeMappings.addMapping 1, configurations.pluginLibs, 'compile'
conf2ScopeMappings.addMapping 1, configurations.compile, 'provided'
task createPom << {
def libList = configurations.pluginLibs.collect {'lib/' + it.name}.join(' ')
pom {
project {
artifactId 'rundeck-winrm-plugin'
groupId "com.dtolabs.rundeck"
inceptionYear '2011'
packaging 'jar'
version version
name "RunDeck WinRM NodeExecutor Plugin"
url 'http://rundeck.org'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
build{
plugins{
plugin{
artifactId 'maven-compiler-plugin'
version '2.3.2'
configuration{
source '1.6'
target '1.6'
}
}
plugin() {
artifactId('maven-assembly-plugin')
version('2.2.2')
executions() {
execution() {
id('make-assembly')
phase('package')
goals() {
goal('single')
}
}
}
configuration() {
appendAssemblyId('false')
descriptors() {
descriptor('src/main/assembly/jar.xml')
}
archive() {
manifestEntries() {
'Rundeck-Plugin-Version'(rundeckPluginVersion)
'Rundeck-Plugin-File-Version'(version)
'Rundeck-Plugin-Archive'('true')
'Rundeck-Plugin-Classnames'(pluginClassNames)
'Rundeck-Plugin-Libs'(libList)
}
}
}
}
}
}
}
}.writeTo("pom.xml")
}