This file is indexed.

/usr/share/netbeans/harness/suite.xml is in libnb-platform-devel-java 8.1+dfsg1-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.

Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.


The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License.  When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"

Contributor(s):

The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Microsystems, Inc. All Rights Reserved.

If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
-->
<project name="suite" basedir=".">

    <import file="jdk.xml"/>
    <condition property="testcoverage.import"
        value="testcoverage-suite.xml" else="no-testcoverage.xml">
        <available file="testcoverage-suite.xml" filepath="${harness.dir}"/>
    </condition>
    <import file="${testcoverage.import}"/>

    <target name="-taskdefs" unless="${harness.taskdefs.done}">
        <dirname property="harness.dir" file="${suite.file}"/>
        <echo level="verbose">Using build harness in ${harness.dir}</echo>
        <taskdef classpath="${harness.dir}/tasks.jar" resource="org/netbeans/nbbuild/taskdefs.properties"/>
        <typedef name="pathfileset" classname="org.netbeans.nbbuild.PathFileSet"
                 classpath="${harness.dir}/tasks.jar"/>
        <typedef name="islocked" classname="org.netbeans.nbbuild.IsLocked" 
                 classpath="${harness.dir}/tasks.jar"/>
        <property name="harness.taskdefs.done" value="true"/>

        <fail message="When using cluster.path property, remove netbeans.dest.dir, enabled.clusters and disabled.clusters properties from platform config, they would be ignored.">
            <condition>
                <and>
                    <isset property="cluster.path.evaluated"/>
                    <or>
                        <isset property="netbeans.dest.dir"/>
                        <isset property="enabled.clusters"/>
                        <isset property="disabled.clusters"/>
                    </or>
                </and>
            </condition>
        </fail>
    </target>
    
    <target name="-init-build-dir">
        <property name="suite.build.dir" location="build"/>
    </target>

    <target name="-convert-old-project" unless="cluster.path.evaluated" depends="-init-build-dir">
        <!-- netbeans.dest.dir -> cluster.path.id translation for pre-7.0 modules -->
        <fail unless="netbeans.dest.dir" message="Either cluster.path/cluster.path.evaluated properties or netbeans.dest.dir must be set."/>

        <pathconvert property="old.project.update.tracking">
            <fileset dir="${netbeans.dest.dir}" includes="**/update_tracking/*.xml"/>
        </pathconvert>

        <property name="enabled.clusters" value=""/>
        <selector id="old.project.included.files">
            <custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector">
                <param name="excludeModules" value="${disabled.modules}"/>
                <!-- XXX inc/exc clusters -->
                <param name="includeClusters" value="${enabled.clusters}"/>
                <param name="excludeClusters" value="${disabled.clusters}"/>
                <param name="updateTrackingFiles" value="${old.project.update.tracking}"/>
            </custom>
        </selector>

        <pathconvert property="old.project.clusters.duplicates" pathsep="&#10;">
            <fileset dir="${netbeans.dest.dir}">
                <selector refid="old.project.included.files"/>
            </fileset>
            <chainedmapper>
                <mapper type="regexp" from="(^.+)[/\\]config[/\\]Modules[/\\]" to="\1"/> <!-- #71849 -->
                <filtermapper>
                    <linecontainsregexp negate="true">
                        <regexp pattern="update[/\\]backup[/\\]netbeans[/\\]?$"/>
                    </linecontainsregexp>
                </filtermapper>
            </chainedmapper>
        </pathconvert>
        <tempfile property="old.project.clusters.duplicates.file" destdir="${suite.build.dir}" deleteonexit="true" prefix="duplicates"/>
        <mkdir dir="${suite.build.dir}"/>
        <echo file="${old.project.clusters.duplicates.file}" message="${old.project.clusters.duplicates}"/>

        <pathconvert property="cluster.path.evaluated">
            <union> <!-- union removes duplicates -->
                <files includesfile="${old.project.clusters.duplicates.file}"/>
            </union>
        </pathconvert>
    </target>

    <target name="-init" depends="-taskdefs,-init-build-dir,-convert-old-project">
        <convertclusterpath from="${cluster.path.evaluated}" to="cluster.path.final" id="cluster.path.id"/>
        <property file="nbproject/private/private.properties"/>
        <property file="nbproject/project.properties"/>
        <sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.sorted"/>
        <property name="cluster" location="${suite.build.dir}/cluster"/>
        <echo level="verbose">Suite in ${basedir} with clusters ${cluster.path.final}, build cluster ${cluster}, and sorted modules ${modules.sorted}</echo>
        <!-- synchronize with SuiteProject -->
        <property name="disabled.modules" value=""/>
        <property name="enabled.clusters" value=""/>
        <property name="disabled.clusters" value=""/>
        <property name="app.version" value="0.1"/>
        <property name="branding.dir" location="branding"/>
        <property name="dist.dir" location="dist"/>
        <property name="test.xml.results.dir" value="${suite.build.dir}/test/xmldata" />
        <property name="test.report.base.dir" value="${suite.build.dir}/test/report" />
        <property name="test.report.html.dir" value="${test.report.base.dir}/html" />
        <condition property="run.branding"> <!-- #84689 -->
            <and>
                <available file="${branding.dir}" type="dir"/>
                <isset property="branding.token"/>
            </and>
        </condition>
        <condition property="branding.locales.impl" value="${branding.locales}" else="">
            <isset property="branding.locales"/>
        </condition>
    </target>

    <target name="-release.dir">
        <property name="release.dir" location="release"/>
        <condition property="has.release.dir">
            <available file="${release.dir}"/>
        </condition>
    </target>
    <target name="-release.files" depends="-release.dir" if="has.release.dir">
        <pathconvert pathsep="," property="release.files">
            <path>
                <fileset dir="${release.dir}"/>
            </path>
            <filtermapper>
                <replacestring from="${release.dir}${file.separator}" to=""/>
                <replacestring from=" " to="?"/>
            </filtermapper>
        </pathconvert>
    </target>

    <target name="files-init" depends="-release.files">
        <property name="release.files" value=""/>
    </target>
    
    <target name="release" depends="files-init" if="has.release.dir">
        <mkdir dir="${cluster}"/>
        <copy todir="${cluster}">
            <fileset dir="${release.dir}">
                <patternset includes="${release.files}"/>
            </fileset>
        </copy>
    </target>


    <target name="build" depends="-init,branding,release,-hide-excluded-modules" description="Build all modules in the suite.">
        <subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
            <property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
            <property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
        </subant>
    </target>

    <target name="-hide-excluded-modules" depends="-init">
        <mkdir dir="${cluster}/config/Modules"/>
        <pathconvert pathsep="," property="disabled.modules.paths.list">
            <pathfileset>
                <path refid="cluster.path.id"/>
                <custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector">
                    <param name="excludeModules" value="${disabled.modules}"/>
                    <param name="excluded" value="true"/>
                </custom>
            </pathfileset>
        </pathconvert>
        <createmodulexml xmldir="${cluster}/config/Modules" hidden="${disabled.modules.paths.list}"/>
    </target>

    <target name="nbms" depends="-init,branding,release,-hide-excluded-modules" description="Build NBMs and an Auto Update site descriptor for all modules in the suite.">
        <property name="build.updates.dir" location="${suite.build.dir}/updates"/>
        <!-- reads from suite/project.properties first -->
        <condition property="help.target.cluster" value="${nbm.target.cluster}" >
            <isset property="nbm.target.cluster"/>
        </condition>
        <!-- reads app.name if exists -->
        <pathfileset id="updater.jar">
            <path refid="cluster.path.id"/>
            <filename name="modules/ext/updater.jar"/>
        </pathfileset>
        <condition property="help.target.cluster" value="${app.name}" >
            <and>
                <isset property="app.name"/>
                <!-- #74866: only works for 6.0+ platforms. -->
                <available resource="org/netbeans/updater/resources/autoupdate-info-2_4.dtd">
                    <classpath>
                        <resources refid="updater.jar"/>
                    </classpath>
                </available>
            </and>
        </condition>
        <!-- sets property 'nbm.target.cluster.name' to 'nbm.target.cluster' if helper property set -->
        <condition property="nbm.target.cluster.name" value="nbm.target.cluster" >
            <isset property="help.target.cluster"/>
        </condition>
        <property name="nbm.target.cluster.name" value="" />
        <mkdir dir="${build.updates.dir}"/>
        <subant target="nbm" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
            <property name="nbm.target.dir" location="${build.updates.dir}"/>
            <property name="${nbm.target.cluster.name}" value="${help.target.cluster}" />
            <property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
            <property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
        </subant>

        <condition property="use.license.url.in.catalog" value="true" else="false">
            <available resource="org/netbeans/updater/resources/autoupdate-catalog-2_6.dtd">
                <classpath>
                    <resources refid="updater.jar"/>
                </classpath>
            </available>
        </condition>

        <property name="catalog.base.url" value="."/>
        <makeupdatedesc desc="${build.updates.dir}/updates.xml" distbase="${catalog.base.url}" automaticgrouping="true" uselicenseurl="${use.license.url.in.catalog}">
            <fileset dir="${build.updates.dir}">
                <include name="*.nbm"/>
                <include name="*.jar"/> <!-- #181025: bare OSGi bundles -->
            </fileset>
            <updaterjar>
                <resources refid="updater.jar"/>
            </updaterjar>
        </makeupdatedesc>
    </target>
    
    <target name="build-launchers" depends="-init">
        <fail unless="app.name">Must have set at least an application name ('app.name')</fail>
        
        <pathconvert property="zip.platform.update.tracking">
            <pathfileset>
                <path refid="cluster.path.id"/>
                <filename name="**/update_tracking/*.xml"/>
            </pathfileset>
        </pathconvert>

        <selector id="zip.platform.included.files">
            <custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector">
                <param name="excludeModules" value="${disabled.modules}"/>
                <!-- XXX inc/exc clusters -->
                <param name="includeClusters" value="${enabled.clusters}"/>
                <param name="excludeClusters" value="${disabled.clusters}"/>
                <param name="updateTrackingFiles" value="${zip.platform.update.tracking}"/>
            </custom>
        </selector>

        <pathconvert property="zip.platform.clusters.duplicates" pathsep="&#10;">
            <pathfileset>
                <path refid="cluster.path.id"/>
                <selector refid="zip.platform.included.files"/>
            </pathfileset>
            <chainedmapper>
                <mapper type="regexp" from="(^.+)[/\\](config[/\\]Modules|(?&lt;=[/\\]platform\d{0,2}[/\\])(lib|core))[/\\]" to="\1"/> <!-- #71849, #185047, #188601 -->
                <filtermapper>
                    <linecontainsregexp negate="true">
                        <regexp pattern="update[/\\]backup[/\\]netbeans[/\\]?$"/>
                    </linecontainsregexp>
                </filtermapper>
            </chainedmapper>
        </pathconvert>
        <tempfile property="zip.platform.clusters.duplicates.file" destdir="${suite.build.dir}" deleteonexit="true" prefix="duplicates"/>
        <echo file="${zip.platform.clusters.duplicates.file}" message="${zip.platform.clusters.duplicates}"/>

        <union id="zip.platform.clusters"> <!-- union removes duplicates -->
            <files includesfile="${zip.platform.clusters.duplicates.file}"/>
        </union>
        <pathconvert property="zip.platform.clusters.bare" pathsep="&#10;"> <!-- #71128: \n OK on Win but \r\n bad on Unix -->
            <resources refid="zip.platform.clusters"/>
            <chainedmapper>
                <filtermapper>
                    <linecontainsregexp negate="true">
                        <regexp pattern="platform[0-9]*[/\\]?$"/>
                    </linecontainsregexp>
                </filtermapper>
                <mapper type="regexp" from="[/\\]([^/\\]+)([/\\]build[/\\]cluster)?[/\\]?$" to="\1"/> <!-- #71849, #179410 -->
            </chainedmapper>
        </pathconvert>

        <property name="build.launcher.dir" location="${suite.build.dir}/launcher"/>
        
        <mkdir dir="${build.launcher.dir}/etc"/>
        <!-- clean old launchers (platform could be changed) -->
        <delete dir="${build.launcher.dir}/bin" failonerror="false"/>
        <mkdir dir="${build.launcher.dir}/bin"/>

        <!-- make sure correct launchers are present - for pre7 platform use old app.exe launchers -->
        <pathconvert property="nbexec.dll.found" setonempty="false">
            <pathfileset include="lib/nbexec.dll">
                <path refid="cluster.path.id"/>
            </pathfileset>
        </pathconvert>
        <condition property="app.exe.prefix" value="" else="pre7_">
            <isset property="nbexec.dll.found"/>
        </condition>
        <copy file="${harness.dir}/launchers/${app.exe.prefix}app.exe" tofile="${build.launcher.dir}/bin/${app.name}.exe" overwrite="true"/>
        <copy file="${harness.dir}/launchers/${app.exe.prefix}app64.exe" tofile="${build.launcher.dir}/bin/${app.name}64.exe" failonerror="false" overwrite="true"/>
        <copy file="${harness.dir}/launchers/${app.exe.prefix}app_w.exe" tofile="${build.launcher.dir}/bin/${app.name}_w.exe" failonerror="false" overwrite="true"/>

        <copy file="${harness.dir}/launchers/app.sh" tofile="${build.launcher.dir}/bin/${app.name}"/>
        <property name="app.conf" location="${harness.dir}/etc/app.conf"/>
        <copy file="${app.conf}" tofile="${build.launcher.dir}/etc/${app.name}.conf">
            <filterchain>
                <replacestring from="$${branding.token}" to="${branding.token}"/>
            </filterchain>
        </copy>
        <echo message="${app.name}" file="${build.launcher.dir}/etc/${app.name}.clusters"/>
        <echo message="&#10;" file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/>
        <echo message="${zip.platform.clusters.bare}" file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/>
        <echo message="&#10;" file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/>
        
    </target>
    
    <target name="build-zip" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform.">
        <mkdir dir="${dist.dir}"/>
        <!-- pathfileset does not support 'prefix' and 'filemode' parameters,
             we have to copy them to temp location -->
        <tempfile property="temp.dir.nbexec" destdir="${suite.build.dir}" deleteonexit="true" prefix="nbexec"/>
        <tempfile property="temp.dir.rest" destdir="${suite.build.dir}" deleteonexit="delete" prefix="rest"/>
        <subant genericantfile="${harness.dir}/suite.xml" target="copy-cluster" inheritrefs="true">
            <property name="dest.dir" value="${temp.dir.rest}"/>
            <property name="nbexec.dir" value="${temp.dir.nbexec}"/>
            <property name="build.dir" value="${suite.build.dir}"/>
            <resources refid="zip.platform.clusters"/>
        </subant>
        <zip destfile="${dist.dir}/${app.name}.zip">
            <zipfileset dir="${build.launcher.dir}/bin/" filemode="755" prefix="${app.name}/bin"/>
            <zipfileset dir="${build.launcher.dir}/etc/" prefix="${app.name}/etc"/>
            <zipfileset dir="${temp.dir.nbexec}" filemode="755" prefix="${app.name}"/>
            <zipfileset dir="${temp.dir.rest}" prefix="${app.name}"/>

            <!-- Yes, the doubled app.name is a bit ugly, but better than the alternative; cf. #66441: -->
            <zipfileset dir="${cluster}" prefix="${app.name}/${app.name}">
                <exclude name="config/Modules/*.xml_hidden"/>
            </zipfileset>
            
        </zip>
    </target>

    <target name="copy-cluster" description="Copies cluster specified by basedir to dir ${dest.dir}">
        <pathconvert property="cluster.name">
            <path path="${basedir}"/>
            <mapper type="regexp" from="[/\\]([^/\\]+)([/\\]build[/\\]cluster)?[/\\]?$" to="\1"/>
        </pathconvert>
        <copy todir="${dest.dir}/${cluster.name}">
            <fileset dir="${basedir}">
                <and>
                    <not>
                        <filename name="**/lib/nbexec*"/>
                    </not>
                    <selector refid="zip.platform.included.files"/>
                </and>
            </fileset>
        </copy>
        <touch file="${dest.dir}/${cluster.name}/.lastModified"/>
        <condition property="copy.nbexec" value="true">
            <matches pattern="^platform[0-9]*$" string="${cluster.name}"/>
        </condition>
        <antcall target="copy-nbexec"/>
    </target>

    <target name="copy-nbexec" if="copy.nbexec" description="Copies nbexec from given cluster to specified location">
        <copy todir="${nbexec.dir}/${cluster.name}">
            <fileset dir="${basedir}">
                <filename name="**/lib/nbexec*"/>
            </fileset>
        </copy>
    </target>

    <target name="create-platform" depends="build-zip" description="Creates an unzipped platform from the suite, launchers, and selected modules from the platform.">
        <mkdir dir="${dist.dir}/${app.name}"/>
        <unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}">
            <globmapper from="${app.name}/*" to="*"/>
        </unzip>
        <echo level="warning">
Note: As of NetBeans 6.7, you can use the property 'cluster.path' instead of the 'create-platform' target.
See: http://wiki.netbeans.org/DevFaqHowToReuseModules
        </echo>
    </target>
    
    <target name="build-mac" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform.">
        <mkdir dir="${dist.dir}"/>
        <mkdir dir="${dist.dir}/${app.name}.app"/>
        <mkdir dir="${dist.dir}/${app.name}.app/Contents"/>
        <mkdir dir="${dist.dir}/${app.name}.app/Contents/MacOS"/>
        <mkdir dir="${dist.dir}/${app.name}.app/Contents/Resources"/>
        <property name="app.icon.icns" value="${harness.dir}/etc/applicationIcon.icns"/>
        <copy file="${app.icon.icns}" tofile="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}.icns"/>

        <copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/bin">
            <fileset dir="${build.launcher.dir}/bin/" />
        </copy>
        <copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/etc">
            <fileset dir="${build.launcher.dir}/etc/" />
        </copy>
        <subant genericantfile="${harness.dir}/suite.xml" target="copy-cluster" inheritrefs="true">
            <property name="dest.dir" value="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}"/>
            <property name="nbexec.dir" value="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}"/>
            <property name="build.dir" value="${suite.build.dir}"/>
            <resources refid="zip.platform.clusters"/>
        </subant>

        <copy todir="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/${app.name}">
            
            <fileset dir="${cluster}"/>
        </copy>
        
        <copy verbose="true" failonerror="false"
              file="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/${app.name}/etc/${app.name}.icns" 
              tofile="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}.icns"/>
        
        <delete file="${dist.dir}/${app.name}.app/Contents/MacOS/${app.name}"/>
        <symlink link="${dist.dir}/${app.name}.app/Contents/MacOS/${app.name}" resource="../Resources/${app.name}/bin/${app.name}"/>
        <chmod file="${dist.dir}/${app.name}.app/Contents/Resources/${app.name}/bin/${app.name}" perm="755"/>
        <chmod dir="${dist.dir}" includes="${app.name}.app/Contents/Resources/${app.name}/platform*/lib/nbexec" perm="755"/>
        
        <copy file="${harness.dir}/etc/Info.plist" tofile="${dist.dir}/${app.name}.app/Contents/Info.plist">
            <filterchain>
                <replacestring from="$${app.name}" to="${app.name}"/>
                <replacestring from="$${app.version}" to="${app.version}"/>
                <replacestring from="$${app.title}" to="${app.title}"/>
                <replacestring from="$${app.icon}" to="master.png"/>
                <replacestring from="$${branding.token}" to="${branding.token}"/>
            </filterchain>
        </copy>
        <!-- zipping in ant doesn't preserve symlinks that seem to be required.
        zip destfile="${dist.dir}/${app.name}-MacOS.zip" basedir="${dist.dir}" includes="${app.name}.app/**" duplicate="preserve"/-->
        <echo>
You MacOS Application bundle was created at ${dist.dir}/${app.name}.app. For final packaging, use hdiutil or other tools to create a .dmg image.
Alternatively use "zip -yr ${app.name}.app" to create a simple zipped distribution.
        </echo>
    </target>

    <target name="-testuserdir-delete-init" depends="-init">
        <property name="test.user.dir" location="${suite.build.dir}/testuserdir"/>
        <property name="test.user.dir.lock" location="${test.user.dir}/lock"/>
        <condition property="app.running">
            <islocked file="${test.user.dir.lock}"/>
        </condition> 
    </target>
    <target name="-testuserdir-delete-ok" depends="-testuserdir-delete-init" unless="app.running">
        <delete dir="${test.user.dir}"/>
    </target>
    <target name="-testuserdir-delete-fail" depends="-testuserdir-delete-init" if="app.running">
        <!-- #66799: best to warn about this condition... -->
        <fail>Will not delete ${test.user.dir} because ${test.user.dir.lock} still exists; kill any running process and delete lock file if necessary</fail>
    </target>
    <target name="testuserdir-delete" depends="-testuserdir-delete-ok,-testuserdir-delete-fail" description="Delete testing user directory (if the application is not running); clears any saved settings etc.">
        <ant antfile="${harness.dir}/jnlp.xml" target="clean"/>
    </target>
    
    <target name="clean" depends="-init,testuserdir-delete" description="Clean everything.">
        <delete failonerror="false" includeemptydirs="true">
            <fileset dir="${suite.build.dir}">
                <exclude name="testuserdir/"/>
            </fileset>
        </delete>
        <subant target="clean" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
            <property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
            <property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
        </subant>
        <delete dir="${dist.dir}"/>
    </target>

    <target name="branding" depends="-init" if="run.branding">
        <mkdir dir="${cluster}"/>
        <branding cluster="${cluster}" overrides="${branding.dir}" token="${branding.token}"  locales="${branding.locales.impl}"/>
    </target>
    
    <target name="run" depends="build,-jdk-init" description="Runs this suite in place.">
        <ant antfile="${harness.dir}/run.xml" target="run">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>
        
    <target name="debug" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite in place in the debugger.">
        <ant antfile="${harness.dir}/run.xml" target="debug">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="profile" depends="build,-jdk-init,-jdk-presetdef-nbprofiledirect" description="Runs this suite in place in the profiler.">
        <ant antfile="${harness.dir}/run.xml" target="profile">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>
    
    <target name="build-jnlp" depends="build,-jdk-init" description="Packages this suite as a JNLP application.">
        <ant antfile="${harness.dir}/jnlp.xml" target="build">
            <reference refid="cluster.path.id"/>
            <property name="jnlp.generate.versions" value="${jnlp.generate.versions}"/>
        </ant>
    </target>
    
    <target name="run-jnlp" depends="build,-jdk-init" description="Runs this suite as a JNLP application.">
        <ant antfile="${harness.dir}/jnlp.xml" target="run">
            <reference refid="cluster.path.id"/>
            <property name="jnlp.generate.versions" value="false"/>  <!-- versioning is not enabled w/o app server-->
        </ant>
    </target>
    
    <target name="debug-jnlp" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite as a JNLP application in the debugger.">
        <ant antfile="${harness.dir}/jnlp.xml" target="debug">
            <reference refid="cluster.path.id"/>
            <property name="jnlp.generate.versions" value="false"/>  <!-- versioning is not enabled w/o app server-->
        </ant>
    </target>

    <target name="build-osgi" depends="build,-jdk-init" description="Converts this suite into OSGi-compatible bundles.">
        <echo>OSGi support is EXPERIMENTAL for now; see: http://wiki.netbeans.org/NetBeansInOSGi</echo>
        <ant antfile="${harness.dir}/osgi.xml" target="build">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="build-osgi-obr" depends="build-osgi" description="Creates an OSGi bundle repository from this suite.">
        <ant antfile="${harness.dir}/osgi.xml" target="obr">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="run-osgi" depends="build-osgi" description="Runs this suite in an OSGi container.">
        <ant antfile="${harness.dir}/osgi.xml" target="run">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="debug-osgi" depends="build-osgi" description="Debugs this suite in an OSGi container.">
        <ant antfile="${harness.dir}/osgi.xml" target="debug">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="profile-osgi" depends="build-osgi" description="Profiles this suite in an OSGi container.">
        <ant antfile="${harness.dir}/osgi.xml" target="profile">
            <reference refid="cluster.path.id"/>
        </ant>
    </target>

    <target name="test" depends="build" description="Runs tests for all modules in the suite.">
        <sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.test.sorted" sorttests="true"/>
        <property name="continue.after.failing.tests" value="true"/> <!-- fallback -->
        <subant target="test" buildpath="${modules.test.sorted}" inheritrefs="false" inheritall="false">
            <property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
            <property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
            <property name="continue.after.failing.tests" value="${continue.after.failing.tests}"/>
        </subant>
    </target>

    <target name="test-generate-html" depends="test" description="Generates test report for entire suite">
        <delete dir="${test.xml.results.dir}" />
        <mkdir dir="${test.xml.results.dir}" />

        <delete dir="${test.report.base.dir}" />
        <mkdir dir="${test.report.base.dir}" />

        <subant target="-copy-testxmlresults" buildpath="${modules.test.sorted}" inheritrefs="false" inheritall="false">
            <property name="test.xml.results.dir" value="${test.xml.results.dir}"/>
        </subant>

        <junitreport todir="${test.report.base.dir}">
            <fileset dir="${test.xml.results.dir}" />
            <report todir="${test.report.html.dir}" format="frames"/>
        </junitreport>
    </target>

    <target name="test-view-html" depends="test-generate-html" description="Generates and displays test report for entire suite">
        <nbbrowse file="${test.report.html.dir}/index.html"/>
    </target>

    <target name="update" depends="-init" description="Updates modules in the suite from an update center.">
        <sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.test.sorted"/>
        <subant target="update" buildpath="${modules.test.sorted}" inheritrefs="false" inheritall="false">
            <property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
            <property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
            <property name="autoupdate.catalog.url" value="${autoupdate.catalog.url}"/>
        </subant>
    </target>

    <target name="display-coverage-report" depends="coverage-report"
        description="Generates and displays test coverage report for entire suite">
        <fail unless="testcoverage.report.dir">
Property testcoverage.report.dir not set. Test coverage script may be missing in ${harness.dir}.
        </fail>
        <nbbrowse file="${testcoverage.report.dir}/index.html"/>
    </target>

    <target 
        name="clusterize" depends="-taskdefs"
        description="Scans a directory for list of NetBeans module JARs or OSGi bundles and generates necessary config files to make that look like NetBeans cluster"
    >
        <fail unless="cluster" message="You have to specify -Dcluster=... as a path to the root of your JAR tree"/>
        <condition property="include.autoload" value="${includes}">
            <!-- for backward compatibility with tutorials -->
            <isset property="includes"/>
        </condition>
        <fail message="You have to specify one of -Dinclude.autoload=... -Dinclude.eager=... -Dinclude.enabled=...">
            <condition>
                <not>
                    <or>
                        <isset property="include.autoload"/>
                        <isset property="include.eager"/>
                        <isset property="include.enabled"/>
                    </or>
                </not>
            </condition>
        </fail>
        <property name="config.dir" location="${cluster}/config/Modules"/>
        <mkdir dir="${config.dir}"/>
        <createmodulexml xmldir="${config.dir}" updatetrackingroot="${cluster}" failonmissingmanifest="false">
            <autoload dir="${cluster}" includes="${include.autoload}"/>
            <eager dir="${cluster}" includes="${include.eager}"/>
            <enabled dir="${cluster}" includes="${include.enabled}"/>
        </createmodulexml>
    </target>
</project>