forked from rundeck-plugins/rundeck-winrm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
132 lines (111 loc) · 4.02 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
pluginClassNames='com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor'
defaultTasks 'clean','build'
version = '1.0-beta'
rundeckPluginVersion= '1.0'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'project-report'
sourceCompatibility = 1.5
archivesBaseName = "rundeck-winrm-plugin"
rundeckVersion='1.4.4-dev'
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-8a'
}
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()
flatDir name: 'localRepository', dirs: "${rootProject.projectDir}/../rundeck/core/build/libs"
}
dependencies {
pluginLibs(group: 'com.xebialabs.overthere', name: 'overthere', version: '2.0.0-beta-2'){
exclude( module: 'commons-codec')
}
compile(group: 'com.dtolabs.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"
manifest {
def libList = configurations.pluginLibs.collect {'lib/' + it.name}.join(' ')
attributes '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-Archive'('true')
'Rundeck-Plugin-Classnames'(pluginClassNames)
'Rundeck-Plugin-Libs'(libList)
}
}
}
}
}
}
}
}.writeTo("pom.xml")
}