Lines 49-63
Link Here
|
49 |
<dirname property="harness.dir" file="${suite.file}"/> |
49 |
<dirname property="harness.dir" file="${suite.file}"/> |
50 |
<echo level="verbose">Using build harness in ${harness.dir}</echo> |
50 |
<echo level="verbose">Using build harness in ${harness.dir}</echo> |
51 |
<taskdef classpath="${harness.dir}/tasks.jar" resource="org/netbeans/nbbuild/taskdefs.properties"/> |
51 |
<taskdef classpath="${harness.dir}/tasks.jar" resource="org/netbeans/nbbuild/taskdefs.properties"/> |
|
|
52 |
<typedef name="pathfileset" classname="org.netbeans.nbbuild.PathFileSet" |
53 |
classpath="${harness.dir}/tasks.jar"/> |
52 |
<property name="harness.taskdefs.done" value="true"/> |
54 |
<property name="harness.taskdefs.done" value="true"/> |
53 |
</target> |
55 |
</target> |
54 |
|
56 |
|
55 |
<target name="-init" depends="-taskdefs"> |
57 |
<target name="-init" depends="-taskdefs"> |
|
|
58 |
<convertclusterpath from="${cluster.path.evaluated}" to="cluster.path" id="cluster.path.id"/> |
56 |
<property file="nbproject/private/private.properties"/> |
59 |
<property file="nbproject/private/private.properties"/> |
57 |
<property file="nbproject/project.properties"/> |
60 |
<property file="nbproject/project.properties"/> |
58 |
<sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.sorted"/> |
61 |
<sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.sorted"/> |
59 |
<property name="cluster" location="build/cluster"/> |
62 |
<property name="cluster" location="build/cluster"/> |
60 |
<echo level="verbose">Suite in ${basedir} with target platform ${netbeans.dest.dir}, build cluster ${cluster}, and sorted modules ${modules.sorted}</echo> |
63 |
<echo level="verbose">Suite in ${basedir} with clusters ${cluster.path}, build cluster ${cluster}, and sorted modules ${modules.sorted}</echo> |
61 |
<!-- synchronize with SuiteProject --> |
64 |
<!-- synchronize with SuiteProject --> |
62 |
<property name="disabled.modules" value=""/> |
65 |
<property name="disabled.modules" value=""/> |
63 |
<property name="enabled.clusters" value=""/> |
66 |
<property name="enabled.clusters" value=""/> |
Lines 105-118
Link Here
|
105 |
<target name="build" depends="-init,branding,release" description="Build all modules in the suite."> |
108 |
<target name="build" depends="-init,branding,release" description="Build all modules in the suite."> |
106 |
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/> |
109 |
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/> |
107 |
<mkdir dir="${cluster}/config/Modules"/> |
110 |
<mkdir dir="${cluster}/config/Modules"/> |
108 |
<createmodulexml xmldir="${cluster}/config/Modules"> |
111 |
<pathconvert pathsep="," property="disabled.modules.paths.list"> |
109 |
<hidden dir="${netbeans.dest.dir}"> |
112 |
<pathfileset> |
|
|
113 |
<path refid="cluster.path.id"/> |
110 |
<custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> |
114 |
<custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> |
111 |
<param name="excludeModules" value="${disabled.modules}"/> |
115 |
<param name="excludeModules" value="${disabled.modules}"/> |
112 |
<param name="excluded" value="true"/> |
116 |
<param name="excluded" value="true"/> |
113 |
</custom> |
117 |
</custom> |
114 |
</hidden> |
118 |
</pathfileset> |
115 |
</createmodulexml> |
119 |
</pathconvert> |
|
|
120 |
<createmodulexml xmldir="${cluster}/config/Modules" hidden="${disabled.modules.paths.list}"/> |
116 |
</target> |
121 |
</target> |
117 |
|
122 |
|
118 |
<target name="nbms" depends="build" description="Build NBMs and an Auto Update site descriptor for all modules in the suite."> |
123 |
<target name="nbms" depends="build" description="Build NBMs and an Auto Update site descriptor for all modules in the suite."> |
Lines 122-136
Link Here
|
122 |
<isset property="nbm.target.cluster"/> |
127 |
<isset property="nbm.target.cluster"/> |
123 |
</condition> |
128 |
</condition> |
124 |
<!-- reads app.name if exists --> |
129 |
<!-- reads app.name if exists --> |
|
|
130 |
<pathfileset id="updater.jar"> |
131 |
<path refid="cluster.path.id"/> |
132 |
<filename name="modules/ext/updater.jar"/> |
133 |
</pathfileset> |
125 |
<condition property="help.target.cluster" value="${app.name}" > |
134 |
<condition property="help.target.cluster" value="${app.name}" > |
126 |
<and> |
135 |
<and> |
127 |
<isset property="app.name"/> |
136 |
<isset property="app.name"/> |
128 |
<!-- #74866: only works for 6.0+ platforms. --> |
137 |
<!-- #74866: only works for 6.0+ platforms. --> |
129 |
<available resource="org/netbeans/updater/resources/autoupdate-info-2_4.dtd"> |
138 |
<available resource="org/netbeans/updater/resources/autoupdate-info-2_4.dtd"> |
130 |
<classpath> |
139 |
<classpath> |
131 |
<fileset dir="${netbeans.dest.dir}"> |
140 |
<resources refid="updater.jar"/> |
132 |
<include name="platform*/modules/ext/updater.jar"/> |
|
|
133 |
</fileset> |
134 |
</classpath> |
141 |
</classpath> |
135 |
</available> |
142 |
</available> |
136 |
</and> |
143 |
</and> |
Lines 150-156
Link Here
|
150 |
<include name="*.nbm"/> |
157 |
<include name="*.nbm"/> |
151 |
</fileset> |
158 |
</fileset> |
152 |
<updaterjar> |
159 |
<updaterjar> |
153 |
<fileset dir="${netbeans.dest.dir}" includes="platform*/modules/ext/updater.jar"/> |
160 |
<resources refid="updater.jar"/> |
154 |
</updaterjar> |
161 |
</updaterjar> |
155 |
</makeupdatedesc> |
162 |
</makeupdatedesc> |
156 |
</target> |
163 |
</target> |
Lines 159-196
Link Here
|
159 |
<fail unless="app.name">Must have set at least an application name ('app.name')</fail> |
166 |
<fail unless="app.name">Must have set at least an application name ('app.name')</fail> |
160 |
|
167 |
|
161 |
<pathconvert property="zip.platform.update.tracking"> |
168 |
<pathconvert property="zip.platform.update.tracking"> |
162 |
<path> |
169 |
<pathfileset> |
163 |
<fileset dir="${netbeans.dest.dir}"> |
170 |
<path refid="cluster.path.id"/> |
164 |
<include name="**/update_tracking/*.xml"/> |
171 |
<filename name="**/update_tracking/*.xml"/> |
165 |
</fileset> |
172 |
</pathfileset> |
166 |
</path> |
|
|
167 |
</pathconvert> |
173 |
</pathconvert> |
168 |
|
174 |
|
169 |
<selector id="zip.platform.included.files"> |
175 |
<selector id="zip.platform.included.files"> |
170 |
<custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> |
176 |
<custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> |
171 |
<param name="excludeModules" value="${disabled.modules}"/> |
177 |
<param name="excludeModules" value="${disabled.modules}"/> |
|
|
178 |
<!-- XXX inc/exc clusters --> |
172 |
<param name="includeClusters" value="${enabled.clusters}"/> |
179 |
<param name="includeClusters" value="${enabled.clusters}"/> |
173 |
<param name="excludeClusters" value="${disabled.clusters}"/> |
180 |
<param name="excludeClusters" value="${disabled.clusters}"/> |
174 |
<param name="updateTrackingFiles" value="${zip.platform.update.tracking}"/> |
181 |
<param name="updateTrackingFiles" value="${zip.platform.update.tracking}"/> |
175 |
</custom> |
182 |
</custom> |
176 |
</selector> |
183 |
</selector> |
177 |
|
184 |
|
178 |
<pathconvert property="zip.platform.clusters.duplicates" pathsep=","> |
185 |
<pathconvert property="zip.platform.clusters.duplicates" pathsep=" "> |
179 |
<path> |
186 |
<pathfileset> |
180 |
<fileset dir="${netbeans.dest.dir}"> |
187 |
<path refid="cluster.path.id"/> |
181 |
<selector refid="zip.platform.included.files"/> |
188 |
<selector refid="zip.platform.included.files"/> |
182 |
</fileset> |
189 |
</pathfileset> |
183 |
</path> |
190 |
<chainedmapper> |
184 |
<mapper type="regexp" from="[/\\]([^/\\]+)[/\\]config[/\\]Modules[/\\]" to="\1"/> <!-- #71849 --> |
191 |
<mapper type="regexp" from="(^.+)[/\\]config[/\\]Modules[/\\]" to="\1"/> <!-- #71849 --> |
|
|
192 |
<filtermapper> |
193 |
<linecontainsregexp negate="true"> |
194 |
<regexp pattern="update[/\\]backup[/\\]netbeans[/\\]?$"/> |
195 |
</linecontainsregexp> |
196 |
</filtermapper> |
197 |
</chainedmapper> |
185 |
</pathconvert> |
198 |
</pathconvert> |
186 |
|
199 |
<tempfile property="zip.platform.clusters.duplicates.file" destdir="${basedir}/build" deleteonexit="true"/> |
187 |
<dirset id="zip.platform.clusters" dir="${netbeans.dest.dir}" includes="${zip.platform.clusters.duplicates}" excludes="platform*"/> |
200 |
<echo file="${zip.platform.clusters.duplicates.file}" message="${zip.platform.clusters.duplicates}"/> |
188 |
|
201 |
|
|
|
202 |
<union id="zip.platform.clusters"> <!-- union removes duplicates --> |
203 |
<files includesfile="${zip.platform.clusters.duplicates.file}"/> |
204 |
</union> |
189 |
<pathconvert property="zip.platform.clusters.bare" pathsep=" "> <!-- #71128: \n OK on Win but \r\n bad on Unix --> |
205 |
<pathconvert property="zip.platform.clusters.bare" pathsep=" "> <!-- #71128: \n OK on Win but \r\n bad on Unix --> |
190 |
<path> |
206 |
<resources refid="zip.platform.clusters"/> |
191 |
<dirset refid="zip.platform.clusters"/> |
207 |
<chainedmapper> |
192 |
</path> |
208 |
<filtermapper> |
193 |
<mapper type="regexp" from="[/\\]([^/\\]+)[/\\]?$" to="\1"/> <!-- #71849 --> |
209 |
<linecontainsregexp negate="true"> |
|
|
210 |
<regexp pattern="platform[0-9]*[/\\]?$"/> |
211 |
</linecontainsregexp> |
212 |
</filtermapper> |
213 |
<mapper type="regexp" from="[/\\]([^/\\]+)[/\\]?$" to="\1"/> <!-- #71849 --> |
214 |
</chainedmapper> |
194 |
</pathconvert> |
215 |
</pathconvert> |
195 |
|
216 |
|
196 |
<property name="build.launcher.dir" location="build/launcher"/> |
217 |
<property name="build.launcher.dir" location="build/launcher"/> |
Lines 215-236
Link Here
|
215 |
|
236 |
|
216 |
<target name="build-zip" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform."> |
237 |
<target name="build-zip" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform."> |
217 |
<mkdir dir="${dist.dir}"/> |
238 |
<mkdir dir="${dist.dir}"/> |
|
|
239 |
<!-- pathfileset does not support 'prefix' and 'filemode' parameters, |
240 |
we have to copy them to temp location --> |
241 |
<tempfile property="temp.dir.nbexec" destdir="${basedir}/build" deleteonexit="true"/> |
242 |
<tempfile property="temp.dir.rest" destdir="${basedir}/build" deleteonexit="delete"/> |
243 |
<subant genericantfile="${harness.dir}/suite.xml" target="copy-cluster" inheritrefs="true"> |
244 |
<property name="dest.dir" value="${temp.dir.rest}"/> |
245 |
<property name="nbexec.dir" value="${temp.dir.nbexec}"/> |
246 |
<property name="build.dir" value="${basedir}/build"/> |
247 |
<resources refid="zip.platform.clusters"/> |
248 |
</subant> |
218 |
<zip destfile="${dist.dir}/${app.name}.zip"> |
249 |
<zip destfile="${dist.dir}/${app.name}.zip"> |
219 |
<zipfileset dir="${build.launcher.dir}/bin/" filemode="755" prefix="${app.name}/bin"/> |
250 |
<zipfileset dir="${build.launcher.dir}/bin/" filemode="755" prefix="${app.name}/bin"/> |
220 |
<zipfileset dir="${build.launcher.dir}/etc/" prefix="${app.name}/etc"/> |
251 |
<zipfileset dir="${build.launcher.dir}/etc/" prefix="${app.name}/etc"/> |
221 |
<zipfileset dir="${netbeans.dest.dir}" filemode="755" prefix="${app.name}"> |
252 |
<zipfileset dir="${temp.dir.nbexec}" filemode="755" prefix="${app.name}"/> |
222 |
<include name="**/lib/nbexec*"/> |
253 |
<zipfileset dir="${temp.dir.rest}" prefix="${app.name}"/> |
223 |
</zipfileset> |
254 |
|
224 |
|
|
|
225 |
<zipfileset dir="${netbeans.dest.dir}" prefix="${app.name}"> |
226 |
<and> |
227 |
<not> |
228 |
<filename name="**/lib/nbexec*"/> |
229 |
</not> |
230 |
<selector refid="zip.platform.included.files"/> |
231 |
</and> |
232 |
</zipfileset> |
233 |
|
234 |
<!-- Yes, the doubled app.name is a bit ugly, but better than the alternative; cf. #66441: --> |
255 |
<!-- Yes, the doubled app.name is a bit ugly, but better than the alternative; cf. #66441: --> |
235 |
<zipfileset dir="${cluster}" prefix="${app.name}/${app.name}"> |
256 |
<zipfileset dir="${cluster}" prefix="${app.name}/${app.name}"> |
236 |
<exclude name="config/Modules/*.xml_hidden"/> |
257 |
<exclude name="config/Modules/*.xml_hidden"/> |
Lines 238-243
Link Here
|
238 |
|
259 |
|
239 |
</zip> |
260 |
</zip> |
240 |
</target> |
261 |
</target> |
|
|
262 |
|
263 |
<target name="copy-cluster" description="Copies cluster specified by basedir to dir ${dest.dir}"> |
264 |
<pathconvert property="cluster.name"> |
265 |
<path path="${basedir}"/> |
266 |
<mapper type="regexp" from="[/\\]([^/\\]+)[/\\]?$" to="\1"/> |
267 |
</pathconvert> |
268 |
<copy todir="${dest.dir}/${cluster.name}"> |
269 |
<fileset dir="${basedir}"> |
270 |
<and> |
271 |
<not> |
272 |
<filename name="**/lib/nbexec*"/> |
273 |
</not> |
274 |
<selector refid="zip.platform.included.files"/> |
275 |
</and> |
276 |
</fileset> |
277 |
</copy> |
278 |
<condition property="copy.nbexec" value="true"> |
279 |
<matches pattern="^platform[0-9]*$" string="${cluster.name}"/> |
280 |
</condition> |
281 |
<antcall target="copy-nbexec"/> |
282 |
</target> |
283 |
|
284 |
<target name="copy-nbexec" if="copy.nbexec" description="Copies nbexec from given cluster to specified location"> |
285 |
<copy todir="${nbexec.dir}/${cluster.name}"> |
286 |
<fileset dir="${basedir}"> |
287 |
<filename name="**/lib/nbexec*"/> |
288 |
</fileset> |
289 |
</copy> |
290 |
</target> |
291 |
|
241 |
<target name="create-platform" depends="build-zip" description="Creates an unzipped platform from the suite, launchers, and selected modules from the platform."> |
292 |
<target name="create-platform" depends="build-zip" description="Creates an unzipped platform from the suite, launchers, and selected modules from the platform."> |
242 |
<mkdir dir="${dist.dir}/${app.name}"/> |
293 |
<mkdir dir="${dist.dir}/${app.name}"/> |
243 |
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}"> |
294 |
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}"> |
Lines 258-277
Link Here
|
258 |
<copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/etc"> |
309 |
<copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/etc"> |
259 |
<fileset dir="${build.launcher.dir}/etc/" /> |
310 |
<fileset dir="${build.launcher.dir}/etc/" /> |
260 |
</copy> |
311 |
</copy> |
261 |
<copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}"> |
312 |
<subant genericantfile="${harness.dir}/suite.xml" target="copy-cluster" inheritrefs="true"> |
262 |
<fileset dir="${netbeans.dest.dir}"> |
313 |
<property name="dest.dir" value="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}"/> |
263 |
<include name="**/lib/nbexec*"/> |
314 |
<property name="nbexec.dir" value="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}"/> |
264 |
</fileset> |
315 |
<property name="build.dir" value="${basedir}/build"/> |
265 |
|
316 |
<resources refid="zip.platform.clusters"/> |
266 |
<fileset dir="${netbeans.dest.dir}"> |
317 |
</subant> |
267 |
<and> |
318 |
|
268 |
<not> |
|
|
269 |
<filename name="**/lib/nbexec*"/> |
270 |
</not> |
271 |
<selector refid="zip.platform.included.files"/> |
272 |
</and> |
273 |
</fileset> |
274 |
</copy> |
275 |
<copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/${app.name}"> |
319 |
<copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/${app.name}"> |
276 |
|
320 |
|
277 |
<fileset dir="${cluster}"/> |
321 |
<fileset dir="${cluster}"/> |
Lines 335-361
Link Here
|
335 |
</target> |
379 |
</target> |
336 |
|
380 |
|
337 |
<target name="run" depends="build,-jdk-init" description="Runs this suite in place."> |
381 |
<target name="run" depends="build,-jdk-init" description="Runs this suite in place."> |
338 |
<ant antfile="${harness.dir}/run.xml" target="run"/> |
382 |
<ant antfile="${harness.dir}/run.xml" target="run"> |
|
|
383 |
<reference refid="cluster.path.id"/> |
384 |
</ant> |
339 |
</target> |
385 |
</target> |
340 |
|
386 |
|
341 |
<target name="debug" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite in place in the debugger."> |
387 |
<target name="debug" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite in place in the debugger."> |
342 |
<ant antfile="${harness.dir}/run.xml" target="debug"/> |
388 |
<ant antfile="${harness.dir}/run.xml" target="debug"> |
|
|
389 |
<reference refid="cluster.path.id"/> |
390 |
</ant> |
343 |
</target> |
391 |
</target> |
344 |
|
392 |
|
345 |
<target name="profile" depends="build,-jdk-init,-jdk-presetdef-nbprofiledirect" description="Runs this suite in place in the profiler."> |
393 |
<target name="profile" depends="build,-jdk-init,-jdk-presetdef-nbprofiledirect" description="Runs this suite in place in the profiler."> |
346 |
<ant antfile="${harness.dir}/run.xml" target="profile"/> |
394 |
<ant antfile="${harness.dir}/run.xml" target="profile"> |
|
|
395 |
<reference refid="cluster.path.id"/> |
396 |
</ant> |
347 |
</target> |
397 |
</target> |
348 |
|
398 |
|
349 |
<target name="build-jnlp" depends="build,-jdk-init" description="Packages this suite as a JNLP application."> |
399 |
<target name="build-jnlp" depends="build,-jdk-init" description="Packages this suite as a JNLP application."> |
350 |
<ant antfile="${harness.dir}/jnlp.xml" target="build"/> |
400 |
<ant antfile="${harness.dir}/jnlp.xml" target="build"> |
|
|
401 |
<reference refid="cluster.path.id"/> |
402 |
</ant> |
351 |
</target> |
403 |
</target> |
352 |
|
404 |
|
353 |
<target name="run-jnlp" depends="build,-jdk-init" description="Runs this suite as a JNLP application."> |
405 |
<target name="run-jnlp" depends="build,-jdk-init" description="Runs this suite as a JNLP application."> |
354 |
<ant antfile="${harness.dir}/jnlp.xml" target="run"/> |
406 |
<ant antfile="${harness.dir}/jnlp.xml" target="run"> |
|
|
407 |
<reference refid="cluster.path.id"/> |
408 |
</ant> |
355 |
</target> |
409 |
</target> |
356 |
|
410 |
|
357 |
<target name="debug-jnlp" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite as a JNLP application in the debugger."> |
411 |
<target name="debug-jnlp" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite as a JNLP application in the debugger."> |
358 |
<ant antfile="${harness.dir}/jnlp.xml" target="debug"/> |
412 |
<ant antfile="${harness.dir}/jnlp.xml" target="debug"> |
|
|
413 |
<reference refid="cluster.path.id"/> |
414 |
</ant> |
359 |
</target> |
415 |
</target> |
360 |
|
416 |
|
361 |
<target name="test" depends="build" description="Runs tests for all modules in the suite."> |
417 |
<target name="test" depends="build" description="Runs tests for all modules in the suite."> |