forked from UrbanCode/jenkins-pipeline-ucd-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
221 lines (198 loc) · 8.73 KB
/
build.xml
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
<project name="jenkins-pipeline-ud-plugin" default="dist" xmlns:codestation="antlib:com.urbancode.codestation2.client">
<defaultexcludes add="**/.ahs.dig" />
<defaultexcludes add="**/.ahs.manifest" />
<defaultexcludes add="**/*.bom" />
<defaultexcludes add="**/.git*" />
<defaultexcludes add="**/.mailmap" />
<property environment="env"/>
<!-- ==================================================================
PROJECT CONFIGURATION
================================================================== -->
<property name="project" value="${ant.project.name}"/>
<property name="ahp.branch.name" value="master"/>
<property name="ahp.project.name" value="${project}"/>
<property name="ahp.workflow.name" value="build workflow [${ahp.branch.name}]"/>
<condition property="plugin.version" value="${env.AH_BUILD_LIFE_ID}" else="dev">
<isset property="env.AH_BUILD_LIFE_ID" />
</condition>
<property name="MAVEN_HOME" value="${env.MAVEN_HOME}"/>
<!-- ==================================================================
ENVIRONMENTAL DETECTION
================================================================== -->
<property name="git" value="git"/>
<condition property="mvn" value="${MAVEN_HOME}/bin/mvn.cmd">
<os family="windows" />
</condition>
<condition property="mvn" value="${MAVEN_HOME}/bin/mvn">
<not>
<os family="windows" />
</not>
</condition>
<!-- ==================================================================
LOCATIONS OF PROJECT ELEMENTS
================================================================== -->
<property name="build.dir" location="work" />
<property name="src.dir" location="src" />
<property name="src.main.java.dir" location="${src.dir}/main/java" />
<property name="lib.dir" location="lib" />
<!-- ==================================================================
LOCATIONS OF BUILD ARTIFACTS
================================================================== -->
<property name="dist.dir" location="dist" />
<property name="target.dir" location="target" />
<!-- ==================================================================
TASK DEFAULTS
================================================================== -->
<presetdef name="exec">
<exec failifexecutionfails="true"
failonerror="true"
logError="true"/>
</presetdef>
<!-- ==================================================================
PATHS
================================================================== -->
<path id="classpath.main">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- ===================================================================
STANDARD TARGETS
=================================================================== -->
<target name="jar" depends="jar-main"/>
<target name="dist" depends="dist-main"/>
<!-- ==================================================================
ARTIFACT HANDLING
================================================================== -->
<target name="resolve" unless="resolve.no"
description="Resolve all dependencies">
<mkdir dir="${lib.dir}"/>
<codestation:resolve
buildLife="${env.AH_BUILD_LIFE_ID}"
xmlFile="dependencies.xml" />
</target>
<target name="publish" depends="dist" unless="publish.no"
description="Publish artifacts to local codestation repository">
<codestation:publish
project="${ahp.project.name}"
workflow="${ahp.workflow.name}"
publishall="true"/>
</target>
<!-- ==================================================================
COMPILE
================================================================== -->
<target name="prepare" depends="resolve" unless="prepare.no">
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/uDeployRestClient.jar"/>
<arg value="-DgroupId=uc-uDeployRestClient"/>
<arg value="-DartifactId=uc-uDeployRestClient"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/CommonsUtil.jar"/>
<arg value="-DgroupId=uc-commons-util"/>
<arg value="-DartifactId=uc-commons-util"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/CommonsFileUtils.jar"/>
<arg value="-DgroupId=uc-commons-fileutils"/>
<arg value="-DartifactId=uc-commons-fileutils"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/HttpComponents-Util.jar"/>
<arg value="-DgroupId=uc-httpcomponents-util"/>
<arg value="-DartifactId=uc-httpcomponents-util"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/jersey-core-1.12.jar"/>
<arg value="-DgroupId=uc-jersey-core"/>
<arg value="-DartifactId=uc-jersey-core"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/jersey-client-1.12.jar"/>
<arg value="-DgroupId=uc-jersey-client"/>
<arg value="-DartifactId=uc-jersey-client"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/jsr311-api-1.1.1.jar"/>
<arg value="-DgroupId=uc-jsr311-api"/>
<arg value="-DartifactId=uc-jsr311-api"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
<arg value="-Dfile=lib/jettison-1.1.jar"/>
<arg value="-DgroupId=uc-jettison"/>
<arg value="-DartifactId=uc-jettison"/>
<arg value="-Dversion=1.0-SNAPSHOT"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DgeneratePom=true"/>
</exec>
</target>
<!-- ==================================================================
JAR
================================================================== -->
<target name="jar-main" depends="prepare, set-version-property">
<exec executable="${mvn}">
<arg value="package"/>
<arg value="-Denv.buildLife=${plugin.version}"/>
</exec>
</target>
<!-- ==================================================================
DIST
================================================================== -->
<target name="dist-main" depends="jar-main"/>
<!-- ==================================================================
OTHER
================================================================== -->
<target name="clean">
<delete dir="${dist.dir}" />
<delete dir="${target.dir}" />
<delete dir="${build.dir}" />
</target>
<target name="clean-all" depends="clean">
<delete dir="${lib.dir}" />
</target>
<target name="set-version-property" unless="version">
<exec executable="${git}" outputproperty="version">
<arg value="rev-parse"/>
<arg value="--verify"/>
<arg value="--short=12"/>
<arg value="HEAD"/>
</exec>
</target>
</project>