samples/gc/nbproject/build-impl.xml
changeset 340 9c1a298e51a9
parent 280 e619b35c903e
child 413 f11943a373a7
     1.1 --- a/samples/gc/nbproject/build-impl.xml	Wed Oct 15 21:22:54 2008 +0200
     1.2 +++ b/samples/gc/nbproject/build-impl.xml	Mon Dec 21 16:54:12 2009 +0100
     1.3 @@ -20,6 +20,13 @@
     1.4  
     1.5          -->
     1.6  <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="gc-impl">
     1.7 +    <fail message="Please build using Ant 1.7.1 or higher.">
     1.8 +        <condition>
     1.9 +            <not>
    1.10 +                <antversion atleast="1.7.1"/>
    1.11 +            </not>
    1.12 +        </condition>
    1.13 +    </fail>
    1.14      <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    1.15      <!-- 
    1.16                  ======================
    1.17 @@ -48,21 +55,52 @@
    1.18      </target>
    1.19      <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    1.20          <available file="${manifest.file}" property="manifest.available"/>
    1.21 -        <condition property="manifest.available+main.class">
    1.22 +        <condition property="main.class.available">
    1.23              <and>
    1.24 -                <isset property="manifest.available"/>
    1.25                  <isset property="main.class"/>
    1.26                  <not>
    1.27                      <equals arg1="${main.class}" arg2="" trim="true"/>
    1.28                  </not>
    1.29              </and>
    1.30          </condition>
    1.31 +        <condition property="manifest.available+main.class">
    1.32 +            <and>
    1.33 +                <isset property="manifest.available"/>
    1.34 +                <isset property="main.class.available"/>
    1.35 +            </and>
    1.36 +        </condition>
    1.37 +        <condition property="do.mkdist">
    1.38 +            <and>
    1.39 +                <isset property="libs.CopyLibs.classpath"/>
    1.40 +                <not>
    1.41 +                    <istrue value="${mkdist.disabled}"/>
    1.42 +                </not>
    1.43 +            </and>
    1.44 +        </condition>
    1.45          <condition property="manifest.available+main.class+mkdist.available">
    1.46              <and>
    1.47                  <istrue value="${manifest.available+main.class}"/>
    1.48 -                <isset property="libs.CopyLibs.classpath"/>
    1.49 +                <isset property="do.mkdist"/>
    1.50              </and>
    1.51          </condition>
    1.52 +        <condition property="manifest.available+mkdist.available">
    1.53 +            <and>
    1.54 +                <istrue value="${manifest.available}"/>
    1.55 +                <isset property="do.mkdist"/>
    1.56 +            </and>
    1.57 +        </condition>
    1.58 +        <condition property="manifest.available-mkdist.available">
    1.59 +            <or>
    1.60 +                <istrue value="${manifest.available}"/>
    1.61 +                <isset property="do.mkdist"/>
    1.62 +            </or>
    1.63 +        </condition>
    1.64 +        <condition property="manifest.available+main.class-mkdist.available">
    1.65 +            <or>
    1.66 +                <istrue value="${manifest.available+main.class}"/>
    1.67 +                <isset property="do.mkdist"/>
    1.68 +            </or>
    1.69 +        </condition>
    1.70          <condition property="have.tests">
    1.71              <or>
    1.72                  <available file="${test.src.dir}"/>
    1.73 @@ -97,6 +135,7 @@
    1.74          <property name="javadoc.preview" value="true"/>
    1.75          <property name="application.args" value=""/>
    1.76          <property name="source.encoding" value="${file.encoding}"/>
    1.77 +        <property name="runtime.encoding" value="${source.encoding}"/>
    1.78          <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
    1.79              <and>
    1.80                  <isset property="javadoc.encoding"/>
    1.81 @@ -112,12 +151,11 @@
    1.82          <condition property="do.depend.true">
    1.83              <istrue value="${do.depend}"/>
    1.84          </condition>
    1.85 -        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
    1.86 -            <and>
    1.87 -                <isset property="jaxws.endorsed.dir"/>
    1.88 -                <available file="nbproject/jaxws-build.xml"/>
    1.89 -            </and>
    1.90 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
    1.91 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
    1.92 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
    1.93          </condition>
    1.94 +        <property name="javac.fork" value="false"/>
    1.95      </target>
    1.96      <target name="-post-init">
    1.97          <!-- Empty placeholder for easier customization. -->
    1.98 @@ -152,14 +190,23 @@
    1.99              <attribute default="${includes}" name="includes"/>
   1.100              <attribute default="${excludes}" name="excludes"/>
   1.101              <attribute default="${javac.debug}" name="debug"/>
   1.102 -            <attribute default="" name="sourcepath"/>
   1.103 +            <attribute default="${empty.dir}" name="sourcepath"/>
   1.104 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   1.105              <element name="customize" optional="true"/>
   1.106              <sequential>
   1.107 -                <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.108 +                <property location="${build.dir}/empty" name="empty.dir"/>
   1.109 +                <mkdir dir="${empty.dir}"/>
   1.110 +                <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.111 +                    <src>
   1.112 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   1.113 +                            <include name="*"/>
   1.114 +                        </dirset>
   1.115 +                    </src>
   1.116                      <classpath>
   1.117                          <path path="@{classpath}"/>
   1.118                      </classpath>
   1.119 -                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
   1.120 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.121 +                    <compilerarg line="${javac.compilerargs}"/>
   1.122                      <customize/>
   1.123                  </javac>
   1.124              </sequential>
   1.125 @@ -198,7 +245,7 @@
   1.126              <attribute default="${excludes}" name="excludes"/>
   1.127              <attribute default="**" name="testincludes"/>
   1.128              <sequential>
   1.129 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   1.130 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
   1.131                      <batchtest todir="${build.test.results.dir}">
   1.132                          <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   1.133                              <filename name="@{testincludes}"/>
   1.134 @@ -213,6 +260,7 @@
   1.135                      </syspropertyset>
   1.136                      <formatter type="brief" usefile="false"/>
   1.137                      <formatter type="xml"/>
   1.138 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.139                      <jvmarg line="${run.jvmargs}"/>
   1.140                  </junit>
   1.141              </sequential>
   1.142 @@ -269,8 +317,11 @@
   1.143              <element name="customize" optional="true"/>
   1.144              <sequential>
   1.145                  <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.146 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.147                      <jvmarg line="${debug-args-line}"/>
   1.148                      <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   1.149 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.150 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.151                      <jvmarg line="${run.jvmargs}"/>
   1.152                      <classpath>
   1.153                          <path path="@{classpath}"/>
   1.154 @@ -287,12 +338,16 @@
   1.155      <target name="-init-macrodef-java">
   1.156          <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   1.157              <attribute default="${main.class}" name="classname"/>
   1.158 +            <attribute default="${run.classpath}" name="classpath"/>
   1.159              <element name="customize" optional="true"/>
   1.160              <sequential>
   1.161                  <java classname="@{classname}" dir="${work.dir}" fork="true">
   1.162 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   1.163 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   1.164 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   1.165                      <jvmarg line="${run.jvmargs}"/>
   1.166                      <classpath>
   1.167 -                        <path path="${run.classpath}"/>
   1.168 +                        <path path="@{classpath}"/>
   1.169                      </classpath>
   1.170                      <syspropertyset>
   1.171                          <propertyref prefix="run-sys-prop."/>
   1.172 @@ -316,7 +371,22 @@
   1.173                  COMPILATION SECTION
   1.174                  ===================
   1.175              -->
   1.176 -    <target depends="init" name="deps-jar" unless="no.deps"/>
   1.177 +    <target name="-deps-jar-init" unless="built-jar.properties">
   1.178 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
   1.179 +        <delete file="${built-jar.properties}" quiet="true"/>
   1.180 +    </target>
   1.181 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
   1.182 +        <echo level="warn" message="Cycle detected: gc was already built"/>
   1.183 +    </target>
   1.184 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
   1.185 +        <mkdir dir="${build.dir}"/>
   1.186 +        <touch file="${built-jar.properties}" verbose="false"/>
   1.187 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
   1.188 +        <antcall target="-warn-already-built-jar"/>
   1.189 +        <propertyfile file="${built-jar.properties}">
   1.190 +            <entry key="${basedir}" value=""/>
   1.191 +        </propertyfile>
   1.192 +    </target>
   1.193      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
   1.194      <target depends="init" name="-check-automatic-build">
   1.195          <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   1.196 @@ -332,10 +402,15 @@
   1.197          <!-- You can override this target in the ../build.xml file. -->
   1.198      </target>
   1.199      <target if="do.depend.true" name="-compile-depend">
   1.200 -        <j2seproject3:depend/>
   1.201 +        <pathconvert property="build.generated.subdirs">
   1.202 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   1.203 +                <include name="*"/>
   1.204 +            </dirset>
   1.205 +        </pathconvert>
   1.206 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
   1.207      </target>
   1.208      <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
   1.209 -        <j2seproject3:javac/>
   1.210 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
   1.211          <copy todir="${build.classes.dir}">
   1.212              <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   1.213          </copy>
   1.214 @@ -352,7 +427,7 @@
   1.215      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   1.216          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   1.217          <j2seproject3:force-recompile/>
   1.218 -        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
   1.219 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   1.220      </target>
   1.221      <target name="-post-compile-single">
   1.222          <!-- Empty placeholder for easier customization. -->
   1.223 @@ -372,10 +447,10 @@
   1.224          <!-- Empty placeholder for easier customization. -->
   1.225          <!-- You can override this target in the ../build.xml file. -->
   1.226      </target>
   1.227 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
   1.228 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   1.229          <j2seproject1:jar/>
   1.230      </target>
   1.231 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
   1.232 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
   1.233          <j2seproject1:jar manifest="${manifest.file}"/>
   1.234      </target>
   1.235      <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.236 @@ -418,11 +493,53 @@
   1.237          <property location="${dist.jar}" name="dist.jar.resolved"/>
   1.238          <echo>java -jar "${dist.jar.resolved}"</echo>
   1.239      </target>
   1.240 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+mkdist.available" name="-do-jar-with-libraries-without-mainclass" unless="main.class.available">
   1.241 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.242 +        <pathconvert property="run.classpath.without.build.classes.dir">
   1.243 +            <path path="${run.classpath}"/>
   1.244 +            <map from="${build.classes.dir.resolved}" to=""/>
   1.245 +        </pathconvert>
   1.246 +        <pathconvert pathsep=" " property="jar.classpath">
   1.247 +            <path path="${run.classpath.without.build.classes.dir}"/>
   1.248 +            <chainedmapper>
   1.249 +                <flattenmapper/>
   1.250 +                <globmapper from="*" to="lib/*"/>
   1.251 +            </chainedmapper>
   1.252 +        </pathconvert>
   1.253 +        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.254 +        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.255 +            <fileset dir="${build.classes.dir}"/>
   1.256 +            <manifest>
   1.257 +                <attribute name="Class-Path" value="${jar.classpath}"/>
   1.258 +            </manifest>
   1.259 +        </copylibs>
   1.260 +    </target>
   1.261 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.mkdist" name="-do-jar-with-libraries-without-manifest" unless="manifest.available">
   1.262 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   1.263 +        <pathconvert property="run.classpath.without.build.classes.dir">
   1.264 +            <path path="${run.classpath}"/>
   1.265 +            <map from="${build.classes.dir.resolved}" to=""/>
   1.266 +        </pathconvert>
   1.267 +        <pathconvert pathsep=" " property="jar.classpath">
   1.268 +            <path path="${run.classpath.without.build.classes.dir}"/>
   1.269 +            <chainedmapper>
   1.270 +                <flattenmapper/>
   1.271 +                <globmapper from="*" to="lib/*"/>
   1.272 +            </chainedmapper>
   1.273 +        </pathconvert>
   1.274 +        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   1.275 +        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   1.276 +            <fileset dir="${build.classes.dir}"/>
   1.277 +            <manifest>
   1.278 +                <attribute name="Class-Path" value="${jar.classpath}"/>
   1.279 +            </manifest>
   1.280 +        </copylibs>
   1.281 +    </target>
   1.282      <target name="-post-jar">
   1.283          <!-- Empty placeholder for easier customization. -->
   1.284          <!-- You can override this target in the ../build.xml file. -->
   1.285      </target>
   1.286 -    <target 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." name="jar"/>
   1.287 +    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-mainclass,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
   1.288      <!--
   1.289                  =================
   1.290                  EXECUTION SECTION
   1.291 @@ -438,10 +555,14 @@
   1.292      <target name="-do-not-recompile">
   1.293          <property name="javac.includes.binary" value=""/>
   1.294      </target>
   1.295 -    <target depends="init,-do-not-recompile,compile-single" name="run-single">
   1.296 +    <target depends="init,compile-single" name="run-single">
   1.297          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.298          <j2seproject1:java classname="${run.class}"/>
   1.299      </target>
   1.300 +    <target depends="init,compile-test-single" name="run-test-with-main">
   1.301 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   1.302 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   1.303 +    </target>
   1.304      <!--
   1.305                  =================
   1.306                  DEBUGGING SECTION
   1.307 @@ -450,6 +571,9 @@
   1.308      <target depends="init" if="netbeans.home" name="-debug-start-debugger">
   1.309          <j2seproject1:nbjpdastart name="${debug.class}"/>
   1.310      </target>
   1.311 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
   1.312 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
   1.313 +    </target>
   1.314      <target depends="init,compile" name="-debug-start-debuggee">
   1.315          <j2seproject3:debug>
   1.316              <customize>
   1.317 @@ -466,7 +590,12 @@
   1.318          <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   1.319          <j2seproject3:debug classname="${debug.class}"/>
   1.320      </target>
   1.321 -    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   1.322 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   1.323 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
   1.324 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   1.325 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
   1.326 +    </target>
   1.327 +    <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.328      <target depends="init" name="-pre-debug-fix">
   1.329          <fail unless="fix.includes">Must set fix.includes</fail>
   1.330          <property name="javac.includes" value="${fix.includes}.java"/>
   1.331 @@ -489,6 +618,9 @@
   1.332              <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
   1.333                  <filename name="**/*.java"/>
   1.334              </fileset>
   1.335 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   1.336 +                <include name="**/*.java"/>
   1.337 +            </fileset>
   1.338          </javadoc>
   1.339      </target>
   1.340      <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
   1.341 @@ -550,7 +682,7 @@
   1.342          <j2seproject3:junit testincludes="**/*Test.java"/>
   1.343      </target>
   1.344      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
   1.345 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
   1.346 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   1.347      </target>
   1.348      <target depends="init" if="have.tests" name="test-report"/>
   1.349      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
   1.350 @@ -563,9 +695,9 @@
   1.351          <j2seproject3:junit excludes="" includes="${test.includes}"/>
   1.352      </target>
   1.353      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
   1.354 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
   1.355 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   1.356      </target>
   1.357 -    <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.358 +    <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.359      <!--
   1.360                  =======================
   1.361                  JUNIT DEBUGGING SECTION
   1.362 @@ -592,7 +724,7 @@
   1.363      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
   1.364          <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
   1.365      </target>
   1.366 -    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
   1.367 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
   1.368      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
   1.369          <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
   1.370      </target>
   1.371 @@ -629,14 +761,45 @@
   1.372                  CLEANUP SECTION
   1.373                  ===============
   1.374              -->
   1.375 -    <target depends="init" name="deps-clean" unless="no.deps"/>
   1.376 +    <target name="-deps-clean-init" unless="built-clean.properties">
   1.377 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
   1.378 +        <delete file="${built-clean.properties}" quiet="true"/>
   1.379 +    </target>
   1.380 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
   1.381 +        <echo level="warn" message="Cycle detected: gc was already built"/>
   1.382 +    </target>
   1.383 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
   1.384 +        <mkdir dir="${build.dir}"/>
   1.385 +        <touch file="${built-clean.properties}" verbose="false"/>
   1.386 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
   1.387 +        <antcall target="-warn-already-built-clean"/>
   1.388 +        <propertyfile file="${built-clean.properties}">
   1.389 +            <entry key="${basedir}" value=""/>
   1.390 +        </propertyfile>
   1.391 +    </target>
   1.392      <target depends="init" name="-do-clean">
   1.393          <delete dir="${build.dir}"/>
   1.394 -        <delete dir="${dist.dir}"/>
   1.395 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
   1.396      </target>
   1.397      <target name="-post-clean">
   1.398          <!-- Empty placeholder for easier customization. -->
   1.399          <!-- You can override this target in the ../build.xml file. -->
   1.400      </target>
   1.401      <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
   1.402 +    <target name="-check-call-dep">
   1.403 +        <property file="${call.built.properties}" prefix="already.built."/>
   1.404 +        <condition property="should.call.dep">
   1.405 +            <not>
   1.406 +                <isset property="already.built.${call.subproject}"/>
   1.407 +            </not>
   1.408 +        </condition>
   1.409 +    </target>
   1.410 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
   1.411 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
   1.412 +            <propertyset>
   1.413 +                <propertyref prefix="transfer."/>
   1.414 +                <mapper from="transfer.*" to="*" type="glob"/>
   1.415 +            </propertyset>
   1.416 +        </ant>
   1.417 +    </target>
   1.418  </project>