| 1615 |
mhunt |
1 |
<?xml version="1.0"?>
|
|
|
2 |
|
|
|
3 |
<project name="package-name" default="compile" basedir=".">
|
|
|
4 |
|
|
|
5 |
<!-- Description should describe the build script, not the project. -->
|
|
|
6 |
<!-- Example: 'Build and release script for the [insert here] package. -->
|
|
|
7 |
<description>Build and release script template for packages containing an API.</description>
|
|
|
8 |
|
|
|
9 |
<taskdef resource="jats.properties"/>
|
|
|
10 |
|
|
|
11 |
<!-- =================================================================== -->
|
|
|
12 |
<!-- GLOBAL PROPERTIES -->
|
|
|
13 |
<!-- =================================================================== -->
|
|
|
14 |
<property file="${user.home}/.ant.properties" />
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
<!-- =================================================================== -->
|
|
|
18 |
<!-- PUBLIC TARGETS -->
|
|
|
19 |
<!-- =================================================================== -->
|
|
|
20 |
|
|
|
21 |
<!-- =================================================================== -->
|
|
|
22 |
<target name="sandbox"
|
|
|
23 |
description="Prepare the project dependency 'sandbox'.">
|
|
|
24 |
<echo message="Prepare the project dependency 'sandbox'."/>
|
|
|
25 |
<!-- [insert tasks here to prepare the implementation sandbox] -->
|
|
|
26 |
<!-- eg: -->
|
|
|
27 |
<!-- <jats> -->
|
|
|
28 |
<!-- <sandbox name="dependency" version="1.2.3.mas"/> -->
|
|
|
29 |
<!-- <sandbox name="package-name-api" version="1.0.0.mas"/> -->
|
|
|
30 |
<!-- </jats> -->
|
|
|
31 |
</target>
|
|
|
32 |
|
|
|
33 |
<!-- =================================================================== -->
|
|
|
34 |
<target name="sandbox-api"
|
|
|
35 |
description="Prepare the project dependency 'sandbox' for the API.">
|
|
|
36 |
<echo message="Prepare the project dependency 'sandbox' for the API."/>
|
|
|
37 |
<!-- [insert tasks here to prepare the API sandbox] -->
|
|
|
38 |
<!-- eg: -->
|
|
|
39 |
<!-- <jats> -->
|
|
|
40 |
<!-- <sandbox name="dependency" version="1.2.3.mas"/> -->
|
|
|
41 |
<!-- </jats> -->
|
|
|
42 |
</target>
|
|
|
43 |
|
|
|
44 |
<!-- =================================================================== -->
|
|
|
45 |
<target name="-compile">
|
|
|
46 |
<echo message="Compile the project source."/>
|
|
|
47 |
<!-- [insert tasks here to perform source compilation] -->
|
|
|
48 |
</target>
|
|
|
49 |
|
|
|
50 |
<!-- =================================================================== -->
|
|
|
51 |
<target name="compile" depends="sandbox,-compile"
|
|
|
52 |
description="Compile the project source.">
|
|
|
53 |
<echo message="Compile the project source."/>
|
|
|
54 |
<!-- Task pulls in implementation sandbox and delegates to -compile -->
|
|
|
55 |
</target>
|
|
|
56 |
|
|
|
57 |
<!-- =================================================================== -->
|
|
|
58 |
<target name="compile-api" depends="sandbox-api,-compile"
|
|
|
59 |
description="Compile the project source.">
|
|
|
60 |
<echo message="Compile the project source."/>
|
|
|
61 |
<!-- Task pulls in API sandbox and delegates to -compile -->
|
|
|
62 |
</target>
|
|
|
63 |
|
|
|
64 |
<!-- =================================================================== -->
|
|
|
65 |
<target name="package" depends="compile"
|
|
|
66 |
description="Package the project into releasable entities.">
|
|
|
67 |
<echo message="Package the project release entities."/>
|
|
|
68 |
<!-- [insert tasks here to package implementation] -->
|
|
|
69 |
</target>
|
|
|
70 |
|
|
|
71 |
<!-- =================================================================== -->
|
|
|
72 |
<target name="package-api" depends="compile-api"
|
|
|
73 |
description="Package the project API into releasable entities.">
|
|
|
74 |
<echo message="Package the project API release entities."/>
|
|
|
75 |
<!-- [insert tasks here to package API] -->
|
|
|
76 |
</target>
|
|
|
77 |
|
|
|
78 |
<!-- =================================================================== -->
|
|
|
79 |
<target name="test" depends=""
|
|
|
80 |
description="Test the package using JUnit tests.">
|
|
|
81 |
<echo message="Test the package."/>
|
|
|
82 |
<!-- [insert tasks here to test implementation] -->
|
|
|
83 |
</target>
|
|
|
84 |
|
|
|
85 |
<!-- =================================================================== -->
|
|
|
86 |
<target name="release-patch"
|
|
|
87 |
description="Formally release this package as a patch release.">
|
|
|
88 |
<property name="jants.jants.release.category" value="patch"/>
|
|
|
89 |
<property name="jants.jants.release.api" value=""/>
|
|
|
90 |
<antcall target="-label"/>
|
|
|
91 |
</target>
|
|
|
92 |
|
|
|
93 |
<!-- =================================================================== -->
|
|
|
94 |
<target name="release-minor"
|
|
|
95 |
description="Formally release this package as a minor release.">
|
|
|
96 |
<property name="jants.release.category" value="minor"/>
|
|
|
97 |
<property name="jants.release.api" value=""/>
|
|
|
98 |
<antcall target="-label"/>
|
|
|
99 |
</target>
|
|
|
100 |
|
|
|
101 |
<!-- =================================================================== -->
|
|
|
102 |
<target name="release-major"
|
|
|
103 |
description="Formally release this package as a major release.">
|
|
|
104 |
<property name="jants.release.category" value="major"/>
|
|
|
105 |
<property name="jants.release.api" value=""/>
|
|
|
106 |
<antcall target="-label"/>
|
|
|
107 |
</target>
|
|
|
108 |
|
|
|
109 |
<!-- =================================================================== -->
|
|
|
110 |
<target name="release-prompt"
|
|
|
111 |
description="Formally release this package as a user-specified version.">
|
|
|
112 |
<property name="jants.release.category" value="prompt"/>
|
|
|
113 |
<property name="jants.release.api" value=""/>
|
|
|
114 |
<antcall target="-label"/>
|
|
|
115 |
</target>
|
|
|
116 |
|
|
|
117 |
<!-- =================================================================== -->
|
|
|
118 |
<target name="release-patch-api"
|
|
|
119 |
description="Formally release this package as a patch release.">
|
|
|
120 |
<property name="jants.release.category" value="patch"/>
|
|
|
121 |
<property name="jants.release.api" value="-api"/>
|
|
|
122 |
<antcall target="-label"/>
|
|
|
123 |
</target>
|
|
|
124 |
|
|
|
125 |
<!-- =================================================================== -->
|
|
|
126 |
<target name="release-minor-api"
|
|
|
127 |
description="Formally release this package as a minor release.">
|
|
|
128 |
<property name="jants.release.category" value="minor"/>
|
|
|
129 |
<property name="jants.release.api" value="-api"/>
|
|
|
130 |
<antcall target="-label"/>
|
|
|
131 |
</target>
|
|
|
132 |
|
|
|
133 |
<!-- =================================================================== -->
|
|
|
134 |
<target name="release-major-api"
|
|
|
135 |
description="Formally release this package as a major release.">
|
|
|
136 |
<property name="jants.release.category" value="major"/>
|
|
|
137 |
<property name="jants.release.api" value="-api"/>
|
|
|
138 |
<antcall target="-label"/>
|
|
|
139 |
</target>
|
|
|
140 |
|
|
|
141 |
<!-- =================================================================== -->
|
|
|
142 |
<target name="release-prompt-api"
|
|
|
143 |
description="Formally release this package as a user-specified version.">
|
|
|
144 |
<property name="jants.release.category" value="prompt"/>
|
|
|
145 |
<property name="jants.release.api" value="-api"/>
|
|
|
146 |
<antcall target="-label"/>
|
|
|
147 |
</target>
|
|
|
148 |
|
|
|
149 |
<!-- =================================================================== -->
|
|
|
150 |
<target name="undo"
|
|
|
151 |
description="Remove artifacts from a partially complete build.">
|
|
|
152 |
<input message="Which version do you wish to undo?" addproperty="jants.build.version"/>
|
|
|
153 |
<!-- Remove any label for the given version -->
|
|
|
154 |
<ccrmlabel labelname="${ant.project.name}-${jants.build.version}"/>
|
|
|
155 |
<!-- Remove any network drive mapping, and remove any view corresponding to the label -->
|
|
|
156 |
<ccrmview viewname="${user.name}_jats_build_${ant.project.name}-${jants.build.version}" unmap="${jants.map.drive}"/>
|
|
|
157 |
</target>
|
|
|
158 |
|
|
|
159 |
<!-- =================================================================== -->
|
|
|
160 |
<target name="undo-api"
|
|
|
161 |
description="Remove artifacts from a partially complete API build.">
|
|
|
162 |
<input message="Which version API do you wish to undo?" addproperty="jants.build.version"/>
|
|
|
163 |
<!-- Remove any label for the given version -->
|
|
|
164 |
<ccrmlabel labelname="${ant.project.name}-api-${jants.build.version}"/>
|
|
|
165 |
<!-- Remove any network drive mapping, and remove any view corresponding to the label -->
|
|
|
166 |
<ccrmview viewname="${user.name}_jats_build_${ant.project.name}-api-${jants.build.version}" unmap="${jants.map.drive}"/>
|
|
|
167 |
</target>
|
|
|
168 |
|
|
|
169 |
|
|
|
170 |
<!-- =================================================================== -->
|
|
|
171 |
<!-- SILENT TARGETS -->
|
|
|
172 |
<!-- =================================================================== -->
|
|
|
173 |
|
|
|
174 |
<!-- =================================================================== -->
|
|
|
175 |
<target name="-label">
|
|
|
176 |
<jats package="${ant.project.name}${jants.release.api}" scope="mas">
|
|
|
177 |
<cclabel findCheckouts = "true"
|
|
|
178 |
type = "${jants.release.category}"
|
|
|
179 |
mkview = "true"
|
|
|
180 |
mapview = "${jants.map.drive}"
|
|
|
181 |
labelname = "jants.build.label"
|
|
|
182 |
viewname = "jants.build.view.name"
|
|
|
183 |
viewpath = "jants.build.view.path"
|
|
|
184 |
version = "jants.build.version"/>
|
|
|
185 |
</jats>
|
|
|
186 |
<ant dir="${jants.build.view.path}" inheritAll="false" inheritRefs="false" target="-dpkg-release-${jants.release.category}">
|
|
|
187 |
<property name="jants.build.version" value="${jants.build.version}"/>
|
|
|
188 |
</ant>
|
|
|
189 |
<ccrmview viewname="${jants.build.view.name}" unmap="${jants.map.drive}"/>
|
|
|
190 |
<cclocklabel labelname="${jants.build.label}${jants.release-api}"/>
|
|
|
191 |
</target>
|
|
|
192 |
|
|
|
193 |
<!-- =================================================================== -->
|
|
|
194 |
<target name="-dpkg-release-patch">
|
|
|
195 |
<property name="jants.release.category" value="patch"/>
|
|
|
196 |
<antcall target="-release${jants.release.api}"/>
|
|
|
197 |
</target>
|
|
|
198 |
|
|
|
199 |
<!-- =================================================================== -->
|
|
|
200 |
<target name="-dpkg-release-minor">
|
|
|
201 |
<property name="jants.release.category" value="minor"/>
|
|
|
202 |
<antcall target="-release${jants.release.api}"/>
|
|
|
203 |
</target>
|
|
|
204 |
|
|
|
205 |
<!-- =================================================================== -->
|
|
|
206 |
<target name="-dpkg-release-major">
|
|
|
207 |
<property name="jants.release.category" value="major"/>
|
|
|
208 |
<antcall target="-release${jants.release.api}"/>
|
|
|
209 |
</target>
|
|
|
210 |
|
|
|
211 |
<!-- =================================================================== -->
|
|
|
212 |
<target name="-dpkg-release-prompt">
|
|
|
213 |
<property name="jants.release.category" value="force"/>
|
|
|
214 |
<antcall target="-release${jants.release.api}"/>
|
|
|
215 |
</target>
|
|
|
216 |
|
|
|
217 |
<!-- =================================================================== -->
|
|
|
218 |
<target name="-release" depends="package,test">
|
|
|
219 |
<!-- Clean the package directory -->
|
|
|
220 |
<delete dir="pkg"/>
|
|
|
221 |
<mkdir dir="pkg"/>
|
|
|
222 |
|
|
|
223 |
<!-- Prepare the package entities -->
|
|
|
224 |
<!-- [insert tasks here to copy relevant non-API files to their -->
|
|
|
225 |
<!-- correct location within pkg] -->
|
|
|
226 |
|
|
|
227 |
<!-- And perform the dpkg release -->
|
|
|
228 |
<jats package="${ant.project.name}${jants.release.api}" scope="mas">
|
|
|
229 |
<release type="${jants.release.category}" version="${jants.build.version}"/>
|
|
|
230 |
</jats>
|
|
|
231 |
</target>
|
|
|
232 |
|
|
|
233 |
<!-- =================================================================== -->
|
|
|
234 |
<target name="-release-api" depends="package-api">
|
|
|
235 |
<!-- Clean the package directory -->
|
|
|
236 |
<delete dir="pkg"/>
|
|
|
237 |
<mkdir dir="pkg"/>
|
|
|
238 |
|
|
|
239 |
<!-- Prepare the package entities -->
|
|
|
240 |
<!-- [insert tasks here to copy relevant API files to their -->
|
|
|
241 |
<!-- correct location within pkg] -->
|
|
|
242 |
|
|
|
243 |
<!-- And perform the dpkg release -->
|
|
|
244 |
<jats package="${ant.project.name}${jants.release.api}" scope="mas">
|
|
|
245 |
<release type="${jants.release.category}" version="${jants.build.version}"/>
|
|
|
246 |
</jats>
|
|
|
247 |
</target>
|
|
|
248 |
|
|
|
249 |
</project>
|