1
<?xml version="1.0" encoding="UTF-8"?>
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License. When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
30
Microsystems, Inc. All Rights Reserved.
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
43
<xsl:stylesheet version="1.0"
44
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
45
xmlns:p="http://www.netbeans.org/ns/project/1"
46
xmlns:xalan="http://xml.apache.org/xslt"
47
xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"
48
xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2"
49
xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3"
50
xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc"
51
xmlns:projdeps="http://www.netbeans.org/ns/ant-project-references/1"
52
xmlns:projdeps2="http://www.netbeans.org/ns/ant-project-references/2"
53
exclude-result-prefixes="xalan p projdeps projdeps2">
54
<!-- XXX should use namespaces for NB in-VM tasks from ant/browsetask and debuggerjpda/ant (Ant 1.6.1 and higher only) -->
55
<xsl:output method="xml" indent="yes" encoding="UTF-8" xalan:indent-amount="4"/>
56
<xsl:template match="/">
58
<xsl:comment><![CDATA[
59
*** GENERATED FROM project.xml - DO NOT EDIT ***
60
*** EDIT ../build.xml INSTEAD ***
62
For the purpose of easier reading the script
63
is divided into following sections:
79
<xsl:variable name="name" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:name"/>
80
<!-- Synch with build-impl.xsl: -->
81
<xsl:variable name="codename" select="translate($name, ' ', '_')"/>
82
<project name="{$codename}-impl">
83
<xsl:attribute name="default">default</xsl:attribute>
84
<xsl:attribute name="basedir">..</xsl:attribute>
86
<target name="default">
87
<xsl:attribute name="depends">test,jar,javadoc</xsl:attribute>
88
<xsl:attribute name="description">Build and test whole project.</xsl:attribute>
92
======================
93
INITIALIZATION SECTION
94
======================
97
<target name="-pre-init">
98
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
99
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
102
<target name="-init-private">
103
<xsl:attribute name="depends">-pre-init</xsl:attribute>
104
<property file="nbproject/private/config.properties"/>
105
<property file="nbproject/private/configs/${{config}}.properties"/>
106
<property file="nbproject/private/private.properties"/>
109
<target name="-init-user">
110
<xsl:attribute name="depends">-pre-init,-init-private</xsl:attribute>
111
<property file="${{user.properties.file}}"/>
112
<xsl:comment> The two properties below are usually overridden </xsl:comment>
113
<xsl:comment> by the active platform. Just a fallback. </xsl:comment>
114
<property name="default.javac.source" value="1.4"/>
115
<property name="default.javac.target" value="1.4"/>
118
<target name="-init-project">
119
<xsl:attribute name="depends">-pre-init,-init-private,-init-user</xsl:attribute>
120
<property file="nbproject/configs/${{config}}.properties"/>
121
<property file="nbproject/project.properties"/>
124
<target name="-do-init">
125
<xsl:attribute name="depends">-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property</xsl:attribute>
126
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
127
<j2seproject1:property name="platform.home" value="platforms.${{platform.active}}.home"/>
128
<j2seproject1:property name="platform.bootcp" value="platforms.${{platform.active}}.bootclasspath"/>
129
<j2seproject1:property name="platform.compiler" value="platforms.${{platform.active}}.compile"/>
130
<j2seproject1:property name="platform.javac.tmp" value="platforms.${{platform.active}}.javac"/>
131
<condition property="platform.javac" value="${{platform.home}}/bin/javac">
132
<equals arg1="${{platform.javac.tmp}}" arg2="$${{platforms.${{platform.active}}.javac}}"/>
134
<property name="platform.javac" value="${{platform.javac.tmp}}"/>
135
<j2seproject1:property name="platform.java.tmp" value="platforms.${{platform.active}}.java"/>
136
<condition property="platform.java" value="${{platform.home}}/bin/java">
137
<equals arg1="${{platform.java.tmp}}" arg2="$${{platforms.${{platform.active}}.java}}"/>
139
<property name="platform.java" value="${{platform.java.tmp}}"/>
140
<j2seproject1:property name="platform.javadoc.tmp" value="platforms.${{platform.active}}.javadoc"/>
141
<condition property="platform.javadoc" value="${{platform.home}}/bin/javadoc">
142
<equals arg1="${{platform.javadoc.tmp}}" arg2="$${{platforms.${{platform.active}}.javadoc}}"/>
144
<property name="platform.javadoc" value="${{platform.javadoc.tmp}}"/>
145
<condition property="platform.invalid" value="true">
147
<contains string="${{platform.javac}}" substring="$${{platforms."/>
148
<contains string="${{platform.java}}" substring="$${{platforms."/>
149
<contains string="${{platform.javadoc}}" substring="$${{platforms."/>
152
<fail unless="platform.home">Must set platform.home</fail>
153
<fail unless="platform.bootcp">Must set platform.bootcp</fail>
154
<fail unless="platform.java">Must set platform.java</fail>
155
<fail unless="platform.javac">Must set platform.javac</fail>
156
<fail if="platform.invalid">Platform is not correctly set up</fail>
158
<available file="${{manifest.file}}" property="manifest.available"/>
159
<condition property="manifest.available+main.class">
161
<isset property="manifest.available"/>
162
<isset property="main.class"/>
164
<equals arg1="${{main.class}}" arg2="" trim="true"/>
168
<condition property="manifest.available+main.class+mkdist.available">
170
<istrue value="${{manifest.available+main.class}}"/>
171
<isset property="libs.CopyLibs.classpath"/>
174
<xsl:call-template name="createRootAvailableTest">
175
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
176
<xsl:with-param name="propName">have.tests</xsl:with-param>
178
<xsl:call-template name="createRootAvailableTest">
179
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
180
<xsl:with-param name="propName">have.sources</xsl:with-param>
182
<condition property="netbeans.home+have.tests">
184
<isset property="netbeans.home"/>
185
<isset property="have.tests"/>
188
<condition property="no.javadoc.preview">
190
<isset property="javadoc.preview"/>
191
<isfalse value="${{javadoc.preview}}"/>
194
<property name="run.jvmargs" value=""/>
195
<property name="javac.compilerargs" value=""/>
196
<property name="work.dir" value="${{basedir}}"/>
197
<condition property="no.deps">
199
<istrue value="${{no.dependencies}}"/>
202
<property name="javac.debug" value="true"/>
203
<property name="javadoc.preview" value="true"/>
204
<property name="application.args" value=""/>
205
<property name="source.encoding" value="${{file.encoding}}"/>
206
<condition property="javadoc.encoding.used" value="${{javadoc.encoding}}">
208
<isset property="javadoc.encoding"/>
210
<equals arg1="${{javadoc.encoding}}" arg2=""/>
214
<property name="javadoc.encoding.used" value="${{source.encoding}}"/>
215
<property name="includes" value="**"/>
216
<property name="excludes" value=""/>
217
<property name="do.depend" value="false"/>
218
<condition property="do.depend.true">
219
<istrue value="${{do.depend}}"/>
221
<condition property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${{jaxws.endorsed.dir}}'" else="">
223
<isset property="jaxws.endorsed.dir"/>
224
<available file="nbproject/jaxws-build.xml"/>
229
<target name="-post-init">
230
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
231
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
234
<target name="-init-check">
235
<xsl:attribute name="depends">-pre-init,-init-private,-init-user,-init-project,-do-init</xsl:attribute>
236
<!-- XXX XSLT 2.0 would make it possible to use a for-each here -->
237
<!-- Note that if the properties were defined in project.xml that would be easy -->
238
<!-- But required props should be defined by the AntBasedProjectType, not stored in each project -->
239
<xsl:call-template name="createSourcePathValidityTest">
240
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
242
<xsl:call-template name="createSourcePathValidityTest">
243
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
245
<fail unless="build.dir">Must set build.dir</fail>
246
<fail unless="dist.dir">Must set dist.dir</fail>
247
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
248
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
249
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
250
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
251
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
252
<fail unless="dist.jar">Must set dist.jar</fail>
255
<target name="-init-macrodef-property">
257
<xsl:attribute name="name">property</xsl:attribute>
258
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/1</xsl:attribute>
260
<xsl:attribute name="name">name</xsl:attribute>
263
<xsl:attribute name="name">value</xsl:attribute>
266
<property name="@{{name}}" value="${{@{{value}}}}"/>
271
<target name="-init-macrodef-javac">
273
<xsl:attribute name="name">javac</xsl:attribute>
274
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/3</xsl:attribute>
276
<xsl:attribute name="name">srcdir</xsl:attribute>
277
<xsl:attribute name="default">
278
<xsl:call-template name="createPath">
279
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
284
<xsl:attribute name="name">destdir</xsl:attribute>
285
<xsl:attribute name="default">${build.classes.dir}</xsl:attribute>
288
<xsl:attribute name="name">classpath</xsl:attribute>
289
<xsl:attribute name="default">${javac.classpath}</xsl:attribute>
292
<xsl:attribute name="name">includes</xsl:attribute>
293
<xsl:attribute name="default">${includes}</xsl:attribute>
296
<xsl:attribute name="name">excludes</xsl:attribute>
297
<xsl:attribute name="default">${excludes}</xsl:attribute>
300
<xsl:attribute name="name">debug</xsl:attribute>
301
<xsl:attribute name="default">${javac.debug}</xsl:attribute>
304
<xsl:attribute name="name">sourcepath</xsl:attribute>
305
<xsl:attribute name="default"/>
308
<xsl:attribute name="name">customize</xsl:attribute>
309
<xsl:attribute name="optional">true</xsl:attribute>
313
<xsl:attribute name="srcdir">@{srcdir}</xsl:attribute>
314
<xsl:attribute name="sourcepath">@{sourcepath}</xsl:attribute>
315
<xsl:attribute name="destdir">@{destdir}</xsl:attribute>
316
<xsl:attribute name="debug">@{debug}</xsl:attribute>
317
<xsl:attribute name="deprecation">${javac.deprecation}</xsl:attribute>
318
<xsl:attribute name="encoding">${source.encoding}</xsl:attribute>
319
<xsl:if test ="not(/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform/@explicit-source-supported ='false')">
320
<xsl:attribute name="source">${javac.source}</xsl:attribute>
321
<xsl:attribute name="target">${javac.target}</xsl:attribute>
323
<xsl:attribute name="includes">@{includes}</xsl:attribute>
324
<xsl:attribute name="excludes">@{excludes}</xsl:attribute>
325
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
326
<xsl:attribute name="fork">yes</xsl:attribute>
327
<xsl:attribute name="executable">${platform.javac}</xsl:attribute>
328
<xsl:attribute name="tempdir">${java.io.tmpdir}</xsl:attribute> <!-- XXX cf. #51482, Ant #29391 -->
330
<xsl:attribute name="includeantruntime">false</xsl:attribute>
332
<path path="@{{classpath}}"/>
334
<compilerarg line="${{javac.compilerargs}} ${{javac.compilerargs.jaxws}}"/>
339
<macrodef> <!-- #36033, #85707 -->
340
<xsl:attribute name="name">depend</xsl:attribute>
341
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/3</xsl:attribute>
343
<xsl:attribute name="name">srcdir</xsl:attribute>
344
<xsl:attribute name="default">
345
<xsl:call-template name="createPath">
346
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
351
<xsl:attribute name="name">destdir</xsl:attribute>
352
<xsl:attribute name="default">${build.classes.dir}</xsl:attribute>
355
<xsl:attribute name="name">classpath</xsl:attribute>
356
<xsl:attribute name="default">${javac.classpath}</xsl:attribute>
360
<xsl:attribute name="srcdir">@{srcdir}</xsl:attribute>
361
<xsl:attribute name="destdir">@{destdir}</xsl:attribute>
362
<xsl:attribute name="cache">${build.dir}/depcache</xsl:attribute>
363
<xsl:attribute name="includes">${includes}</xsl:attribute>
364
<xsl:attribute name="excludes">${excludes}</xsl:attribute>
366
<path path="@{{classpath}}"/>
371
<macrodef> <!-- #85707 -->
372
<xsl:attribute name="name">force-recompile</xsl:attribute>
373
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/3</xsl:attribute>
375
<xsl:attribute name="name">destdir</xsl:attribute>
376
<xsl:attribute name="default">${build.classes.dir}</xsl:attribute>
379
<fail unless="javac.includes">Must set javac.includes</fail>
380
<!-- XXX one little flaw in this weird trick: does not work on folders. -->
382
<xsl:attribute name="property">javac.includes.binary</xsl:attribute>
383
<xsl:attribute name="pathsep">,</xsl:attribute>
386
<xsl:attribute name="dir">@{destdir}</xsl:attribute>
387
<xsl:attribute name="files">${javac.includes}</xsl:attribute>
391
<xsl:attribute name="from">*.java</xsl:attribute>
392
<xsl:attribute name="to">*.class</xsl:attribute>
396
<files includes="${{javac.includes.binary}}"/>
402
<target name="-init-macrodef-junit">
404
<xsl:attribute name="name">junit</xsl:attribute>
405
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/3</xsl:attribute>
407
<xsl:attribute name="name">includes</xsl:attribute>
408
<xsl:attribute name="default">${includes}</xsl:attribute>
411
<xsl:attribute name="name">excludes</xsl:attribute>
412
<xsl:attribute name="default">${excludes}</xsl:attribute>
415
<xsl:attribute name="name">testincludes</xsl:attribute>
416
<xsl:attribute name="default">**</xsl:attribute>
420
<xsl:attribute name="showoutput">true</xsl:attribute>
421
<xsl:attribute name="fork">true</xsl:attribute>
422
<xsl:attribute name="dir">${work.dir}</xsl:attribute> <!-- #47474: match <java> -->
423
<xsl:attribute name="failureproperty">tests.failed</xsl:attribute>
424
<xsl:attribute name="errorproperty">tests.failed</xsl:attribute>
425
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
426
<xsl:attribute name="jvm">${platform.java}</xsl:attribute>
428
<batchtest todir="${{build.test.results.dir}}">
429
<xsl:call-template name="createFilesets">
430
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
431
<xsl:with-param name="includes">@{includes}</xsl:with-param>
432
<xsl:with-param name="includes2">@{testincludes}</xsl:with-param>
433
<xsl:with-param name="excludes">@{excludes}</xsl:with-param>
437
<path path="${{run.test.classpath}}"/>
440
<propertyref prefix="test-sys-prop."/>
441
<mapper type="glob" from="test-sys-prop.*" to="*"/>
443
<formatter type="brief" usefile="false"/>
444
<formatter type="xml"/>
445
<jvmarg line="${{run.jvmargs}}"/>
451
<target name="-init-macrodef-nbjpda">
453
<xsl:attribute name="name">nbjpdastart</xsl:attribute>
454
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/1</xsl:attribute>
456
<xsl:attribute name="name">name</xsl:attribute>
457
<xsl:attribute name="default">${main.class}</xsl:attribute>
460
<xsl:attribute name="name">classpath</xsl:attribute>
461
<xsl:attribute name="default">${debug.classpath}</xsl:attribute>
464
<xsl:attribute name="name">stopclassname</xsl:attribute>
465
<xsl:attribute name="default"></xsl:attribute>
468
<nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{{name}}" stopclassname="@{{stopclassname}}">
470
<path path="@{{classpath}}"/>
472
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
474
<path path="${{platform.bootcp}}"/>
481
<xsl:attribute name="name">nbjpdareload</xsl:attribute>
482
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/1</xsl:attribute>
484
<xsl:attribute name="name">dir</xsl:attribute>
485
<xsl:attribute name="default">${build.classes.dir}</xsl:attribute>
489
<fileset includes="${{fix.includes}}*.class" dir="@{{dir}}"/>
495
<target name="-init-debug-args">
497
<xsl:when test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
498
<exec executable="${{platform.java}}" outputproperty="version-output">
499
<arg value="-version"/>
503
<property name="version-output" value="java version "${{ant.java.version}}"/>
506
<condition property="have-jdk-older-than-1.4">
507
<!-- <matches pattern="^java version "1\.[0-3]" string="${version-output}"/> (ANT 1.7) -->
509
<contains string="${{version-output}}" substring="java version "1.0"/>
510
<contains string="${{version-output}}" substring="java version "1.1"/>
511
<contains string="${{version-output}}" substring="java version "1.2"/>
512
<contains string="${{version-output}}" substring="java version "1.3"/>
515
<condition property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none" else="-Xdebug">
516
<istrue value="${{have-jdk-older-than-1.4}}"/>
520
<target name="-init-macrodef-debug" depends="-init-debug-args">
522
<xsl:attribute name="name">debug</xsl:attribute>
523
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/3</xsl:attribute>
525
<xsl:attribute name="name">classname</xsl:attribute>
526
<xsl:attribute name="default">${main.class}</xsl:attribute>
529
<xsl:attribute name="name">classpath</xsl:attribute>
530
<xsl:attribute name="default">${debug.classpath}</xsl:attribute>
533
<xsl:attribute name="name">customize</xsl:attribute>
534
<xsl:attribute name="optional">true</xsl:attribute>
537
<java fork="true" classname="@{{classname}}">
538
<xsl:attribute name="dir">${work.dir}</xsl:attribute>
539
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
540
<xsl:attribute name="jvm">${platform.java}</xsl:attribute>
542
<jvmarg line="${{debug-args-line}}"/>
543
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${{jpda.address}}"/>
544
<jvmarg line="${{run.jvmargs}}"/>
546
<path path="@{{classpath}}"/>
549
<propertyref prefix="run-sys-prop."/>
550
<mapper type="glob" from="run-sys-prop.*" to="*"/>
558
<target name="-init-macrodef-java">
560
<xsl:attribute name="name">java</xsl:attribute>
561
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/1</xsl:attribute>
563
<xsl:attribute name="name">classname</xsl:attribute>
564
<xsl:attribute name="default">${main.class}</xsl:attribute>
567
<xsl:attribute name="name">customize</xsl:attribute>
568
<xsl:attribute name="optional">true</xsl:attribute>
571
<java fork="true" classname="@{{classname}}">
572
<xsl:attribute name="dir">${work.dir}</xsl:attribute>
573
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
574
<xsl:attribute name="jvm">${platform.java}</xsl:attribute>
576
<jvmarg line="${{run.jvmargs}}"/>
578
<path path="${{run.classpath}}"/>
581
<propertyref prefix="run-sys-prop."/>
582
<mapper type="glob" from="run-sys-prop.*" to="*"/>
590
<target name="-init-presetdef-jar">
592
<xsl:attribute name="name">jar</xsl:attribute>
593
<xsl:attribute name="uri">http://www.netbeans.org/ns/j2se-project/1</xsl:attribute>
594
<jar jarfile="${{dist.jar}}" compress="${{jar.compress}}">
595
<j2seproject1:fileset dir="${{build.classes.dir}}"/>
596
<!-- XXX should have a property serving as the excludes list -->
602
<xsl:attribute name="depends">-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar</xsl:attribute>
611
<xsl:call-template name="deps.target">
612
<xsl:with-param name="targetname" select="'deps-jar'"/>
613
<xsl:with-param name="type" select="'jar'"/>
616
<xsl:if test="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">
617
<target name="wscompile-init" depends="init">
618
<taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"
619
classpath="${{wscompile.classpath}}"/>
620
<taskdef name="wsclientuptodate" classname="org.netbeans.modules.websvc.jaxrpc.ant.WsClientUpToDate"
621
classpath="${{wsclientuptodate.classpath}}"/>
623
<mkdir dir="${{build.classes.dir}}"/>
624
<mkdir dir="${{build.generated.dir}}/wsclient"/>
625
<mkdir dir="${{build.generated.dir}}/wsbinary"/>
627
<xsl:for-each select="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">
628
<xsl:variable name="wsclientname">
629
<xsl:value-of select="jaxrpc:web-service-client-name"/>
632
<wsclientuptodate property="wscompile.client.{$wsclientname}.notrequired"
633
sourcewsdl="${{meta.inf.dir}}/wsdl/{$wsclientname}.wsdl"
634
targetdir="${{build.generated.dir}}/wsclient"/>
639
<xsl:for-each select="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">
640
<xsl:variable name="wsclientname">
641
<xsl:value-of select="jaxrpc:web-service-client-name"/>
643
<xsl:variable name="useimport">
645
<xsl:when test="jaxrpc:web-service-stub-type">
646
<xsl:value-of select="jaxrpc:web-service-stub-type='jsr-109_client'"/>
648
<xsl:otherwise>true</xsl:otherwise>
651
<xsl:variable name="useclient">
653
<xsl:when test="jaxrpc:web-service-stub-type">
654
<xsl:value-of select="jaxrpc:web-service-stub-type='jaxrpc_static_client'"/>
656
<xsl:otherwise>false</xsl:otherwise>
660
<target name="{$wsclientname}-client-wscompile" depends="wscompile-init" unless="wscompile.client.{$wsclientname}.notrequired">
661
<property name="config_target" location="${{meta.inf.dir}}/wsdl"/>
662
<copy file="${{meta.inf.dir}}/wsdl/{$wsclientname}-config.xml"
663
tofile="${{build.generated.dir}}/wsclient/wsdl/{$wsclientname}-config.xml" filtering="on" encoding="UTF-8">
665
<!-- replace token with reference to WSDL file in source tree, not build tree, since the
666
the file probably has not have been copied to the build tree yet. -->
667
<filter token="CONFIG_ABSOLUTE_PATH" value="${{config_target}}"/>
671
verbose="${{wscompile.client.{$wsclientname}.verbose}}"
672
debug="${{wscompile.client.{$wsclientname}.debug}}"
673
xPrintStackTrace="${{wscompile.client.{$wsclientname}.xPrintStackTrace}}"
674
xSerializable="${{wscompile.client.{$wsclientname}.xSerializable}}"
675
optimize="${{wscompile.client.{$wsclientname}.optimize}}"
676
fork="true" keep="true"
677
client="{$useclient}" import="{$useimport}"
678
features="${{wscompile.client.{$wsclientname}.features}}"
679
base="${{build.generated.dir}}/wsbinary"
680
sourceBase="${{build.generated.dir}}/wsclient"
681
classpath="${{wscompile.classpath}}:${{javac.classpath}}"
682
mapping="${{build.generated.dir}}/wsclient/wsdl/{$wsclientname}-mapping.xml"
683
httpproxy="${{wscompile.client.{$wsclientname}.proxy}}"
684
config="${{build.generated.dir}}/wsclient/wsdl/{$wsclientname}-config.xml">
689
<xsl:if test="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">
690
<target name="web-service-client-generate">
691
<xsl:attribute name="depends">
692
<xsl:for-each select="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">
693
<xsl:if test="position()!=1"><xsl:text>, </xsl:text></xsl:if>
694
<xsl:variable name="wsname2">
695
<xsl:value-of select="jaxrpc:web-service-client-name"/>
697
<xsl:value-of select="jaxrpc:web-service-client-name"/><xsl:text>-client-wscompile</xsl:text>
701
<target name="-web-service-client-compile-depend" if="do.depend.true">
702
<j2seproject3:depend srcdir="${{build.generated.dir}}/wsclient" classpath="${{wscompile.classpath}}:${{javac.classpath}}" destdir="${{build.classes.dir}}"/>
704
<target name="web-service-client-compile" depends="web-service-client-generate,-web-service-client-compile-depend">
705
<j2seproject3:javac srcdir="${{build.generated.dir}}/wsclient" classpath="${{wscompile.classpath}}:${{javac.classpath}}" destdir="${{build.classes.dir}}"/>
709
<target name="-pre-pre-compile">
710
<xsl:attribute name="depends">init,deps-jar<xsl:if test="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">,web-service-client-generate</xsl:if></xsl:attribute>
711
<mkdir dir="${{build.classes.dir}}"/>
714
<target name="-pre-compile">
715
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
716
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
719
<target name="-compile-depend" if="do.depend.true">
720
<j2seproject3:depend/>
722
<target name="-do-compile">
723
<xsl:attribute name="depends">init,deps-jar,-pre-pre-compile,-pre-compile<xsl:if test="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">,web-service-client-compile</xsl:if>,-compile-depend</xsl:attribute>
724
<xsl:attribute name="if">have.sources</xsl:attribute>
725
<j2seproject3:javac/>
726
<copy todir="${{build.classes.dir}}">
727
<xsl:call-template name="createFilesets">
728
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
729
<!-- XXX should perhaps use ${includes} and ${excludes} -->
730
<xsl:with-param name="excludes">${build.classes.excludes}</xsl:with-param>
735
<target name="-post-compile">
736
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
737
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
740
<target name="compile">
741
<xsl:attribute name="depends">init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile</xsl:attribute>
742
<xsl:attribute name="description">Compile project.</xsl:attribute>
745
<target name="-pre-compile-single">
746
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
747
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
750
<target name="-do-compile-single">
751
<xsl:attribute name="depends">init,deps-jar,-pre-pre-compile<xsl:if test="/p:project/p:configuration/jaxrpc:web-service-clients/jaxrpc:web-service-client">,web-service-client-compile</xsl:if></xsl:attribute>
752
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
753
<j2seproject3:force-recompile/>
754
<xsl:element name="j2seproject3:javac">
755
<xsl:attribute name="includes">${javac.includes}</xsl:attribute>
756
<xsl:attribute name="excludes"/>
757
<xsl:attribute name="sourcepath"> <!-- #115918 -->
758
<xsl:call-template name="createPath">
759
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
765
<target name="-post-compile-single">
766
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
767
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
770
<target name="compile-single">
771
<xsl:attribute name="depends">init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single</xsl:attribute>
780
<target name="-pre-pre-jar">
781
<xsl:attribute name="depends">init</xsl:attribute>
782
<dirname property="dist.jar.dir" file="${{dist.jar}}"/>
783
<mkdir dir="${{dist.jar.dir}}"/>
786
<target name="-pre-jar">
787
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
788
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
791
<target name="-do-jar-without-manifest">
792
<xsl:attribute name="depends">init,compile,-pre-pre-jar,-pre-jar</xsl:attribute>
793
<xsl:attribute name="unless">manifest.available</xsl:attribute>
797
<target name="-do-jar-with-manifest">
798
<xsl:attribute name="depends">init,compile,-pre-pre-jar,-pre-jar</xsl:attribute>
799
<xsl:attribute name="if">manifest.available</xsl:attribute>
800
<xsl:attribute name="unless">manifest.available+main.class</xsl:attribute>
801
<j2seproject1:jar manifest="${{manifest.file}}"/>
804
<target name="-do-jar-with-mainclass">
805
<xsl:attribute name="depends">init,compile,-pre-pre-jar,-pre-jar</xsl:attribute>
806
<xsl:attribute name="if">manifest.available+main.class</xsl:attribute>
807
<xsl:attribute name="unless">manifest.available+main.class+mkdist.available</xsl:attribute>
808
<j2seproject1:jar manifest="${{manifest.file}}">
809
<j2seproject1:manifest>
810
<j2seproject1:attribute name="Main-Class" value="${{main.class}}"/>
811
</j2seproject1:manifest>
813
<echo>To run this application from the command line without Ant, try:</echo>
814
<property name="build.classes.dir.resolved" location="${{build.classes.dir}}"/>
815
<property name="dist.jar.resolved" location="${{dist.jar}}"/>
816
<pathconvert property="run.classpath.with.dist.jar">
817
<path path="${{run.classpath}}"/>
818
<map from="${{build.classes.dir.resolved}}" to="${{dist.jar.resolved}}"/>
821
<xsl:when test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">${platform.java}</xsl:when>
822
<xsl:otherwise>java</xsl:otherwise>
823
</xsl:choose> -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
826
<target name="-do-jar-with-libraries">
827
<xsl:attribute name="depends">init,compile,-pre-pre-jar,-pre-jar</xsl:attribute>
828
<xsl:attribute name="if">manifest.available+main.class+mkdist.available</xsl:attribute>
830
<property name="build.classes.dir.resolved" location="${{build.classes.dir}}"/>
831
<pathconvert property="run.classpath.without.build.classes.dir">
832
<path path="${{run.classpath}}"/>
833
<map from="${{build.classes.dir.resolved}}" to=""/>
835
<pathconvert property="jar.classpath" pathsep=" ">
836
<path path="${{run.classpath.without.build.classes.dir}}"/>
839
<globmapper from="*" to="lib/*"/>
842
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${{libs.CopyLibs.classpath}}"/>
843
<copylibs manifest="${{manifest.file}}" runtimeclasspath="${{run.classpath.without.build.classes.dir}}" jarfile="${{dist.jar}}" compress="${{jar.compress}}">
844
<fileset dir="${{build.classes.dir}}"/>
846
<attribute name="Main-Class" value="${{main.class}}"/>
847
<attribute name="Class-Path" value="${{jar.classpath}}"/>
850
<echo>To run this application from the command line without Ant, try:</echo>
851
<property name="dist.jar.resolved" location="${{dist.jar}}"/>
853
<xsl:when test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">${platform.java}</xsl:when>
854
<xsl:otherwise>java</xsl:otherwise>
855
</xsl:choose> -jar "${dist.jar.resolved}"</echo>
858
<target name="-post-jar">
859
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
860
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
864
<xsl:attribute name="depends">init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar</xsl:attribute>
865
<xsl:attribute name="description">Build JAR.</xsl:attribute>
875
<xsl:attribute name="depends">init,compile</xsl:attribute>
876
<xsl:attribute name="description">Run a main class.</xsl:attribute>
879
<arg line="${{application.args}}"/>
884
<target name="-do-not-recompile">
885
<property name="javac.includes.binary" value=""/> <!-- #116230 hack -->
887
<target name="run-single">
888
<xsl:attribute name="depends">init,-do-not-recompile,compile-single</xsl:attribute>
889
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
890
<j2seproject1:java classname="${{run.class}}"/>
899
<target name="-debug-start-debugger">
900
<xsl:attribute name="if">netbeans.home</xsl:attribute>
901
<xsl:attribute name="depends">init</xsl:attribute>
902
<j2seproject1:nbjpdastart name="${{debug.class}}"/>
905
<target name="-debug-start-debuggee">
906
<xsl:attribute name="depends">init,compile</xsl:attribute>
909
<arg line="${{application.args}}"/>
911
</j2seproject3:debug>
914
<target name="debug">
915
<xsl:attribute name="if">netbeans.home</xsl:attribute>
916
<xsl:attribute name="depends">init,compile,-debug-start-debugger,-debug-start-debuggee</xsl:attribute>
917
<xsl:attribute name="description">Debug project in IDE.</xsl:attribute>
920
<target name="-debug-start-debugger-stepinto">
921
<xsl:attribute name="if">netbeans.home</xsl:attribute>
922
<xsl:attribute name="depends">init</xsl:attribute>
923
<j2seproject1:nbjpdastart stopclassname="${{main.class}}"/>
926
<target name="debug-stepinto">
927
<xsl:attribute name="if">netbeans.home</xsl:attribute>
928
<xsl:attribute name="depends">init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee</xsl:attribute>
931
<target name="-debug-start-debuggee-single">
932
<xsl:attribute name="if">netbeans.home</xsl:attribute>
933
<xsl:attribute name="depends">init,compile-single</xsl:attribute>
934
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
935
<j2seproject3:debug classname="${{debug.class}}"/>
938
<target name="debug-single">
939
<xsl:attribute name="if">netbeans.home</xsl:attribute>
940
<xsl:attribute name="depends">init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single</xsl:attribute>
943
<target name="-pre-debug-fix">
944
<xsl:attribute name="depends">init</xsl:attribute>
945
<fail unless="fix.includes">Must set fix.includes</fail>
946
<property name="javac.includes" value="${{fix.includes}}.java"/>
949
<target name="-do-debug-fix">
950
<xsl:attribute name="if">netbeans.home</xsl:attribute>
951
<xsl:attribute name="depends">init,-pre-debug-fix,compile-single</xsl:attribute>
952
<j2seproject1:nbjpdareload/>
955
<target name="debug-fix">
956
<xsl:attribute name="if">netbeans.home</xsl:attribute>
957
<xsl:attribute name="depends">init,-pre-debug-fix,-do-debug-fix</xsl:attribute>
966
<target name="-javadoc-build">
967
<xsl:attribute name="depends">init</xsl:attribute>
968
<mkdir dir="${{dist.javadoc.dir}}"/>
969
<!-- XXX do an up-to-date check first -->
971
<xsl:attribute name="destdir">${dist.javadoc.dir}</xsl:attribute>
972
<xsl:attribute name="source">${javac.source}</xsl:attribute>
973
<xsl:attribute name="notree">${javadoc.notree}</xsl:attribute>
974
<xsl:attribute name="use">${javadoc.use}</xsl:attribute>
975
<xsl:attribute name="nonavbar">${javadoc.nonavbar}</xsl:attribute>
976
<xsl:attribute name="noindex">${javadoc.noindex}</xsl:attribute>
977
<xsl:attribute name="splitindex">${javadoc.splitindex}</xsl:attribute>
978
<xsl:attribute name="author">${javadoc.author}</xsl:attribute>
979
<xsl:attribute name="version">${javadoc.version}</xsl:attribute>
980
<xsl:attribute name="windowtitle">${javadoc.windowtitle}</xsl:attribute>
981
<xsl:attribute name="private">${javadoc.private}</xsl:attribute>
982
<xsl:attribute name="additionalparam">${javadoc.additionalparam}</xsl:attribute>
983
<xsl:attribute name="failonerror">true</xsl:attribute> <!-- #47325 -->
984
<xsl:attribute name="useexternalfile">true</xsl:attribute> <!-- #57375, requires Ant >=1.6.5 -->
985
<xsl:attribute name="encoding">${javadoc.encoding.used}</xsl:attribute>
986
<xsl:attribute name="docencoding">UTF-8</xsl:attribute>
987
<xsl:attribute name="charset">UTF-8</xsl:attribute>
988
<xsl:if test="/p:project/p:configuration/j2seproject3:data/j2seproject3:explicit-platform">
989
<xsl:attribute name="executable">${platform.javadoc}</xsl:attribute>
992
<path path="${{javac.classpath}}"/>
994
<!-- Does not work with includes/excludes:
996
<xsl:call-template name="createPathElements">
997
<xsl:with-param name="locations" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
1001
<!-- Does not work with includes/excludes either, and duplicates class names in index:
1002
<xsl:call-template name="createPackagesets">
1003
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
1004
</xsl:call-template>
1006
<xsl:call-template name="createFilesets">
1007
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:source-roots"/>
1008
<xsl:with-param name="includes2">**/*.java</xsl:with-param>
1009
</xsl:call-template>
1013
<target name="-javadoc-browse">
1014
<xsl:attribute name="if">netbeans.home</xsl:attribute>
1015
<xsl:attribute name="unless">no.javadoc.preview</xsl:attribute>
1016
<xsl:attribute name="depends">init,-javadoc-build</xsl:attribute>
1017
<nbbrowse file="${{dist.javadoc.dir}}/index.html"/>
1020
<target name="javadoc">
1021
<xsl:attribute name="depends">init,-javadoc-build,-javadoc-browse</xsl:attribute>
1022
<xsl:attribute name="description">Build Javadoc.</xsl:attribute>
1026
=========================
1027
JUNIT COMPILATION SECTION
1028
=========================
1031
<target name="-pre-pre-compile-test">
1032
<xsl:attribute name="if">have.tests</xsl:attribute>
1033
<xsl:attribute name="depends">init,compile</xsl:attribute>
1034
<mkdir dir="${{build.test.classes.dir}}"/>
1037
<target name="-pre-compile-test">
1038
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
1039
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
1042
<target name="-compile-test-depend" if="do.depend.true">
1043
<xsl:element name="j2seproject3:depend">
1044
<xsl:attribute name="srcdir">
1045
<xsl:call-template name="createPath">
1046
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1047
</xsl:call-template>
1049
<xsl:attribute name="destdir">${build.test.classes.dir}</xsl:attribute>
1050
<xsl:attribute name="classpath">${javac.test.classpath}</xsl:attribute>
1053
<target name="-do-compile-test">
1054
<xsl:attribute name="if">have.tests</xsl:attribute>
1055
<xsl:attribute name="depends">init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend</xsl:attribute>
1056
<xsl:element name="j2seproject3:javac">
1057
<xsl:attribute name="srcdir">
1058
<xsl:call-template name="createPath">
1059
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1060
</xsl:call-template>
1062
<xsl:attribute name="destdir">${build.test.classes.dir}</xsl:attribute>
1063
<xsl:attribute name="debug">true</xsl:attribute>
1064
<xsl:attribute name="classpath">${javac.test.classpath}</xsl:attribute>
1066
<copy todir="${{build.test.classes.dir}}">
1067
<xsl:call-template name="createFilesets">
1068
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1069
<xsl:with-param name="excludes">${build.classes.excludes}</xsl:with-param>
1070
</xsl:call-template>
1074
<target name="-post-compile-test">
1075
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
1076
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
1079
<target name="compile-test">
1080
<xsl:attribute name="depends">init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test</xsl:attribute>
1083
<target name="-pre-compile-test-single">
1084
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
1085
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
1088
<target name="-do-compile-test-single">
1089
<xsl:attribute name="if">have.tests</xsl:attribute>
1090
<xsl:attribute name="depends">init,compile,-pre-pre-compile-test,-pre-compile-test-single</xsl:attribute>
1091
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1092
<xsl:element name="j2seproject3:force-recompile">
1093
<xsl:attribute name="destdir">${build.test.classes.dir}</xsl:attribute>
1095
<xsl:element name="j2seproject3:javac">
1096
<xsl:attribute name="srcdir">
1097
<xsl:call-template name="createPath">
1098
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1099
</xsl:call-template>
1101
<xsl:attribute name="sourcepath">
1102
<xsl:call-template name="createPath">
1103
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1104
</xsl:call-template>
1106
<xsl:attribute name="destdir">${build.test.classes.dir}</xsl:attribute>
1107
<xsl:attribute name="debug">true</xsl:attribute>
1108
<xsl:attribute name="classpath">${javac.test.classpath}</xsl:attribute>
1109
<xsl:attribute name="includes">${javac.includes}</xsl:attribute>
1110
<xsl:attribute name="excludes"/>
1112
<copy todir="${{build.test.classes.dir}}">
1113
<xsl:call-template name="createFilesets">
1114
<xsl:with-param name="roots" select="/p:project/p:configuration/j2seproject3:data/j2seproject3:test-roots"/>
1115
<xsl:with-param name="excludes">${build.classes.excludes}</xsl:with-param>
1116
</xsl:call-template>
1120
<target name="-post-compile-test-single">
1121
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
1122
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
1125
<target name="compile-test-single">
1126
<xsl:attribute name="depends">init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single</xsl:attribute>
1130
=======================
1131
JUNIT EXECUTION SECTION
1132
=======================
1135
<target name="-pre-test-run">
1136
<xsl:attribute name="if">have.tests</xsl:attribute>
1137
<xsl:attribute name="depends">init</xsl:attribute>
1138
<mkdir dir="${{build.test.results.dir}}"/>
1141
<target name="-do-test-run">
1142
<xsl:attribute name="if">have.tests</xsl:attribute>
1143
<xsl:attribute name="depends">init,compile-test,-pre-test-run</xsl:attribute>
1144
<j2seproject3:junit testincludes="**/*Test.java"/>
1147
<target name="-post-test-run">
1148
<xsl:attribute name="if">have.tests</xsl:attribute>
1149
<xsl:attribute name="depends">init,compile-test,-pre-test-run,-do-test-run</xsl:attribute>
1150
<fail if="tests.failed">Some tests failed; see details above.</fail>
1153
<target name="test-report">
1154
<xsl:attribute name="if">have.tests</xsl:attribute>
1155
<xsl:attribute name="depends">init</xsl:attribute>
1157
<junitreport todir="${{build.test.results.dir}}">
1158
<fileset dir="${{build.test.results.dir}}">
1159
<include name="TEST-*.xml"/>
1161
<report format="noframes" todir="${{build.test.results.dir}}"/>
1166
<target name="-test-browse">
1167
<xsl:attribute name="if">netbeans.home+have.tests</xsl:attribute>
1168
<xsl:attribute name="depends">init</xsl:attribute>
1170
<nbbrowse file="${{build.test.results.dir}}/junit-noframes.html"/>
1174
<target name="test">
1175
<xsl:attribute name="depends">init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse</xsl:attribute>
1176
<xsl:attribute name="description">Run unit tests.</xsl:attribute>
1179
<target name="-pre-test-run-single">
1180
<xsl:attribute name="if">have.tests</xsl:attribute>
1181
<xsl:attribute name="depends">init</xsl:attribute>
1182
<mkdir dir="${{build.test.results.dir}}"/>
1185
<target name="-do-test-run-single">
1186
<xsl:attribute name="if">have.tests</xsl:attribute>
1187
<xsl:attribute name="depends">init,compile-test-single,-pre-test-run-single</xsl:attribute>
1188
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1189
<j2seproject3:junit includes="${{test.includes}}" excludes=""/>
1192
<target name="-post-test-run-single">
1193
<xsl:attribute name="if">have.tests</xsl:attribute>
1194
<xsl:attribute name="depends">init,compile-test-single,-pre-test-run-single,-do-test-run-single</xsl:attribute>
1195
<fail if="tests.failed">Some tests failed; see details above.</fail>
1198
<target name="test-single">
1199
<xsl:attribute name="depends">init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single</xsl:attribute>
1200
<xsl:attribute name="description">Run single unit test.</xsl:attribute>
1204
=======================
1205
JUNIT DEBUGGING SECTION
1206
=======================
1209
<target name="-debug-start-debuggee-test">
1210
<xsl:attribute name="if">have.tests</xsl:attribute>
1211
<xsl:attribute name="depends">init,compile-test</xsl:attribute>
1212
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1213
<property name="test.report.file" location="${{build.test.results.dir}}/TEST-${{test.class}}.xml"/>
1214
<delete file="${{test.report.file}}"/>
1215
<mkdir dir="${{build.test.results.dir}}"/>
1216
<!--Ugly, puts ant and ant-junit to the test classpath, but there is probably no other solution how to run the XML formatter -->
1217
<j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${{ant.home}}/lib/ant.jar:${{ant.home}}/lib/ant-junit.jar:${{debug.test.classpath}}">
1220
<propertyref prefix="test-sys-prop."/>
1221
<mapper type="glob" from="test-sys-prop.*" to="*"/>
1223
<arg value="${{test.class}}"/>
1224
<arg value="showoutput=true"/>
1225
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
1226
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${{test.report.file}}"/>
1228
</j2seproject3:debug>
1231
<target name="-debug-start-debugger-test">
1232
<xsl:attribute name="if">netbeans.home+have.tests</xsl:attribute>
1233
<xsl:attribute name="depends">init,compile-test</xsl:attribute>
1234
<j2seproject1:nbjpdastart name="${{test.class}}" classpath="${{debug.test.classpath}}"/>
1237
<target name="debug-test">
1238
<xsl:attribute name="depends">init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test</xsl:attribute>
1241
<target name="-do-debug-fix-test">
1242
<xsl:attribute name="if">netbeans.home</xsl:attribute>
1243
<xsl:attribute name="depends">init,-pre-debug-fix,compile-test-single</xsl:attribute>
1244
<j2seproject1:nbjpdareload dir="${{build.test.classes.dir}}"/>
1247
<target name="debug-fix-test">
1248
<xsl:attribute name="if">netbeans.home</xsl:attribute>
1249
<xsl:attribute name="depends">init,-pre-debug-fix,-do-debug-fix-test</xsl:attribute>
1254
=========================
1255
APPLET EXECUTION SECTION
1256
=========================
1259
<target name="run-applet">
1260
<xsl:attribute name="depends">init,compile-single</xsl:attribute>
1261
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1262
<j2seproject1:java classname="sun.applet.AppletViewer">
1264
<arg value="${{applet.url}}"/>
1266
</j2seproject1:java>
1270
=========================
1271
APPLET DEBUGGING SECTION
1272
=========================
1275
<target name="-debug-start-debuggee-applet">
1276
<xsl:attribute name="if">netbeans.home</xsl:attribute>
1277
<xsl:attribute name="depends">init,compile-single</xsl:attribute>
1278
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1279
<j2seproject3:debug classname="sun.applet.AppletViewer">
1281
<arg value="${{applet.url}}"/>
1283
</j2seproject3:debug>
1286
<target name="debug-applet">
1287
<xsl:attribute name="if">netbeans.home</xsl:attribute>
1288
<xsl:attribute name="depends">init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet</xsl:attribute>
1297
<xsl:call-template name="deps.target">
1298
<xsl:with-param name="targetname" select="'deps-clean'"/>
1299
</xsl:call-template>
1301
<target name="-do-clean">
1302
<xsl:attribute name="depends">init</xsl:attribute>
1303
<delete dir="${{build.dir}}"/>
1304
<delete dir="${{dist.dir}}"/>
1305
<!-- XXX explicitly delete all build.* and dist.* dirs in case they are not subdirs -->
1308
<target name="-post-clean">
1309
<xsl:comment> Empty placeholder for easier customization. </xsl:comment>
1310
<xsl:comment> You can override this target in the ../build.xml file. </xsl:comment>
1313
<target name="clean">
1314
<xsl:attribute name="depends">init,deps-clean,-do-clean,-post-clean</xsl:attribute>
1315
<xsl:attribute name="description">Clean build products.</xsl:attribute>
1323
Generic template to build subdependencies of a certain type.
1324
Feel free to copy into other modules.
1325
@param targetname required name of target to generate
1326
@param type artifact-type from project.xml to filter on; optional, if not specified, uses
1327
all references, and looks for clean targets rather than build targets
1328
@return an Ant target which builds (or cleans) all known subprojects
1330
<xsl:template name="deps.target">
1331
<xsl:param name="targetname"/>
1332
<xsl:param name="type"/>
1333
<target name="{$targetname}">
1334
<xsl:attribute name="depends">init</xsl:attribute>
1335
<xsl:attribute name="unless">no.deps</xsl:attribute>
1337
<xsl:variable name="references2" select="/p:project/p:configuration/projdeps2:references"/>
1338
<xsl:for-each select="$references2/projdeps2:reference[not($type) or projdeps2:artifact-type = $type]">
1339
<xsl:variable name="subproj" select="projdeps2:foreign-project"/>
1340
<xsl:variable name="subtarget">
1342
<xsl:when test="$type">
1343
<xsl:value-of select="projdeps2:target"/>
1346
<xsl:value-of select="projdeps2:clean-target"/>
1350
<xsl:variable name="script" select="projdeps2:script"/>
1352
<xsl:when test="projdeps2:properties">
1353
<ant target="{$subtarget}" inheritall="false" antfile="{$script}">
1354
<xsl:for-each select="projdeps2:properties/projdeps2:property">
1355
<property name="{@name}" value="{.}"/>
1360
<ant target="{$subtarget}" inheritall="false" antfile="{$script}"/>
1365
<xsl:variable name="references" select="/p:project/p:configuration/projdeps:references"/>
1366
<xsl:for-each select="$references/projdeps:reference[not($type) or projdeps:artifact-type = $type]">
1367
<xsl:variable name="subproj" select="projdeps:foreign-project"/>
1368
<xsl:variable name="subtarget">
1370
<xsl:when test="$type">
1371
<xsl:value-of select="projdeps:target"/>
1374
<xsl:value-of select="projdeps:clean-target"/>
1378
<xsl:variable name="script" select="projdeps:script"/>
1379
<ant target="{$subtarget}" inheritall="false" antfile="${{project.{$subproj}}}/{$script}"/>
1385
<xsl:template name="createRootAvailableTest">
1386
<xsl:param name="roots"/>
1387
<xsl:param name="propName"/>
1388
<xsl:element name="condition">
1389
<xsl:attribute name="property"><xsl:value-of select="$propName"/></xsl:attribute>
1391
<xsl:for-each select="$roots/j2seproject3:root">
1392
<xsl:element name="available">
1393
<xsl:attribute name="file"><xsl:text>${</xsl:text><xsl:value-of select="@id"/><xsl:text>}</xsl:text></xsl:attribute>
1400
<xsl:template name="createSourcePathValidityTest">
1401
<xsl:param name="roots"/>
1402
<xsl:for-each select="$roots/j2seproject3:root">
1403
<xsl:element name="fail">
1404
<xsl:attribute name="unless"><xsl:value-of select="@id"/></xsl:attribute>
1405
<xsl:text>Must set </xsl:text><xsl:value-of select="@id"/>
1410
<xsl:template name="createFilesets">
1411
<xsl:param name="roots"/>
1412
<xsl:param name="includes" select="'${includes}'"/>
1413
<xsl:param name="includes2"/>
1414
<xsl:param name="excludes"/>
1415
<xsl:for-each select="$roots/j2seproject3:root">
1416
<xsl:element name="fileset">
1417
<xsl:attribute name="dir"><xsl:text>${</xsl:text><xsl:value-of select="@id"/><xsl:text>}</xsl:text></xsl:attribute>
1418
<xsl:attribute name="includes"><xsl:value-of select="$includes"/></xsl:attribute>
1420
<xsl:when test="$excludes">
1421
<xsl:attribute name="excludes"><xsl:value-of select="$excludes"/>,${excludes}</xsl:attribute>
1424
<xsl:attribute name="excludes">${excludes}</xsl:attribute>
1427
<xsl:if test="$includes2">
1428
<filename name="{$includes2}"/>
1434
<xsl:template name="createPackagesets">
1435
<xsl:param name="roots"/>
1436
<xsl:param name="includes" select="'${includes}'"/>
1437
<xsl:param name="excludes"/>
1438
<xsl:for-each select="$roots/j2seproject3:root">
1439
<xsl:element name="packageset">
1440
<xsl:attribute name="dir"><xsl:text>${</xsl:text><xsl:value-of select="@id"/><xsl:text>}</xsl:text></xsl:attribute>
1441
<xsl:attribute name="includes"><xsl:value-of select="$includes"/></xsl:attribute>
1443
<xsl:when test="$excludes">
1444
<xsl:attribute name="excludes"><xsl:value-of select="$excludes"/>,${excludes}</xsl:attribute>
1447
<xsl:attribute name="excludes">${excludes}</xsl:attribute>
1454
<xsl:template name="createPathElements">
1455
<xsl:param name="locations"/>
1456
<xsl:for-each select="$locations/j2seproject3:root">
1457
<xsl:element name="pathelement">
1458
<xsl:attribute name="location"><xsl:text>${</xsl:text><xsl:value-of select="@id"/><xsl:text>}</xsl:text></xsl:attribute>
1463
<xsl:template name="createPath">
1464
<xsl:param name="roots"/>
1465
<xsl:for-each select="$roots/j2seproject3:root">
1466
<xsl:if test="position() != 1">
1467
<xsl:text>:</xsl:text>
1469
<xsl:text>${</xsl:text>
1470
<xsl:value-of select="@id"/>
1471
<xsl:text>}</xsl:text>