-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathbuild.gradle
246 lines (213 loc) · 9.83 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/**
* Copyright (c) 2014, XebiaLabs B.V., All rights reserved.
*
*
* The XL Deploy plugin for Jenkins is licensed under the terms of the GPLv2
* <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most XebiaLabs Libraries.
* There are special exceptions to the terms and conditions of the GPLv2 as it is applied to
* this software, see the FLOSS License Exception
* <https://github.com/jenkinsci/deployit-plugin/blob/master/LICENSE>.
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; version 2
* of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'jpi'
apply plugin: 'obake'
apply plugin: 'provided-base'
apply plugin: 'net.researchgate.release'
build.dependsOn jpi
task deleteGeneratedSrcLocalizer(type: Delete) {
delete "build/generated-src/localizer"
}
localizer.dependsOn deleteGeneratedSrcLocalizer
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.jenkins-ci.org/releases" }
maven { url "http://www.knopflerfish.org/maven2" }
maven { url "https://dist.xebialabs.com/public/maven2" }
maven { url "https://repo.jenkins-ci.org/public" }
}
buildscript {
repositories {
// The plugin is currently only available via the Jenkins
// Maven repository, but has dependencies in Maven Central.
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.jenkins-ci.org/releases" }
maven { url "http://www.knopflerfish.org/maven2" }
maven { url "https://dist.xebialabs.com/public/maven2" }
maven { url "https://repo.jenkins-ci.org/public" }
}
dependencies {
classpath 'org.jenkins-ci.tools:gradle-jpi-plugin:0.19.0'
classpath 'org.bitbucket.grimrose:gradle-obake-plugin:0.5'
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
classpath 'net.researchgate:gradle-release:2.8.1'
}
}
jenkinsPlugin {
coreVersion = '1.642.3' // we need to support LTS versions
shortName = "deployit-plugin" // short name of the plugin is the ID that uniquely identifies a plugin
displayName = "XebiaLabs XL Deploy Plugin"
url = 'https://github.com/jenkinsci/xldeploy-plugin/blob/master/docs/README.md'
gitHubUrl = 'https://github.com/jenkinsci/xldeploy-plugin'
developers {
developer {
id 'XebiaLabsCI'
name 'XebiaLabs'
email 'xl-developers (at) xebialabs (dot) com'
}
}
}
// Per default Jenkins loads every jar from WEB-INF/lib, along with the contents of WEB-INF/classes after the classes and libraries of the core.
// If you want to have your own libaries loaded before these (e.g. you want a newer version of velocity or an other library),
// you can configure your plugin to use a different classloader strategy
tasks.jpi.manifest.attributes(["PluginFirstClassLoader": "true"])
server.doFirst {
org.jenkinsci.gradle.plugins.jpi.JpiHplManifest.metaClass.writeTo = { File f ->
def m = new java.util.jar.Manifest()
m.mainAttributes.putValue("Manifest-Version", "1.0")
m.mainAttributes.putValue("PluginFirstClassLoader", "true")
delegate.each { k, v ->
m.mainAttributes.putValue(k, v.toString())
}
f.withOutputStream { o -> m.write(o); }
}
}
configurations {
compile.transitive = true
compile.exclude group: 'com.xebialabs.xl-platform', module: 'xl-utils'
providedRuntime.exclude group: 'jdom', module: 'jdom'
//Engine packager requires JDOM2. Exclude from config so that it is included in the hpi Web-Inf lib.
providedRuntime.exclude group: 'de.schlichtherle.truezip', module: 'truezip-path'
// needs Java7, borks on Java6 setups
all*.exclude group: 'com.thoughtworks.xstream', module: "xstream"
// this artifact lives in a netbeans repository which behaves flakey
// it's not used so exclude it.
testCompile.exclude group: 'org.netbeans.modules', module: "org-netbeans-insane"
providedRuntime.exclude group: 'ch.qos.logback', module: 'logback-classic'
providedRuntime.exclude group: 'ch.qos.logback', module: 'logback-core'
providedRuntime.exclude group: 'org.slf4j', module: 'slf4j-api'
providedRuntime.exclude group: 'org.slf4j', module: 'jcl-over-slf4j'
providedRuntime.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
slf4j
}
ext {
xlPlatformVersion = "10.0.14"
xlPlatformVersionPackager = "2017.6.0"
}
dependencies {
compile ("com.xebialabs.deployit.engine:remote-booter:$xlPlatformVersion") {
transitive = false;
}
compile ("org.springframework.security:spring-security-core:5.7.10") {
transitive = true;
}
compile ("com.xebialabs.deployit.engine:engine-xml:$xlPlatformVersion") {
exclude group: 'org.springframework.security', module: 'spring-security-core'
transitive = true;
}
compile ("com.xebialabs.deployit.engine:packager:$xlPlatformVersionPackager") {
transitive = false;
}
compile ("com.xebialabs.deployit:appserver-api:$xlPlatformVersion"){
transitive = false;
}
compile "org.scala-lang:scala-library:2.12.3"
compile 'com.typesafe:config:1.3.0'
compile "com.thoughtworks.xstream:xstream:1.4.13"
compile "commons-codec:commons-codec:1.15"
compile "joda-time:joda-time:2.10.6"
compile "nl.javadude.scannit:scannit:1.4.1"
compile "org.jboss.resteasy:resteasy-jaxrs:3.12.1.Final"
compile "org.apache.httpcomponents:httpclient:4.5.13"
compile "org.apache.httpcomponents:httpcore:4.4.13"
compile "org.apache.httpcomponents:httpmime:4.5.13"
compile "javax.xml.bind:jaxb-api:2.3.1"
compile "org.jdom:jdom2:2.0.5"
provided 'org.slf4j:slf4j-api:1.7.7'
compile "de.schlichtherle.truezip:truezip-driver-file:7.7.10"
compile "de.schlichtherle.truezip:truezip-driver-zip:7.7.10"
compile "de.schlichtherle.truezip:truezip-driver-tar:7.7.10"
compile "de.schlichtherle.truezip:truezip-file:7.7.10"
compile "de.schlichtherle.truezip:truezip-kernel:7.7.10"
jenkinsPlugins "org.jenkins-ci.plugins:credentials:1.16.1@jar"
jenkinsPlugins "org.jenkins-ci.plugins.workflow:workflow-step-api:1.10@jar"
compile 'com.google.code.findbugs:jsr305:2.0.2'
compile 'findbugs:annotations:1.0.0'
compile "com.google.guava:guava:16.0.1"
testCompile "junit:junit:4.11"
testCompile "org.mockito:mockito-all:1.9.5"
testCompile "org.jenkins-ci.plugins:cloudbees-folder:6.0.4@jar"
testCompile "org.jenkins-ci.main:jenkins-test-harness:2.15"
testCompile "org.jenkins-ci.plugins.workflow:workflow-aggregator:1.10@jar"
testCompile "org.jenkins-ci.plugins.workflow:workflow-support:1.10@jar"
testCompile "org.jenkins-ci.plugins.workflow:workflow-scm-step:1.10@jar"
testCompile "org.jenkins-ci.plugins:scm-api:1.1@jar"
slf4j "org.slf4j:slf4j-api:1.7.7"
slf4j "org.slf4j:log4j-over-slf4j:1.7.7"
slf4j "org.slf4j:jcl-over-slf4j:1.7.7"
slf4j "org.slf4j:slf4j-jdk14:1.7.7"
slf4j "org.slf4j:slf4j-simple:1.7.7"
jenkinsTest('org.jenkins-ci.main:maven-plugin:1.480@hpi') { transitive = true }
jenkinsTest("org.jenkins-ci.plugins:credentials:1.16.1@hpi") { transitive = true }
testCompile "org.jenkins-ci.plugins.workflow:workflow-job:1.10@jar"
testCompile "org.jenkins-ci.plugins.workflow:workflow-cps:1.10@jar"
testCompile "org.jenkins-ci.plugins.workflow:workflow-api:1.10@jar"
jenkinsTest("org.jenkins-ci.plugins.workflow:workflow-step-api:1.10@hpi") { transitive = true }
jenkinsTest("org.jenkins-ci.plugins.workflow:workflow-support:1.10@hpi") { transitive = true }
jenkinsTest("org.jenkins-ci.plugins.workflow:workflow-cps:1.10@hpi") { transitive = true }
jenkinsTest("org.jenkins-ci.plugins:git:3.0.1@hpi") { transitive = true }
jenkinsTest("org.jenkins-ci.plugins.workflow:workflow-aggregator:1.10@hpi") { transitive = true }
}
release {
buildTasks = ['publish']
tagTemplate = 'xldeploy-plugin-$version'
preTagCommitMessage = 'Released Jenkins XL Deploy plugin '
tagCommitMessage = 'Tag for xldeploy-plugin-$version'
newVersionCommitMessage = 'Set development version to '
}
test {
exclude '**/*ITest*'
}
task itest(type: Test) {
description = "Run integration tests"
classpath = project.sourceSets.test.runtimeClasspath + configurations.slf4j
}
if (project.hasProperty('xlDeployIntegration.host')) {
def host = project.property('xlDeployIntegration.host')
def username = project.property('xlDeployIntegration.username')
def password = project.property('xlDeployIntegration.password')
test.systemProperties([
"xlDeployIntegration.host" : "$host",
"xlDeployIntegration.username": "$username",
"xlDeployIntegration.password": "$password"
])
}
task checkJavaVersion {
doLast {
def majorVersion = project.version.tokenize('.')[0].toInteger()
def message = "This build must be run with java"
if (majorVersion < 6 && JavaVersion.current() != JavaVersion.VERSION_1_7) {
throw new GradleException("${message} ${JavaVersion.VERSION_1_7}")
}
if (majorVersion >= 6 && JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("${message} ${JavaVersion.VERSION_1_8}")
}
}
}