Andrei was confused by CountDownV1: replacing by call to method createSimpleImplementation which should be more intent describing
authorJaroslav Tulach <jtulach@netbeans.org>
Wed, 08 Aug 2012 23:25:59 +0200
changeset 398b87fd959548b
parent 397 507c2dd1e61d
child 399 06362e8bbcd9
Andrei was confused by CountDownV1: replacing by call to method createSimpleImplementation which should be more intent describing
samples/codeinjection/nbproject/build-impl.xml
samples/codeinjection/nbproject/genfiles.properties
samples/codeinjection/nbproject/project.properties
samples/codeinjection/src/org/apidesign/codeinjection/CountDown.java
     1.1 --- a/samples/codeinjection/nbproject/build-impl.xml	Wed Aug 08 23:15:30 2012 +0200
     1.2 +++ b/samples/codeinjection/nbproject/build-impl.xml	Wed Aug 08 23:25:59 2012 +0200
     1.3 @@ -12,14 +12,21 @@
     1.4    - execution
     1.5    - debugging
     1.6    - javadoc
     1.7 -  - junit compilation
     1.8 -  - junit execution
     1.9 -  - junit debugging
    1.10 +  - test compilation
    1.11 +  - test execution
    1.12 +  - test debugging
    1.13    - applet
    1.14    - cleanup
    1.15  
    1.16          -->
    1.17  <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="codeinjection-impl">
    1.18 +    <fail message="Please build using Ant 1.8.0 or higher.">
    1.19 +        <condition>
    1.20 +            <not>
    1.21 +                <antversion atleast="1.8.0"/>
    1.22 +            </not>
    1.23 +        </condition>
    1.24 +    </fail>
    1.25      <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    1.26      <!-- 
    1.27                  ======================
    1.28 @@ -48,21 +55,84 @@
    1.29      </target>
    1.30      <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    1.31          <available file="${manifest.file}" property="manifest.available"/>
    1.32 -        <condition property="manifest.available+main.class">
    1.33 +        <condition property="splashscreen.available">
    1.34              <and>
    1.35 -                <isset property="manifest.available"/>
    1.36 +                <not>
    1.37 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
    1.38 +                </not>
    1.39 +                <available file="${application.splash}"/>
    1.40 +            </and>
    1.41 +        </condition>
    1.42 +        <condition property="main.class.available">
    1.43 +            <and>
    1.44                  <isset property="main.class"/>
    1.45                  <not>
    1.46                      <equals arg1="${main.class}" arg2="" trim="true"/>
    1.47                  </not>
    1.48              </and>
    1.49          </condition>
    1.50 +        <condition property="manifest.available+main.class">
    1.51 +            <and>
    1.52 +                <isset property="manifest.available"/>
    1.53 +                <isset property="main.class.available"/>
    1.54 +            </and>
    1.55 +        </condition>
    1.56 +        <condition property="do.archive">
    1.57 +            <not>
    1.58 +                <istrue value="${jar.archive.disabled}"/>
    1.59 +            </not>
    1.60 +        </condition>
    1.61 +        <condition property="do.mkdist">
    1.62 +            <and>
    1.63 +                <isset property="do.archive"/>
    1.64 +                <isset property="libs.CopyLibs.classpath"/>
    1.65 +                <not>
    1.66 +                    <istrue value="${mkdist.disabled}"/>
    1.67 +                </not>
    1.68 +            </and>
    1.69 +        </condition>
    1.70          <condition property="manifest.available+main.class+mkdist.available">
    1.71              <and>
    1.72                  <istrue value="${manifest.available+main.class}"/>
    1.73 -                <isset property="libs.CopyLibs.classpath"/>
    1.74 +                <isset property="do.mkdist"/>
    1.75              </and>
    1.76          </condition>
    1.77 +        <condition property="do.archive+manifest.available">
    1.78 +            <and>
    1.79 +                <isset property="manifest.available"/>
    1.80 +                <istrue value="${do.archive}"/>
    1.81 +            </and>
    1.82 +        </condition>
    1.83 +        <condition property="do.archive+main.class.available">
    1.84 +            <and>
    1.85 +                <isset property="main.class.available"/>
    1.86 +                <istrue value="${do.archive}"/>
    1.87 +            </and>
    1.88 +        </condition>
    1.89 +        <condition property="do.archive+splashscreen.available">
    1.90 +            <and>
    1.91 +                <isset property="splashscreen.available"/>
    1.92 +                <istrue value="${do.archive}"/>
    1.93 +            </and>
    1.94 +        </condition>
    1.95 +        <condition property="do.archive+manifest.available+main.class">
    1.96 +            <and>
    1.97 +                <istrue value="${manifest.available+main.class}"/>
    1.98 +                <istrue value="${do.archive}"/>
    1.99 +            </and>
   1.100 +        </condition>
   1.101 +        <condition property="manifest.available-mkdist.available">
   1.102 +            <or>
   1.103 +                <istrue value="${manifest.available}"/>
   1.104 +                <isset property="do.mkdist"/>
   1.105 +            </or>
   1.106 +        </condition>
   1.107 +        <condition property="manifest.available+main.class-mkdist.available">
   1.108 +            <or>
   1.109 +                <istrue value="${manifest.available+main.class}"/>
   1.110 +                <isset property="do.mkdist"/>
   1.111 +            </or>
   1.112 +        </condition>
   1.113          <condition property="have.tests">
   1.114              <or>
   1.115                  <available file="${test.src.dir}"/>
   1.116 @@ -86,6 +156,7 @@
   1.117              </and>
   1.118          </condition>
   1.119          <property name="run.jvmargs" value=""/>
   1.120 +        <property name="run.jvmargs.ide" value=""/>
   1.121          <property name="javac.compilerargs" value=""/>
   1.122          <property name="work.dir" value="${basedir}"/>
   1.123          <condition property="no.deps">
   1.124 @@ -97,6 +168,7 @@
   1.125          <property name="javadoc.preview" value="true"/>
   1.126          <property name="application.args" value=""/>
   1.127          <property name="source.encoding" value="${file.encoding}"/>
   1.128 +        <property name="runtime.encoding" value="${source.encoding}"/>
   1.129          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   1.130              <and>
   1.131                  <isset property="javadoc.encoding"/>
   1.132 @@ -112,12 +184,44 @@
   1.133          <condition property="do.depend.true">
   1.134              <istrue value="${do.depend}"/>
   1.135          </condition>
   1.136 -        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
   1.137 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   1.138 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   1.139 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
   1.140 +        </condition>
   1.141 +        <condition else="false" property="jdkBug6558476">
   1.142              <and>
   1.143 -                <isset property="jaxws.endorsed.dir"/>
   1.144 -                <available file="nbproject/jaxws-build.xml"/>
   1.145 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   1.146 +                <not>
   1.147 +                    <os family="unix"/>
   1.148 +                </not>
   1.149              </and>
   1.150          </condition>
   1.151 +        <property name="javac.fork" value="${jdkBug6558476}"/>
   1.152 +        <property name="jar.index" value="false"/>
   1.153 +        <property name="jar.index.metainf" value="${jar.index}"/>
   1.154 +        <property name="copylibs.rebase" value="true"/>
   1.155 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   1.156 +        <condition property="junit.available">
   1.157 +            <or>
   1.158 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   1.159 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   1.160 +            </or>
   1.161 +        </condition>
   1.162 +        <condition property="testng.available">
   1.163 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   1.164 +        </condition>
   1.165 +        <condition property="junit+testng.available">
   1.166 +            <and>
   1.167 +                <istrue value="${junit.available}"/>
   1.168 +                <istrue value="${testng.available}"/>
   1.169 +            </and>
   1.170 +        </condition>
   1.171 +        <condition else="testng" property="testng.mode" value="mixed">
   1.172 +            <istrue value="${junit+testng.available}"/>
   1.173 +        </condition>
   1.174 +        <condition else="" property="testng.debug.mode" value="-mixed">
   1.175 +            <istrue value="${junit+testng.available}"/>
   1.176 +        </condition>
   1.177      </target>
   1.178      <target name="-post-init">
   1.179          <!-- Empty placeholder for easier customization. -->
   1.180 @@ -144,26 +248,79 @@
   1.181              </sequential>
   1.182          </macrodef>
   1.183      </target>
   1.184 -    <target name="-init-macrodef-javac">
   1.185 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   1.186          <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.187              <attribute default="${src.dir}" name="srcdir"/>
   1.188              <attribute default="${build.classes.dir}" name="destdir"/>
   1.189              <attribute default="${javac.classpath}" name="classpath"/>
   1.190 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.191 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.192              <attribute default="${includes}" name="includes"/>
   1.193              <attribute default="${excludes}" name="excludes"/>
   1.194              <attribute default="${javac.debug}" name="debug"/>
   1.195 -            <attribute default="/does/not/exist" name="sourcepath"/>
   1.196 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.197 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.198              <element name="customize" optional="true"/>
   1.199              <sequential>
   1.200 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
   1.201 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.202 +                <mkdir dir="${empty.dir}"/>
   1.203 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   1.204 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   1.205 +                    <src>
   1.206 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.207 +                            <include name="*"/>
   1.208 +                        </dirset>
   1.209 +                    </src>
   1.210                      <classpath>
   1.211                          <path path="@{classpath}"/>
   1.212                      </classpath>
   1.213 -                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
   1.214 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.215 +                    <compilerarg line="${javac.compilerargs}"/>
   1.216 +                    <compilerarg value="-processorpath"/>
   1.217 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   1.218 +                    <compilerarg line="${ap.processors.internal}"/>
   1.219 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   1.220 +                    <compilerarg value="-s"/>
   1.221 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   1.222 +                    <compilerarg line="${ap.proc.none.internal}"/>
   1.223                      <customize/>
   1.224                  </javac>
   1.225              </sequential>
   1.226          </macrodef>
   1.227 +    </target>
   1.228 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   1.229 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.230 +            <attribute default="${src.dir}" name="srcdir"/>
   1.231 +            <attribute default="${build.classes.dir}" name="destdir"/>
   1.232 +            <attribute default="${javac.classpath}" name="classpath"/>
   1.233 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   1.234 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   1.235 +            <attribute default="${includes}" name="includes"/>
   1.236 +            <attribute default="${excludes}" name="excludes"/>
   1.237 +            <attribute default="${javac.debug}" name="debug"/>
   1.238 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.239 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.240 +            <element name="customize" optional="true"/>
   1.241 +            <sequential>
   1.242 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.243 +                <mkdir dir="${empty.dir}"/>
   1.244 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   1.245 +                    <src>
   1.246 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.247 +                            <include name="*"/>
   1.248 +                        </dirset>
   1.249 +                    </src>
   1.250 +                    <classpath>
   1.251 +                        <path path="@{classpath}"/>
   1.252 +                    </classpath>
   1.253 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.254 +                    <compilerarg line="${javac.compilerargs}"/>
   1.255 +                    <customize/>
   1.256 +                </javac>
   1.257 +            </sequential>
   1.258 +        </macrodef>
   1.259 +    </target>
   1.260 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   1.261          <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.262              <attribute default="${src.dir}" name="srcdir"/>
   1.263              <attribute default="${build.classes.dir}" name="destdir"/>
   1.264 @@ -180,44 +337,379 @@
   1.265              <attribute default="${build.classes.dir}" name="destdir"/>
   1.266              <sequential>
   1.267                  <fail unless="javac.includes">Must set javac.includes</fail>
   1.268 -                <pathconvert pathsep="," property="javac.includes.binary">
   1.269 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   1.270                      <path>
   1.271                          <filelist dir="@{destdir}" files="${javac.includes}"/>
   1.272                      </path>
   1.273                      <globmapper from="*.java" to="*.class"/>
   1.274                  </pathconvert>
   1.275 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   1.276 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   1.277                  <delete>
   1.278 -                    <files includes="${javac.includes.binary}"/>
   1.279 +                    <files includesfile="${javac.includesfile.binary}"/>
   1.280 +                </delete>
   1.281 +                <delete>
   1.282 +                    <fileset file="${javac.includesfile.binary}"/>
   1.283                  </delete>
   1.284              </sequential>
   1.285          </macrodef>
   1.286      </target>
   1.287 -    <target name="-init-macrodef-junit">
   1.288 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
   1.289 +        <condition else="false" property="nb.junit.batch" value="true">
   1.290 +            <and>
   1.291 +                <istrue value="${junit.available}"/>
   1.292 +                <not>
   1.293 +                    <isset property="test.method"/>
   1.294 +                </not>
   1.295 +            </and>
   1.296 +        </condition>
   1.297 +        <condition else="false" property="nb.junit.single" value="true">
   1.298 +            <and>
   1.299 +                <istrue value="${junit.available}"/>
   1.300 +                <isset property="test.method"/>
   1.301 +            </and>
   1.302 +        </condition>
   1.303 +    </target>
   1.304 +    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   1.305          <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.306              <attribute default="${includes}" name="includes"/>
   1.307              <attribute default="${excludes}" name="excludes"/>
   1.308              <attribute default="**" name="testincludes"/>
   1.309 +            <attribute default="" name="testmethods"/>
   1.310 +            <element name="customize" optional="true"/>
   1.311              <sequential>
   1.312 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   1.313 -                    <batchtest todir="${build.test.results.dir}">
   1.314 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.315 -                            <filename name="@{testincludes}"/>
   1.316 -                        </fileset>
   1.317 -                    </batchtest>
   1.318 -                    <classpath>
   1.319 -                        <path path="${run.test.classpath}"/>
   1.320 -                    </classpath>
   1.321 +                <property name="junit.forkmode" value="perTest"/>
   1.322 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.323 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.324                      <syspropertyset>
   1.325                          <propertyref prefix="test-sys-prop."/>
   1.326                          <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.327                      </syspropertyset>
   1.328                      <formatter type="brief" usefile="false"/>
   1.329                      <formatter type="xml"/>
   1.330 -                    <jvmarg line="${run.jvmargs}"/>
   1.331 +                    <jvmarg value="-ea"/>
   1.332 +                    <customize/>
   1.333                  </junit>
   1.334              </sequential>
   1.335          </macrodef>
   1.336      </target>
   1.337 +    <target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   1.338 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.339 +            <attribute default="${includes}" name="includes"/>
   1.340 +            <attribute default="${excludes}" name="excludes"/>
   1.341 +            <attribute default="**" name="testincludes"/>
   1.342 +            <attribute default="" name="testmethods"/>
   1.343 +            <element name="customize" optional="true"/>
   1.344 +            <sequential>
   1.345 +                <property name="junit.forkmode" value="perTest"/>
   1.346 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.347 +                    <batchtest todir="${build.test.results.dir}">
   1.348 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.349 +                            <filename name="@{testincludes}"/>
   1.350 +                        </fileset>
   1.351 +                    </batchtest>
   1.352 +                    <syspropertyset>
   1.353 +                        <propertyref prefix="test-sys-prop."/>
   1.354 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.355 +                    </syspropertyset>
   1.356 +                    <formatter type="brief" usefile="false"/>
   1.357 +                    <formatter type="xml"/>
   1.358 +                    <jvmarg value="-ea"/>
   1.359 +                    <customize/>
   1.360 +                </junit>
   1.361 +            </sequential>
   1.362 +        </macrodef>
   1.363 +    </target>
   1.364 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   1.365 +    <target if="${testng.available}" name="-init-macrodef-testng">
   1.366 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.367 +            <attribute default="${includes}" name="includes"/>
   1.368 +            <attribute default="${excludes}" name="excludes"/>
   1.369 +            <attribute default="**" name="testincludes"/>
   1.370 +            <attribute default="" name="testmethods"/>
   1.371 +            <element name="customize" optional="true"/>
   1.372 +            <sequential>
   1.373 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   1.374 +                    <isset property="test.method"/>
   1.375 +                </condition>
   1.376 +                <union id="test.set">
   1.377 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   1.378 +                        <filename name="@{testincludes}"/>
   1.379 +                    </fileset>
   1.380 +                </union>
   1.381 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   1.382 +                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="codeinjection" testname="TestNG tests" workingDir="${work.dir}">
   1.383 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   1.384 +                    <propertyset>
   1.385 +                        <propertyref prefix="test-sys-prop."/>
   1.386 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.387 +                    </propertyset>
   1.388 +                    <customize/>
   1.389 +                </testng>
   1.390 +            </sequential>
   1.391 +        </macrodef>
   1.392 +    </target>
   1.393 +    <target name="-init-macrodef-test-impl">
   1.394 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.395 +            <attribute default="${includes}" name="includes"/>
   1.396 +            <attribute default="${excludes}" name="excludes"/>
   1.397 +            <attribute default="**" name="testincludes"/>
   1.398 +            <attribute default="" name="testmethods"/>
   1.399 +            <element implicit="true" name="customize" optional="true"/>
   1.400 +            <sequential>
   1.401 +                <echo>No tests executed.</echo>
   1.402 +            </sequential>
   1.403 +        </macrodef>
   1.404 +    </target>
   1.405 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   1.406 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.407 +            <attribute default="${includes}" name="includes"/>
   1.408 +            <attribute default="${excludes}" name="excludes"/>
   1.409 +            <attribute default="**" name="testincludes"/>
   1.410 +            <attribute default="" name="testmethods"/>
   1.411 +            <element implicit="true" name="customize" optional="true"/>
   1.412 +            <sequential>
   1.413 +                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.414 +                    <customize/>
   1.415 +                </j2seproject3:junit>
   1.416 +            </sequential>
   1.417 +        </macrodef>
   1.418 +    </target>
   1.419 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   1.420 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.421 +            <attribute default="${includes}" name="includes"/>
   1.422 +            <attribute default="${excludes}" name="excludes"/>
   1.423 +            <attribute default="**" name="testincludes"/>
   1.424 +            <attribute default="" name="testmethods"/>
   1.425 +            <element implicit="true" name="customize" optional="true"/>
   1.426 +            <sequential>
   1.427 +                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.428 +                    <customize/>
   1.429 +                </j2seproject3:testng>
   1.430 +            </sequential>
   1.431 +        </macrodef>
   1.432 +    </target>
   1.433 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   1.434 +        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.435 +            <attribute default="${includes}" name="includes"/>
   1.436 +            <attribute default="${excludes}" name="excludes"/>
   1.437 +            <attribute default="**" name="testincludes"/>
   1.438 +            <attribute default="" name="testmethods"/>
   1.439 +            <sequential>
   1.440 +                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.441 +                    <customize>
   1.442 +                        <classpath>
   1.443 +                            <path path="${run.test.classpath}"/>
   1.444 +                        </classpath>
   1.445 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.446 +                        <jvmarg line="${run.jvmargs}"/>
   1.447 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.448 +                    </customize>
   1.449 +                </j2seproject3:test-impl>
   1.450 +            </sequential>
   1.451 +        </macrodef>
   1.452 +    </target>
   1.453 +    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
   1.454 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.455 +            <attribute default="${includes}" name="includes"/>
   1.456 +            <attribute default="${excludes}" name="excludes"/>
   1.457 +            <attribute default="**" name="testincludes"/>
   1.458 +            <attribute default="" name="testmethods"/>
   1.459 +            <element name="customize" optional="true"/>
   1.460 +            <sequential>
   1.461 +                <property name="junit.forkmode" value="perTest"/>
   1.462 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.463 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   1.464 +                    <syspropertyset>
   1.465 +                        <propertyref prefix="test-sys-prop."/>
   1.466 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.467 +                    </syspropertyset>
   1.468 +                    <formatter type="brief" usefile="false"/>
   1.469 +                    <formatter type="xml"/>
   1.470 +                    <jvmarg value="-ea"/>
   1.471 +                    <jvmarg line="${debug-args-line}"/>
   1.472 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.473 +                    <customize/>
   1.474 +                </junit>
   1.475 +            </sequential>
   1.476 +        </macrodef>
   1.477 +    </target>
   1.478 +    <target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
   1.479 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.480 +            <attribute default="${includes}" name="includes"/>
   1.481 +            <attribute default="${excludes}" name="excludes"/>
   1.482 +            <attribute default="**" name="testincludes"/>
   1.483 +            <attribute default="" name="testmethods"/>
   1.484 +            <element name="customize" optional="true"/>
   1.485 +            <sequential>
   1.486 +                <property name="junit.forkmode" value="perTest"/>
   1.487 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   1.488 +                    <batchtest todir="${build.test.results.dir}">
   1.489 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.490 +                            <filename name="@{testincludes}"/>
   1.491 +                        </fileset>
   1.492 +                    </batchtest>
   1.493 +                    <syspropertyset>
   1.494 +                        <propertyref prefix="test-sys-prop."/>
   1.495 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.496 +                    </syspropertyset>
   1.497 +                    <formatter type="brief" usefile="false"/>
   1.498 +                    <formatter type="xml"/>
   1.499 +                    <jvmarg value="-ea"/>
   1.500 +                    <jvmarg line="${debug-args-line}"/>
   1.501 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.502 +                    <customize/>
   1.503 +                </junit>
   1.504 +            </sequential>
   1.505 +        </macrodef>
   1.506 +    </target>
   1.507 +    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   1.508 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.509 +            <attribute default="${includes}" name="includes"/>
   1.510 +            <attribute default="${excludes}" name="excludes"/>
   1.511 +            <attribute default="**" name="testincludes"/>
   1.512 +            <attribute default="" name="testmethods"/>
   1.513 +            <element implicit="true" name="customize" optional="true"/>
   1.514 +            <sequential>
   1.515 +                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.516 +                    <customize/>
   1.517 +                </j2seproject3:junit-debug>
   1.518 +            </sequential>
   1.519 +        </macrodef>
   1.520 +    </target>
   1.521 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   1.522 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.523 +            <attribute default="${main.class}" name="testClass"/>
   1.524 +            <attribute default="" name="testMethod"/>
   1.525 +            <element name="customize2" optional="true"/>
   1.526 +            <sequential>
   1.527 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   1.528 +                    <isset property="test.method"/>
   1.529 +                </condition>
   1.530 +                <condition else="-suitename codeinjection -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   1.531 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
   1.532 +                </condition>
   1.533 +                <delete dir="${build.test.results.dir}" quiet="true"/>
   1.534 +                <mkdir dir="${build.test.results.dir}"/>
   1.535 +                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   1.536 +                    <customize>
   1.537 +                        <customize2/>
   1.538 +                        <jvmarg value="-ea"/>
   1.539 +                        <arg line="${testng.debug.mode}"/>
   1.540 +                        <arg line="-d ${build.test.results.dir}"/>
   1.541 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   1.542 +                        <arg line="${testng.cmd.args}"/>
   1.543 +                    </customize>
   1.544 +                </j2seproject3:debug>
   1.545 +            </sequential>
   1.546 +        </macrodef>
   1.547 +    </target>
   1.548 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   1.549 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.550 +            <attribute default="${main.class}" name="testClass"/>
   1.551 +            <attribute default="" name="testMethod"/>
   1.552 +            <element implicit="true" name="customize2" optional="true"/>
   1.553 +            <sequential>
   1.554 +                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   1.555 +                    <customize2/>
   1.556 +                </j2seproject3:testng-debug>
   1.557 +            </sequential>
   1.558 +        </macrodef>
   1.559 +    </target>
   1.560 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   1.561 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.562 +            <attribute default="${includes}" name="includes"/>
   1.563 +            <attribute default="${excludes}" name="excludes"/>
   1.564 +            <attribute default="**" name="testincludes"/>
   1.565 +            <attribute default="" name="testmethods"/>
   1.566 +            <attribute default="${main.class}" name="testClass"/>
   1.567 +            <attribute default="" name="testMethod"/>
   1.568 +            <sequential>
   1.569 +                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   1.570 +                    <customize>
   1.571 +                        <classpath>
   1.572 +                            <path path="${run.test.classpath}"/>
   1.573 +                        </classpath>
   1.574 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.575 +                        <jvmarg line="${run.jvmargs}"/>
   1.576 +                        <jvmarg line="${run.jvmargs.ide}"/>
   1.577 +                    </customize>
   1.578 +                </j2seproject3:test-debug-impl>
   1.579 +            </sequential>
   1.580 +        </macrodef>
   1.581 +    </target>
   1.582 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   1.583 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.584 +            <attribute default="${includes}" name="includes"/>
   1.585 +            <attribute default="${excludes}" name="excludes"/>
   1.586 +            <attribute default="**" name="testincludes"/>
   1.587 +            <attribute default="" name="testmethods"/>
   1.588 +            <attribute default="${main.class}" name="testClass"/>
   1.589 +            <attribute default="" name="testMethod"/>
   1.590 +            <sequential>
   1.591 +                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   1.592 +                    <customize2>
   1.593 +                        <syspropertyset>
   1.594 +                            <propertyref prefix="test-sys-prop."/>
   1.595 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.596 +                        </syspropertyset>
   1.597 +                    </customize2>
   1.598 +                </j2seproject3:testng-debug-impl>
   1.599 +            </sequential>
   1.600 +        </macrodef>
   1.601 +    </target>
   1.602 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   1.603 +    <!--
   1.604 +                pre NB7.2 profiling section; consider it deprecated
   1.605 +            -->
   1.606 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
   1.607 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   1.608 +        <!-- Empty placeholder for easier customization. -->
   1.609 +        <!-- You can override this target in the ../build.xml file. -->
   1.610 +    </target>
   1.611 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   1.612 +        <!-- Empty placeholder for easier customization. -->
   1.613 +        <!-- You can override this target in the ../build.xml file. -->
   1.614 +    </target>
   1.615 +    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
   1.616 +        <macrodef name="resolve">
   1.617 +            <attribute name="name"/>
   1.618 +            <attribute name="value"/>
   1.619 +            <sequential>
   1.620 +                <property name="@{name}" value="${env.@{value}}"/>
   1.621 +            </sequential>
   1.622 +        </macrodef>
   1.623 +        <macrodef name="profile">
   1.624 +            <attribute default="${main.class}" name="classname"/>
   1.625 +            <element name="customize" optional="true"/>
   1.626 +            <sequential>
   1.627 +                <property environment="env"/>
   1.628 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   1.629 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   1.630 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.631 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.632 +                    <jvmarg line="${profiler.info.jvmargs}"/>
   1.633 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.634 +                    <arg line="${application.args}"/>
   1.635 +                    <classpath>
   1.636 +                        <path path="${run.classpath}"/>
   1.637 +                    </classpath>
   1.638 +                    <syspropertyset>
   1.639 +                        <propertyref prefix="run-sys-prop."/>
   1.640 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   1.641 +                    </syspropertyset>
   1.642 +                    <customize/>
   1.643 +                </java>
   1.644 +            </sequential>
   1.645 +        </macrodef>
   1.646 +    </target>
   1.647 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   1.648 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   1.649 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   1.650 +    </target>
   1.651 +    <!--
   1.652 +                end of pre NB7.2 profiling section
   1.653 +            -->
   1.654      <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   1.655          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.656              <attribute default="${main.class}" name="name"/>
   1.657 @@ -269,9 +761,13 @@
   1.658              <element name="customize" optional="true"/>
   1.659              <sequential>
   1.660                  <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.661 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.662                      <jvmarg line="${debug-args-line}"/>
   1.663                      <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.664 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.665 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.666                      <jvmarg line="${run.jvmargs}"/>
   1.667 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.668                      <classpath>
   1.669                          <path path="@{classpath}"/>
   1.670                      </classpath>
   1.671 @@ -288,10 +784,15 @@
   1.672          <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.673              <attribute default="${main.class}" name="classname"/>
   1.674              <attribute default="${run.classpath}" name="classpath"/>
   1.675 +            <attribute default="jvm" name="jvm"/>
   1.676              <element name="customize" optional="true"/>
   1.677              <sequential>
   1.678                  <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.679 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.680 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.681 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.682                      <jvmarg line="${run.jvmargs}"/>
   1.683 +                    <jvmarg line="${run.jvmargs.ide}"/>
   1.684                      <classpath>
   1.685                          <path path="@{classpath}"/>
   1.686                      </classpath>
   1.687 @@ -304,20 +805,90 @@
   1.688              </sequential>
   1.689          </macrodef>
   1.690      </target>
   1.691 +    <target name="-init-macrodef-copylibs">
   1.692 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   1.693 +            <attribute default="${manifest.file}" name="manifest"/>
   1.694 +            <element name="customize" optional="true"/>
   1.695 +            <sequential>
   1.696 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.697 +                <pathconvert property="run.classpath.without.build.classes.dir">
   1.698 +                    <path path="${run.classpath}"/>
   1.699 +                    <map from="${build.classes.dir.resolved}" to=""/>
   1.700 +                </pathconvert>
   1.701 +                <pathconvert pathsep=" " property="jar.classpath">
   1.702 +                    <path path="${run.classpath.without.build.classes.dir}"/>
   1.703 +                    <chainedmapper>
   1.704 +                        <flattenmapper/>
   1.705 +                        <filtermapper>
   1.706 +                            <replacestring from=" " to="%20"/>
   1.707 +                        </filtermapper>
   1.708 +                        <globmapper from="*" to="lib/*"/>
   1.709 +                    </chainedmapper>
   1.710 +                </pathconvert>
   1.711 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.712 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.713 +                    <fileset dir="${build.classes.dir}"/>
   1.714 +                    <manifest>
   1.715 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
   1.716 +                        <customize/>
   1.717 +                    </manifest>
   1.718 +                </copylibs>
   1.719 +            </sequential>
   1.720 +        </macrodef>
   1.721 +    </target>
   1.722      <target name="-init-presetdef-jar">
   1.723          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.724 -            <jar compress="${jar.compress}" jarfile="${dist.jar}">
   1.725 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   1.726                  <j2seproject1:fileset dir="${build.classes.dir}"/>
   1.727              </jar>
   1.728          </presetdef>
   1.729      </target>
   1.730 -    <target 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" name="init"/>
   1.731 +    <target name="-init-ap-cmdline-properties">
   1.732 +        <property name="annotation.processing.enabled" value="true"/>
   1.733 +        <property name="annotation.processing.processors.list" value=""/>
   1.734 +        <property name="annotation.processing.processor.options" value=""/>
   1.735 +        <property name="annotation.processing.run.all.processors" value="true"/>
   1.736 +        <property name="javac.processorpath" value="${javac.classpath}"/>
   1.737 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
   1.738 +        <condition property="ap.supported.internal" value="true">
   1.739 +            <not>
   1.740 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
   1.741 +            </not>
   1.742 +        </condition>
   1.743 +    </target>
   1.744 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
   1.745 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
   1.746 +            <isfalse value="${annotation.processing.run.all.processors}"/>
   1.747 +        </condition>
   1.748 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
   1.749 +            <isfalse value="${annotation.processing.enabled}"/>
   1.750 +        </condition>
   1.751 +    </target>
   1.752 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   1.753 +        <property name="ap.cmd.line.internal" value=""/>
   1.754 +    </target>
   1.755 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
   1.756      <!--
   1.757                  ===================
   1.758                  COMPILATION SECTION
   1.759                  ===================
   1.760              -->
   1.761 -    <target depends="init" name="deps-jar" unless="no.deps"/>
   1.762 +    <target name="-deps-jar-init" unless="built-jar.properties">
   1.763 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
   1.764 +        <delete file="${built-jar.properties}" quiet="true"/>
   1.765 +    </target>
   1.766 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
   1.767 +        <echo level="warn" message="Cycle detected: codeinjection was already built"/>
   1.768 +    </target>
   1.769 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
   1.770 +        <mkdir dir="${build.dir}"/>
   1.771 +        <touch file="${built-jar.properties}" verbose="false"/>
   1.772 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
   1.773 +        <antcall target="-warn-already-built-jar"/>
   1.774 +        <propertyfile file="${built-jar.properties}">
   1.775 +            <entry key="${basedir}" value=""/>
   1.776 +        </propertyfile>
   1.777 +    </target>
   1.778      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
   1.779      <target depends="init" name="-check-automatic-build">
   1.780          <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   1.781 @@ -333,14 +904,25 @@
   1.782          <!-- You can override this target in the ../build.xml file. -->
   1.783      </target>
   1.784      <target if="do.depend.true" name="-compile-depend">
   1.785 -        <j2seproject3:depend/>
   1.786 +        <pathconvert property="build.generated.subdirs">
   1.787 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   1.788 +                <include name="*"/>
   1.789 +            </dirset>
   1.790 +        </pathconvert>
   1.791 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
   1.792      </target>
   1.793 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
   1.794 -        <j2seproject3:javac/>
   1.795 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
   1.796 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
   1.797          <copy todir="${build.classes.dir}">
   1.798              <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   1.799          </copy>
   1.800      </target>
   1.801 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
   1.802 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   1.803 +        <copy todir="${build.classes.dir}/META-INF">
   1.804 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
   1.805 +        </copy>
   1.806 +    </target>
   1.807      <target name="-post-compile">
   1.808          <!-- Empty placeholder for easier customization. -->
   1.809          <!-- You can override this target in the ../build.xml file. -->
   1.810 @@ -353,7 +935,7 @@
   1.811      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   1.812          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   1.813          <j2seproject3:force-recompile/>
   1.814 -        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
   1.815 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   1.816      </target>
   1.817      <target name="-post-compile-single">
   1.818          <!-- Empty placeholder for easier customization. -->
   1.819 @@ -373,52 +955,60 @@
   1.820          <!-- Empty placeholder for easier customization. -->
   1.821          <!-- You can override this target in the ../build.xml file. -->
   1.822      </target>
   1.823 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
   1.824 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   1.825          <j2seproject1:jar/>
   1.826      </target>
   1.827 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
   1.828 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
   1.829          <j2seproject1:jar manifest="${manifest.file}"/>
   1.830      </target>
   1.831 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
   1.832 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
   1.833          <j2seproject1:jar manifest="${manifest.file}">
   1.834              <j2seproject1:manifest>
   1.835                  <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
   1.836              </j2seproject1:manifest>
   1.837          </j2seproject1:jar>
   1.838 -        <echo>To run this application from the command line without Ant, try:</echo>
   1.839 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   1.840          <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.841          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.842          <pathconvert property="run.classpath.with.dist.jar">
   1.843              <path path="${run.classpath}"/>
   1.844              <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   1.845          </pathconvert>
   1.846 -        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   1.847 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   1.848      </target>
   1.849 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
   1.850 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.851 -        <pathconvert property="run.classpath.without.build.classes.dir">
   1.852 -            <path path="${run.classpath}"/>
   1.853 -            <map from="${build.classes.dir.resolved}" to=""/>
   1.854 -        </pathconvert>
   1.855 -        <pathconvert pathsep=" " property="jar.classpath">
   1.856 -            <path path="${run.classpath.without.build.classes.dir}"/>
   1.857 -            <chainedmapper>
   1.858 -                <flattenmapper/>
   1.859 -                <globmapper from="*" to="lib/*"/>
   1.860 -            </chainedmapper>
   1.861 -        </pathconvert>
   1.862 -        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.863 -        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.864 -            <fileset dir="${build.classes.dir}"/>
   1.865 -            <manifest>
   1.866 -                <attribute name="Main-Class" value="${main.class}"/>
   1.867 -                <attribute name="Class-Path" value="${jar.classpath}"/>
   1.868 -            </manifest>
   1.869 -        </copylibs>
   1.870 -        <echo>To run this application from the command line without Ant, try:</echo>
   1.871 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
   1.872 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.873 +        <touch file="${tmp.manifest.file}" verbose="false"/>
   1.874 +    </target>
   1.875 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
   1.876 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   1.877 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
   1.878 +    </target>
   1.879 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
   1.880 +        <manifest file="${tmp.manifest.file}" mode="update">
   1.881 +            <attribute name="Main-Class" value="${main.class}"/>
   1.882 +        </manifest>
   1.883 +    </target>
   1.884 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
   1.885 +        <basename file="${application.splash}" property="splashscreen.basename"/>
   1.886 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   1.887 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   1.888 +        <manifest file="${tmp.manifest.file}" mode="update">
   1.889 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   1.890 +        </manifest>
   1.891 +    </target>
   1.892 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
   1.893 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   1.894 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   1.895          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.896 -        <echo>java -jar "${dist.jar.resolved}"</echo>
   1.897 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   1.898      </target>
   1.899 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
   1.900 +        <delete>
   1.901 +            <fileset file="${tmp.manifest.file}"/>
   1.902 +        </delete>
   1.903 +    </target>
   1.904 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
   1.905      <target name="-post-jar">
   1.906          <!-- Empty placeholder for easier customization. -->
   1.907          <!-- You can override this target in the ../build.xml file. -->
   1.908 @@ -439,11 +1029,11 @@
   1.909      <target name="-do-not-recompile">
   1.910          <property name="javac.includes.binary" value=""/>
   1.911      </target>
   1.912 -    <target depends="init,-do-not-recompile,compile-single" name="run-single">
   1.913 +    <target depends="init,compile-single" name="run-single">
   1.914          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.915          <j2seproject1:java classname="${run.class}"/>
   1.916      </target>
   1.917 -    <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
   1.918 +    <target depends="init,compile-test-single" name="run-test-with-main">
   1.919          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.920          <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   1.921      </target>
   1.922 @@ -474,12 +1064,12 @@
   1.923          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   1.924          <j2seproject3:debug classname="${debug.class}"/>
   1.925      </target>
   1.926 -    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   1.927 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   1.928      <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
   1.929          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   1.930          <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
   1.931      </target>
   1.932 -    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
   1.933 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
   1.934      <target depends="init" name="-pre-debug-fix">
   1.935          <fail unless="fix.includes">Must set fix.includes</fail>
   1.936          <property name="javac.includes" value="${fix.includes}.java"/>
   1.937 @@ -489,20 +1079,140 @@
   1.938      </target>
   1.939      <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
   1.940      <!--
   1.941 +                =================
   1.942 +                PROFILING SECTION
   1.943 +                =================
   1.944 +            -->
   1.945 +    <!--
   1.946 +                pre NB7.2 profiler integration
   1.947 +            -->
   1.948 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
   1.949 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
   1.950 +        <nbprofiledirect>
   1.951 +            <classpath>
   1.952 +                <path path="${run.classpath}"/>
   1.953 +            </classpath>
   1.954 +        </nbprofiledirect>
   1.955 +        <profile/>
   1.956 +    </target>
   1.957 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
   1.958 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
   1.959 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
   1.960 +        <nbprofiledirect>
   1.961 +            <classpath>
   1.962 +                <path path="${run.classpath}"/>
   1.963 +            </classpath>
   1.964 +        </nbprofiledirect>
   1.965 +        <profile classname="${profile.class}"/>
   1.966 +    </target>
   1.967 +    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
   1.968 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
   1.969 +        <nbprofiledirect>
   1.970 +            <classpath>
   1.971 +                <path path="${run.classpath}"/>
   1.972 +            </classpath>
   1.973 +        </nbprofiledirect>
   1.974 +        <profile classname="sun.applet.AppletViewer">
   1.975 +            <customize>
   1.976 +                <arg value="${applet.url}"/>
   1.977 +            </customize>
   1.978 +        </profile>
   1.979 +    </target>
   1.980 +    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
   1.981 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
   1.982 +        <nbprofiledirect>
   1.983 +            <classpath>
   1.984 +                <path path="${run.test.classpath}"/>
   1.985 +            </classpath>
   1.986 +        </nbprofiledirect>
   1.987 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
   1.988 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   1.989 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
   1.990 +            <jvmarg line="${profiler.info.jvmargs}"/>
   1.991 +            <test name="${profile.class}"/>
   1.992 +            <classpath>
   1.993 +                <path path="${run.test.classpath}"/>
   1.994 +            </classpath>
   1.995 +            <syspropertyset>
   1.996 +                <propertyref prefix="test-sys-prop."/>
   1.997 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
   1.998 +            </syspropertyset>
   1.999 +            <formatter type="brief" usefile="false"/>
  1.1000 +            <formatter type="xml"/>
  1.1001 +        </junit>
  1.1002 +    </target>
  1.1003 +    <!--
  1.1004 +                end of pre NB72 profiling section
  1.1005 +            -->
  1.1006 +    <target if="netbeans.home" name="-profile-check">
  1.1007 +        <condition property="profiler.configured">
  1.1008 +            <or>
  1.1009 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  1.1010 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  1.1011 +            </or>
  1.1012 +        </condition>
  1.1013 +    </target>
  1.1014 +    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  1.1015 +        <startprofiler/>
  1.1016 +        <antcall target="run"/>
  1.1017 +    </target>
  1.1018 +    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
  1.1019 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1020 +        <startprofiler/>
  1.1021 +        <antcall target="run-single"/>
  1.1022 +    </target>
  1.1023 +    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  1.1024 +    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  1.1025 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1026 +        <startprofiler/>
  1.1027 +        <antcall target="test-single"/>
  1.1028 +    </target>
  1.1029 +    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  1.1030 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1.1031 +        <startprofiler/>
  1.1032 +        <antcal target="run-test-with-main"/>
  1.1033 +    </target>
  1.1034 +    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  1.1035 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1.1036 +        <startprofiler/>
  1.1037 +        <antcall target="run-applet"/>
  1.1038 +    </target>
  1.1039 +    <!--
  1.1040                  ===============
  1.1041                  JAVADOC SECTION
  1.1042                  ===============
  1.1043              -->
  1.1044 -    <target depends="init" name="-javadoc-build">
  1.1045 +    <target depends="init" if="have.sources" name="-javadoc-build">
  1.1046          <mkdir dir="${dist.javadoc.dir}"/>
  1.1047 +        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  1.1048 +            <and>
  1.1049 +                <isset property="endorsed.classpath.cmd.line.arg"/>
  1.1050 +                <not>
  1.1051 +                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  1.1052 +                </not>
  1.1053 +            </and>
  1.1054 +        </condition>
  1.1055          <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  1.1056              <classpath>
  1.1057                  <path path="${javac.classpath}"/>
  1.1058              </classpath>
  1.1059 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1060 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  1.1061                  <filename name="**/*.java"/>
  1.1062              </fileset>
  1.1063 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1064 +                <include name="**/*.java"/>
  1.1065 +                <exclude name="*.java"/>
  1.1066 +            </fileset>
  1.1067 +            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  1.1068          </javadoc>
  1.1069 +        <copy todir="${dist.javadoc.dir}">
  1.1070 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1.1071 +                <filename name="**/doc-files/**"/>
  1.1072 +            </fileset>
  1.1073 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1.1074 +                <include name="**/doc-files/**"/>
  1.1075 +            </fileset>
  1.1076 +        </copy>
  1.1077      </target>
  1.1078      <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  1.1079          <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1.1080 @@ -510,7 +1220,7 @@
  1.1081      <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  1.1082      <!--
  1.1083                  =========================
  1.1084 -                JUNIT COMPILATION SECTION
  1.1085 +                TEST COMPILATION SECTION
  1.1086                  =========================
  1.1087              -->
  1.1088      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  1.1089 @@ -523,8 +1233,8 @@
  1.1090      <target if="do.depend.true" name="-compile-test-depend">
  1.1091          <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1092      </target>
  1.1093 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1094 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1.1095 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1.1096 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  1.1097          <copy todir="${build.test.classes.dir}">
  1.1098              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1099          </copy>
  1.1100 @@ -538,10 +1248,10 @@
  1.1101          <!-- Empty placeholder for easier customization. -->
  1.1102          <!-- You can override this target in the ../build.xml file. -->
  1.1103      </target>
  1.1104 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1105 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1.1106          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1.1107          <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  1.1108 -        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  1.1109 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  1.1110          <copy todir="${build.test.classes.dir}">
  1.1111              <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1.1112          </copy>
  1.1113 @@ -553,17 +1263,17 @@
  1.1114      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  1.1115      <!--
  1.1116                  =======================
  1.1117 -                JUNIT EXECUTION SECTION
  1.1118 +                TEST EXECUTION SECTION
  1.1119                  =======================
  1.1120              -->
  1.1121      <target depends="init" if="have.tests" name="-pre-test-run">
  1.1122          <mkdir dir="${build.test.results.dir}"/>
  1.1123      </target>
  1.1124      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1.1125 -        <j2seproject3:junit testincludes="**/*Test.java"/>
  1.1126 +        <j2seproject3:test testincludes="**/*Test.java"/>
  1.1127      </target>
  1.1128      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1.1129 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1130 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1131      </target>
  1.1132      <target depends="init" if="have.tests" name="test-report"/>
  1.1133      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  1.1134 @@ -573,39 +1283,40 @@
  1.1135      </target>
  1.1136      <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1.1137          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1.1138 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  1.1139 +        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1.1140      </target>
  1.1141      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1.1142 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  1.1143 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1144      </target>
  1.1145 -    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1.1146 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1.1147 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1.1148 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1.1149 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1150 +        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1151 +    </target>
  1.1152 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  1.1153 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1.1154 +    </target>
  1.1155 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  1.1156      <!--
  1.1157                  =======================
  1.1158 -                JUNIT DEBUGGING SECTION
  1.1159 +                TEST DEBUGGING SECTION
  1.1160                  =======================
  1.1161              -->
  1.1162 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  1.1163 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  1.1164          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1165 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  1.1166 -        <delete file="${test.report.file}"/>
  1.1167 -        <mkdir dir="${build.test.results.dir}"/>
  1.1168 -        <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}">
  1.1169 -            <customize>
  1.1170 -                <syspropertyset>
  1.1171 -                    <propertyref prefix="test-sys-prop."/>
  1.1172 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1.1173 -                </syspropertyset>
  1.1174 -                <arg value="${test.class}"/>
  1.1175 -                <arg value="showoutput=true"/>
  1.1176 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  1.1177 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  1.1178 -            </customize>
  1.1179 -        </j2seproject3:debug>
  1.1180 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  1.1181 +    </target>
  1.1182 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  1.1183 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1.1184 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1.1185 +        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  1.1186      </target>
  1.1187      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1.1188          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1.1189      </target>
  1.1190 -    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1191 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1.1192 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1.1193      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1.1194          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1.1195      </target>
  1.1196 @@ -642,14 +1353,48 @@
  1.1197                  CLEANUP SECTION
  1.1198                  ===============
  1.1199              -->
  1.1200 -    <target depends="init" name="deps-clean" unless="no.deps"/>
  1.1201 +    <target name="-deps-clean-init" unless="built-clean.properties">
  1.1202 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  1.1203 +        <delete file="${built-clean.properties}" quiet="true"/>
  1.1204 +    </target>
  1.1205 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  1.1206 +        <echo level="warn" message="Cycle detected: codeinjection was already built"/>
  1.1207 +    </target>
  1.1208 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  1.1209 +        <mkdir dir="${build.dir}"/>
  1.1210 +        <touch file="${built-clean.properties}" verbose="false"/>
  1.1211 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  1.1212 +        <antcall target="-warn-already-built-clean"/>
  1.1213 +        <propertyfile file="${built-clean.properties}">
  1.1214 +            <entry key="${basedir}" value=""/>
  1.1215 +        </propertyfile>
  1.1216 +    </target>
  1.1217      <target depends="init" name="-do-clean">
  1.1218          <delete dir="${build.dir}"/>
  1.1219 -        <delete dir="${dist.dir}"/>
  1.1220 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  1.1221      </target>
  1.1222      <target name="-post-clean">
  1.1223          <!-- Empty placeholder for easier customization. -->
  1.1224          <!-- You can override this target in the ../build.xml file. -->
  1.1225      </target>
  1.1226      <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  1.1227 +    <target name="-check-call-dep">
  1.1228 +        <property file="${call.built.properties}" prefix="already.built."/>
  1.1229 +        <condition property="should.call.dep">
  1.1230 +            <and>
  1.1231 +                <not>
  1.1232 +                    <isset property="already.built.${call.subproject}"/>
  1.1233 +                </not>
  1.1234 +                <available file="${call.script}"/>
  1.1235 +            </and>
  1.1236 +        </condition>
  1.1237 +    </target>
  1.1238 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  1.1239 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  1.1240 +            <propertyset>
  1.1241 +                <propertyref prefix="transfer."/>
  1.1242 +                <mapper from="transfer.*" to="*" type="glob"/>
  1.1243 +            </propertyset>
  1.1244 +        </ant>
  1.1245 +    </target>
  1.1246  </project>
     2.1 --- a/samples/codeinjection/nbproject/genfiles.properties	Wed Aug 08 23:15:30 2012 +0200
     2.2 +++ b/samples/codeinjection/nbproject/genfiles.properties	Wed Aug 08 23:25:59 2012 +0200
     2.3 @@ -1,8 +1,8 @@
     2.4  build.xml.data.CRC32=4a8b5abf
     2.5  build.xml.script.CRC32=83b773e3
     2.6 -build.xml.stylesheet.CRC32=958a1d3e
     2.7 +build.xml.stylesheet.CRC32=28e38971@1.54.0.46
     2.8  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     2.9  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    2.10  nbproject/build-impl.xml.data.CRC32=4a8b5abf
    2.11 -nbproject/build-impl.xml.script.CRC32=87b63499
    2.12 -nbproject/build-impl.xml.stylesheet.CRC32=18b47a54
    2.13 +nbproject/build-impl.xml.script.CRC32=6a821ef7
    2.14 +nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.54.0.46
     3.1 --- a/samples/codeinjection/nbproject/project.properties	Wed Aug 08 23:15:30 2012 +0200
     3.2 +++ b/samples/codeinjection/nbproject/project.properties	Wed Aug 08 23:25:59 2012 +0200
     3.3 @@ -3,6 +3,7 @@
     3.4  # This directory is removed when the project is cleaned:
     3.5  build.dir=build
     3.6  build.generated.dir=${build.dir}/generated
     3.7 +build.generated.sources.dir=${build.dir}/generated-sources
     3.8  # Only compile against the classpath explicitly listed here:
     3.9  build.sysclasspath=ignore
    3.10  build.test.classes.dir=${build.dir}/test/classes
     4.1 --- a/samples/codeinjection/src/org/apidesign/codeinjection/CountDown.java	Wed Aug 08 23:15:30 2012 +0200
     4.2 +++ b/samples/codeinjection/src/org/apidesign/codeinjection/CountDown.java	Wed Aug 08 23:25:59 2012 +0200
     4.3 @@ -16,12 +16,16 @@
     4.4      }
     4.5  
     4.6      public static CountDown create(int initial) {
     4.7 -        return new CountDownImplV1(initial);
     4.8 +        return createSimpleImplementation(initial);
     4.9      }
    4.10  
    4.11      /** Decrements the counter */
    4.12      public abstract void down();
    4.13      /** @return true if the counter is 0 or less */
    4.14      public abstract boolean isDown();
    4.15 +// FINISH: codeinjection.CountDown
    4.16 +    
    4.17 +    private static CountDown createSimpleImplementation(int initial) {
    4.18 +        return new CountDownImplV1(initial);
    4.19 +    }
    4.20  }
    4.21 -// END: codeinjection.CountDown