This repository has been archived by the owner on Apr 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-share.xml
282 lines (238 loc) · 9.18 KB
/
build-share.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<project name="Solution Shared build properties"
default="importMe" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Shared solution build
</description>
<!-- set global properties for this build -->
<property name="project-group-name" value="solution" />
<!-- name of our output jar -->
<property name="jarname-prefix" value="${project-group-name}-" />
<!-- name of our distribution zip -->
<property name="dist-file" value="${ant.project.name}.zip" />
<property name="dist-file-test" value="${ant.project.name}-test.zip" />
<!-- relative paths -->
<property name="src" location="src"/>
<property name="src-groovy" location="src-groovy" />
<property name="src-js" location="src-js" />
<!-- libraries not managed by ivy -->
<property name="lib" location="lib"/>
<!-- libraries managed by ivy -->
<property name="ivylib" location="ivylib" />
<property name="lib-js" location="lib-js" />
<property name="build" location="build"/>
<property name="build-classes" location="${build}/classes" />
<property name="build-jars" location="${build}/jars" />
<property name="build-apidoc" location="${build}/apidoc" />
<!-- What version is this package.. TODO ivy should do this -->
<property name="version" value="1.0" />
<property name="status" value="integration" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
</target>
<path id="classpath-ivy">
<fileset dir="${ivylib}">
<include name="**.jar"/>
</fileset>
</path>
<path id="classpath-lib">
<fileset dir="${lib}">
<include name="**.jar"/>
</fileset>
</path>
<path id="classpath-all">
<path refid="classpath-lib" />
<path refid="classpath-ivy" />
</path>
<target name="no-clean">
<property name="no-clean" value="true" />
</target>
<target name="clean" unless="no-clean" description="clean up">
<delete dir="${build}"/>
<mkdir dir="${build}"/>
</target>
<target name="compile-java" description="compile the source ">
<mkdir dir="${ivylib}" />
<mkdir dir="${build-classes}" />
<javac srcdir="${src}" destdir="${build-classes}"
debug="true" target="1.6" source="1.6" classpathref="classpath-all"/>
<copy todir="${build-classes}">
<fileset dir="${src}">
<include name="**/*.xml"/>
<include name="**/*.properties" />
<include name="**/*.betwixt" />
</fileset>
</copy>
</target>
<target name="no-javadoc">
<property name="no-javadoc" value="true" />
</target>
<target name="javadoc" unless="no-javadoc" depends="compile-java">
<mkdir dir="${build-apidoc}"/>
<javadoc destdir="${build-apidoc}" private="true" use="yes"
windowtitle="${ant.project.name}">
<packageset dir="${src}" defaultexcludes="yes" />
<classpath refid="classpath-all"/>
</javadoc>
</target>
<macrodef name="jarbuilder">
<attribute name="name"/>
<attribute name="files"/>
<attribute name="title" default="Solution"/>
<sequential>
<mkdir dir="${build-jars}"/>
<propertyfile file="${build-jars}/@{name}.properties">
<entry key="build.number" value="${build.number}"/>
<entry key="build.date" type="date" pattern="EEEE MMM dd yyyy" value="now"/>
</propertyfile>
<jar jarfile="${build-jars}/@{name}" whenmanifestonly="fail">
<manifest>
<attribute name="Implementation-Title" value="@{title}" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Package-Vendor" value="Percussion Solutions" />
<attribute name="Package-Version" value="${build.number}" />
<attribute name="Built-By" value="${user.name}"/>
</manifest>
<fileset refid="@{files}"/>
</jar>
</sequential>
</macrodef>
<target name="compile" depends="compile-java"
description="Override this task if you need to compile more than java">
</target>
<target name="jarbuilder" depends="compile" description="just build the jar, no server">
<fail message="Override this task" />
</target>
<target name="dist-buildnumber" unless="build.number">
<buildnumber/>
</target>
<target name="test" depends="compile">
<junit fork="true">
<classpath>
<path location="${build-classes}" />
<path refid="classpath-all" />
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${src}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="no-dist">
<property name="no-dist" value="true" />
</target>
<target name="dist" unless="no-dist"
depends="init, clean, compile, javadoc, dist-buildnumber, jarbuilder, test"
description="generate the distribution">
<property name="ziplibdir" value="${ant.project.name}/lib"/>
<property name="zipbasedir" value="${ant.project.name}"/>
<zip destfile="build/${dist-file}">
<zipfileset dir="${build-jars}" includes="*.jar" prefix="${zipbasedir}/lib" />
<zipfileset dir="${src}" prefix="${zipbasedir}/src">
<include name="**"/>
</zipfileset>
<zipfileset dir="." prefix="${zipbasedir}">
<include name="rx/**"/>
<include name="Extensions.xml"/>
<include name="readme.txt"/>
<include name="build.number"/>
<include name="build.xml"/>
<include name="license.txt"/>
<include name="deploy-share.xml"/>
<include name="deploy.xml"/>
<include name="install.bat" />
<include name="install.sh" />
</zipfileset>
<zipfileset dir="${build-apidoc}" prefix="${zipbasedir}/javadoc"/>
</zip>
</target>
<target name="install" depends="dist">
<mkdir dir="${build}/install"/>
<unzip src="${dist-file}" dest="${build}/install" />
<ant dir="${build}/install/${ant.project.name}"
antfile="${build}/install/${ant.project.name}/deploy.xml"
inheritall="false"
target="install" />
</target>
<!-- =================================
Download and install Ivy2 from http://ant.apache.org/ivy
Modify your Ant runtime preferences in Eclipse to include the Ivy JARs
Setup your ivy-local.properties for your user / environment (see the sample file)
To build for the first time:
1) Run the ivy-retrieve target
2) In Project Properties, add all JARs in the ivylib folder to
the build path.
3) Build (using the testbuild and dist targets)
4) If your project produces JARs to be re-used by other
projects, run the ivy-publish target
You should occasionally refresh the (with ivy-retrieve) and
do ivy-publish each time a new build is released.
-->
<property name="ivy.local.default.root" value="/ivyrepo"/>
<property name="ivy-module-version-target" value="1.0"/>
<property name="ivy.file" value="ivy.xml" />
<!--
clean the ivy cache and throw away any local copies of downloaded JARs
-->
<target name="ivy-clean" depends="ivy-configure">
<ivy:cleancache />
<delete dir="${ivylib}" />
<mkdir dir="${ivylib}" />
</target>
<!--
load the ivy configuration. See ivysettings.xml
-->
<target name="ivy-configure">
<ivy:settings />
</target>
<!-- resolve dependencies -->
<target name="ivy-resolve" depends="ivy-configure" >
<!-- if you have more configurations, you may need to change this line -->
<ivy:resolve conf="test"/>
</target>
<!-- retrieve all dependency JARs to the local ivylib folder -->
<target name="ivy-retrieve" depends="ivy-resolve">
<!-- if you have more configurations, you may need to change this line -->
<ivy:retrieve pattern="${ivylib}/[artifact]-[revision].[ext]" />
</target>
<!--
You should only publish this project to Ivy if it produces
JARs that will be used by other projects.
-->
<target name="ivy-publish" depends="ivy-resolve" >
<ivy:info file="${ivy.file}" />
<ivy:publish resolver="foo-shared-sftp" forcedeliver="true"
pubrevision="${version}" overwrite="true"
conf="default" status="${status}" >
<artifacts pattern="${build-jars}/[artifact].[ext]" />
</ivy:publish>
</target>
<target name="ivy-local-version">
<tstamp>
<format property="now" pattern="yyyyMMddHHmmss"/>
</tstamp>
<property name="ivy.new.revision" value="${ivy-module-version-target}-local-${now}"/>
</target>
<target name="ivy-publish-local" depends="ivy-local-version,jarbuilder"
description="--> publish this project in the local ivy repository">
<ivy:info file="${ivy.file}" />
<ivy:publish artifactspattern="${build-jars}/[artifact].[ext]"
resolver="local"
pubrevision="${version}"
pubdate="${now}"
status="integration"
forcedeliver="true"
overwrite="true"
/>
<echo message="project ${ant.project.name} published locally with version ${version}" />
</target>
<target name="clean-local" description="--> cleans the local repository for the current module">
<delete dir="${ivy.local.default.root}/${ant.project.name}"/>
</target>
<target name="importMe">
<fail message="This ant script is for importing." />
</target>
</project>