Adding samples from API fest to the repository, including pieces of their code in the document, not just links
1 <?xml version="1.0" encoding="UTF-8"?>
3 *** GENERATED FROM project.xml - DO NOT EDIT ***
4 *** EDIT ../build.xml INSTEAD ***
6 For the purpose of easier reading the script
7 is divided into following sections:
22 <project name="stackbasedsolution-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
23 <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
25 ======================
26 INITIALIZATION SECTION
27 ======================
29 <target name="-pre-init">
30 <!-- Empty placeholder for easier customization. -->
31 <!-- You can override this target in the ../build.xml file. -->
33 <target name="-init-private" depends="-pre-init">
34 <property file="nbproject/private/private.properties"/>
36 <target name="-init-user" depends="-pre-init,-init-private">
37 <property file="${user.properties.file}"/>
38 <!-- The two properties below are usually overridden -->
39 <!-- by the active platform. Just a fallback. -->
40 <property name="default.javac.source" value="1.4"/>
41 <property name="default.javac.target" value="1.4"/>
43 <target name="-init-project" depends="-pre-init,-init-private,-init-user">
44 <property file="nbproject/project.properties"/>
46 <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
47 <available file="${manifest.file}" property="manifest.available"/>
48 <condition property="manifest.available+main.class">
50 <isset property="manifest.available"/>
51 <isset property="main.class"/>
53 <equals arg1="${main.class}" arg2="" trim="true"/>
57 <condition property="manifest.available+main.class+mkdist.available">
59 <istrue value="${manifest.available+main.class}"/>
60 <isset property="libs.CopyLibs.classpath"/>
63 <condition property="have.tests">
65 <available file="${test.src.dir}"/>
68 <condition property="have.sources">
70 <available file="${src.dir}"/>
73 <condition property="netbeans.home+have.tests">
75 <isset property="netbeans.home"/>
76 <isset property="have.tests"/>
79 <condition property="no.javadoc.preview">
80 <isfalse value="${javadoc.preview}"/>
82 <property name="run.jvmargs" value=""/>
83 <property name="javac.compilerargs" value=""/>
84 <property name="work.dir" value="${basedir}"/>
85 <condition property="no.deps">
87 <istrue value="${no.dependencies}"/>
90 <property name="javac.debug" value="true"/>
91 <property name="javadoc.preview" value="true"/>
92 <property name="application.args" value=""/>
94 <target name="-post-init">
95 <!-- Empty placeholder for easier customization. -->
96 <!-- You can override this target in the ../build.xml file. -->
98 <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
99 <fail unless="src.dir">Must set src.dir</fail>
100 <fail unless="test.src.dir">Must set test.src.dir</fail>
101 <fail unless="build.dir">Must set build.dir</fail>
102 <fail unless="dist.dir">Must set dist.dir</fail>
103 <fail unless="build.classes.dir">Must set build.classes.dir</fail>
104 <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
105 <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
106 <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
107 <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
108 <fail unless="dist.jar">Must set dist.jar</fail>
110 <target name="-init-macrodef-property">
111 <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
112 <attribute name="name"/>
113 <attribute name="value"/>
115 <property name="@{name}" value="${@{value}}"/>
119 <target name="-init-macrodef-javac">
120 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
121 <attribute name="srcdir" default="${src.dir}"/>
122 <attribute name="destdir" default="${build.classes.dir}"/>
123 <attribute name="classpath" default="${javac.classpath}"/>
124 <attribute name="debug" default="${javac.debug}"/>
125 <element name="customize" optional="true"/>
127 <depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${build.dir}/depcache">
129 <path path="@{classpath}"/>
132 <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
134 <path path="@{classpath}"/>
136 <compilerarg line="${javac.compilerargs}"/>
142 <target name="-init-macrodef-junit">
143 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
144 <attribute name="includes" default="**/*Test.java"/>
146 <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
147 <batchtest todir="${build.test.results.dir}">
148 <fileset dir="${test.src.dir}" includes="@{includes}"/>
151 <path path="${run.test.classpath}"/>
154 <propertyref prefix="test-sys-prop."/>
155 <mapper type="glob" from="test-sys-prop.*" to="*"/>
157 <formatter type="brief" usefile="false"/>
158 <formatter type="xml"/>
159 <jvmarg line="${run.jvmargs}"/>
164 <target name="-init-macrodef-nbjpda">
165 <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
166 <attribute name="name" default="${main.class}"/>
167 <attribute name="classpath" default="${debug.classpath}"/>
168 <attribute name="stopclassname" default=""/>
170 <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
172 <path path="@{classpath}"/>
177 <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
178 <attribute name="dir" default="${build.classes.dir}"/>
181 <fileset includes="${fix.includes}*.class" dir="@{dir}"/>
186 <target name="-init-macrodef-debug">
187 <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
188 <attribute name="classname" default="${main.class}"/>
189 <attribute name="classpath" default="${debug.classpath}"/>
190 <element name="customize" optional="true"/>
192 <java fork="true" classname="@{classname}" dir="${work.dir}">
193 <jvmarg value="-Xdebug"/>
194 <jvmarg value="-Xnoagent"/>
195 <jvmarg value="-Djava.compiler=none"/>
196 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
197 <jvmarg line="${run.jvmargs}"/>
199 <path path="@{classpath}"/>
202 <propertyref prefix="run-sys-prop."/>
203 <mapper type="glob" from="run-sys-prop.*" to="*"/>
210 <target name="-init-macrodef-java">
211 <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
212 <attribute name="classname" default="${main.class}"/>
213 <element name="customize" optional="true"/>
215 <java fork="true" classname="@{classname}" dir="${work.dir}">
216 <jvmarg line="${run.jvmargs}"/>
218 <path path="${run.classpath}"/>
221 <propertyref prefix="run-sys-prop."/>
222 <mapper type="glob" from="run-sys-prop.*" to="*"/>
229 <target name="-init-presetdef-jar">
230 <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
231 <jar jarfile="${dist.jar}" compress="${jar.compress}">
232 <j2seproject1:fileset dir="${build.classes.dir}"/>
236 <target name="init" 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"/>
242 <target name="deps-jar" depends="init" unless="no.deps"/>
243 <target name="-pre-pre-compile" depends="init,deps-jar">
244 <mkdir dir="${build.classes.dir}"/>
246 <target name="-pre-compile">
247 <!-- Empty placeholder for easier customization. -->
248 <!-- You can override this target in the ../build.xml file. -->
250 <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
251 <j2seproject3:javac/>
252 <copy todir="${build.classes.dir}">
253 <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
256 <target name="-post-compile">
257 <!-- Empty placeholder for easier customization. -->
258 <!-- You can override this target in the ../build.xml file. -->
260 <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
261 <target name="-pre-compile-single">
262 <!-- Empty placeholder for easier customization. -->
263 <!-- You can override this target in the ../build.xml file. -->
265 <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
266 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
269 <patternset includes="${javac.includes}"/>
271 </j2seproject3:javac>
273 <target name="-post-compile-single">
274 <!-- Empty placeholder for easier customization. -->
275 <!-- You can override this target in the ../build.xml file. -->
277 <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
283 <target name="-pre-pre-jar" depends="init">
284 <dirname property="dist.jar.dir" file="${dist.jar}"/>
285 <mkdir dir="${dist.jar.dir}"/>
287 <target name="-pre-jar">
288 <!-- Empty placeholder for easier customization. -->
289 <!-- You can override this target in the ../build.xml file. -->
291 <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
294 <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
295 <j2seproject1:jar manifest="${manifest.file}"/>
297 <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
298 <j2seproject1:jar manifest="${manifest.file}">
299 <j2seproject1:manifest>
300 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
301 </j2seproject1:manifest>
303 <echo>To run this application from the command line without Ant, try:</echo>
304 <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
305 <property name="dist.jar.resolved" location="${dist.jar}"/>
306 <pathconvert property="run.classpath.with.dist.jar">
307 <path path="${run.classpath}"/>
308 <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
310 <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
312 <target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
313 <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
314 <pathconvert property="run.classpath.without.build.classes.dir">
315 <path path="${run.classpath}"/>
316 <map from="${build.classes.dir.resolved}" to=""/>
318 <pathconvert property="jar.classpath" pathsep=" ">
319 <path path="${run.classpath.without.build.classes.dir}"/>
322 <globmapper from="*" to="lib/*"/>
325 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
326 <copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
327 <fileset dir="${build.classes.dir}"/>
329 <attribute name="Main-Class" value="${main.class}"/>
330 <attribute name="Class-Path" value="${jar.classpath}"/>
333 <echo>To run this application from the command line without Ant, try:</echo>
334 <property name="dist.jar.resolved" location="${dist.jar}"/>
335 <echo>java -jar "${dist.jar.resolved}"</echo>
337 <target name="-post-jar">
338 <!-- Empty placeholder for easier customization. -->
339 <!-- You can override this target in the ../build.xml file. -->
341 <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
347 <target name="run" depends="init,compile" description="Run a main class.">
350 <arg line="${application.args}"/>
354 <target name="run-single" depends="init,compile-single">
355 <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
356 <j2seproject1:java classname="${run.class}"/>
363 <target name="-debug-start-debugger" if="netbeans.home" depends="init">
364 <j2seproject1:nbjpdastart name="${debug.class}"/>
366 <target name="-debug-start-debuggee" depends="init,compile">
369 <arg line="${application.args}"/>
371 </j2seproject3:debug>
373 <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
374 <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
375 <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
377 <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
378 <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
379 <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
380 <j2seproject3:debug classname="${debug.class}"/>
382 <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
383 <target name="-pre-debug-fix" depends="init">
384 <fail unless="fix.includes">Must set fix.includes</fail>
385 <property name="javac.includes" value="${fix.includes}.java"/>
387 <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
388 <j2seproject1:nbjpdareload/>
390 <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
396 <target name="-javadoc-build" depends="init">
397 <mkdir dir="${dist.javadoc.dir}"/>
398 <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
400 <path path="${javac.classpath}"/>
403 <pathelement location="${src.dir}"/>
405 <packageset dir="${src.dir}" includes="*/**"/>
406 <fileset dir="${src.dir}" includes="*.java"/>
409 <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
410 <nbbrowse file="${dist.javadoc.dir}/index.html"/>
412 <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
414 =========================
415 JUNIT COMPILATION SECTION
416 =========================
418 <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
419 <mkdir dir="${build.test.classes.dir}"/>
421 <target name="-pre-compile-test">
422 <!-- Empty placeholder for easier customization. -->
423 <!-- You can override this target in the ../build.xml file. -->
425 <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
426 <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
427 <copy todir="${build.test.classes.dir}">
428 <fileset dir="${test.src.dir}" excludes="**/*.java"/>
431 <target name="-post-compile-test">
432 <!-- Empty placeholder for easier customization. -->
433 <!-- You can override this target in the ../build.xml file. -->
435 <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
436 <target name="-pre-compile-test-single">
437 <!-- Empty placeholder for easier customization. -->
438 <!-- You can override this target in the ../build.xml file. -->
440 <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
441 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
442 <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
444 <patternset includes="${javac.includes}"/>
446 </j2seproject3:javac>
447 <copy todir="${build.test.classes.dir}">
448 <fileset dir="${test.src.dir}" excludes="**/*.java"/>
451 <target name="-post-compile-test-single">
452 <!-- Empty placeholder for easier customization. -->
453 <!-- You can override this target in the ../build.xml file. -->
455 <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
457 =======================
458 JUNIT EXECUTION SECTION
459 =======================
461 <target name="-pre-test-run" if="have.tests" depends="init">
462 <mkdir dir="${build.test.results.dir}"/>
464 <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
465 <j2seproject3:junit/>
467 <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
468 <fail if="tests.failed">Some tests failed; see details above.</fail>
470 <target name="test-report" if="have.tests" depends="init"/>
471 <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
472 <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
473 <target name="-pre-test-run-single" if="have.tests" depends="init">
474 <mkdir dir="${build.test.results.dir}"/>
476 <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
477 <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
478 <j2seproject3:junit includes="${test.includes}"/>
480 <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
481 <fail if="tests.failed">Some tests failed; see details above.</fail>
483 <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
485 =======================
486 JUNIT DEBUGGING SECTION
487 =======================
489 <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
490 <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
491 <j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
493 <arg line="${test.class}"/>
495 </j2seproject3:debug>
497 <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
498 <j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
500 <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
501 <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
502 <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
504 <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
506 =========================
507 APPLET EXECUTION SECTION
508 =========================
510 <target name="run-applet" depends="init,compile-single">
511 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
512 <j2seproject1:java classname="sun.applet.AppletViewer">
514 <arg value="${applet.url}"/>
519 =========================
520 APPLET DEBUGGING SECTION
521 =========================
523 <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
524 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
525 <j2seproject3:debug classname="sun.applet.AppletViewer">
527 <arg value="${applet.url}"/>
529 </j2seproject3:debug>
531 <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
537 <target name="deps-clean" depends="init" unless="no.deps"/>
538 <target name="-do-clean" depends="init">
539 <delete dir="${build.dir}"/>
540 <delete dir="${dist.dir}"/>
542 <target name="-post-clean">
543 <!-- Empty placeholder for easier customization. -->
544 <!-- You can override this target in the ../build.xml file. -->
546 <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>