1.1 --- a/java/SuperPostak/nbproject/build-impl.xml Sat Feb 28 17:57:14 2009 +0100
1.2 +++ b/java/SuperPostak/nbproject/build-impl.xml Mon Sep 27 19:04:50 2010 +0200
1.3 @@ -21,6 +21,13 @@
1.4 -->
1.5 <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="SuperPostak-impl">
1.6 <import file="jnlp-impl.xml"/>
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 @@ -49,19 +56,68 @@
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 + <available file="${application.splash}" property="splashscreen.available"/>
1.23 + <condition property="main.class.available">
1.24 <and>
1.25 - <isset property="manifest.available"/>
1.26 <isset property="main.class"/>
1.27 <not>
1.28 <equals arg1="${main.class}" arg2="" trim="true"/>
1.29 </not>
1.30 </and>
1.31 </condition>
1.32 + <condition property="manifest.available+main.class">
1.33 + <and>
1.34 + <isset property="manifest.available"/>
1.35 + <isset property="main.class.available"/>
1.36 + </and>
1.37 + </condition>
1.38 + <condition property="do.mkdist">
1.39 + <and>
1.40 + <isset property="libs.CopyLibs.classpath"/>
1.41 + <not>
1.42 + <istrue value="${mkdist.disabled}"/>
1.43 + </not>
1.44 + </and>
1.45 + </condition>
1.46 <condition property="manifest.available+main.class+mkdist.available">
1.47 <and>
1.48 <istrue value="${manifest.available+main.class}"/>
1.49 - <isset property="libs.CopyLibs.classpath"/>
1.50 + <isset property="do.mkdist"/>
1.51 + </and>
1.52 + </condition>
1.53 + <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
1.54 + <and>
1.55 + <istrue value="${manifest.available+main.class+mkdist.available}"/>
1.56 + <istrue value="${splashscreen.available}"/>
1.57 + </and>
1.58 + </condition>
1.59 + <condition property="do.archive">
1.60 + <not>
1.61 + <istrue value="${jar.archive.disabled}"/>
1.62 + </not>
1.63 + </condition>
1.64 + <condition property="do.archive+manifest.available">
1.65 + <and>
1.66 + <isset property="manifest.available"/>
1.67 + <istrue value="${do.archive}"/>
1.68 + </and>
1.69 + </condition>
1.70 + <condition property="do.archive+manifest.available+main.class">
1.71 + <and>
1.72 + <istrue value="${manifest.available+main.class}"/>
1.73 + <istrue value="${do.archive}"/>
1.74 + </and>
1.75 + </condition>
1.76 + <condition property="do.archive+manifest.available+main.class+mkdist.available">
1.77 + <and>
1.78 + <istrue value="${manifest.available+main.class+mkdist.available}"/>
1.79 + <istrue value="${do.archive}"/>
1.80 + </and>
1.81 + </condition>
1.82 + <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
1.83 + <and>
1.84 + <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
1.85 + <istrue value="${do.archive}"/>
1.86 </and>
1.87 </condition>
1.88 <condition property="have.tests">
1.89 @@ -98,6 +154,7 @@
1.90 <property name="javadoc.preview" value="true"/>
1.91 <property name="application.args" value=""/>
1.92 <property name="source.encoding" value="${file.encoding}"/>
1.93 + <property name="runtime.encoding" value="${source.encoding}"/>
1.94 <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
1.95 <and>
1.96 <isset property="javadoc.encoding"/>
1.97 @@ -113,12 +170,13 @@
1.98 <condition property="do.depend.true">
1.99 <istrue value="${do.depend}"/>
1.100 </condition>
1.101 - <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
1.102 - <and>
1.103 - <isset property="jaxws.endorsed.dir"/>
1.104 - <available file="nbproject/jaxws-build.xml"/>
1.105 - </and>
1.106 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
1.107 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
1.108 + <length length="0" string="${endorsed.classpath}" when="greater"/>
1.109 </condition>
1.110 + <property name="javac.fork" value="false"/>
1.111 + <property name="jar.index" value="false"/>
1.112 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
1.113 </target>
1.114 <target name="-post-init">
1.115 <!-- Empty placeholder for easier customization. -->
1.116 @@ -145,26 +203,79 @@
1.117 </sequential>
1.118 </macrodef>
1.119 </target>
1.120 - <target name="-init-macrodef-javac">
1.121 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
1.122 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
1.123 <attribute default="${src.dir}" name="srcdir"/>
1.124 <attribute default="${build.classes.dir}" name="destdir"/>
1.125 <attribute default="${javac.classpath}" name="classpath"/>
1.126 + <attribute default="${javac.processorpath}" name="processorpath"/>
1.127 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
1.128 <attribute default="${includes}" name="includes"/>
1.129 <attribute default="${excludes}" name="excludes"/>
1.130 <attribute default="${javac.debug}" name="debug"/>
1.131 - <attribute default="/does/not/exist" name="sourcepath"/>
1.132 + <attribute default="${empty.dir}" name="sourcepath"/>
1.133 + <attribute default="${empty.dir}" name="gensrcdir"/>
1.134 <element name="customize" optional="true"/>
1.135 <sequential>
1.136 - <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.137 + <property location="${build.dir}/empty" name="empty.dir"/>
1.138 + <mkdir dir="${empty.dir}"/>
1.139 + <mkdir dir="@{apgeneratedsrcdir}"/>
1.140 + <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.141 + <src>
1.142 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
1.143 + <include name="*"/>
1.144 + </dirset>
1.145 + </src>
1.146 <classpath>
1.147 <path path="@{classpath}"/>
1.148 </classpath>
1.149 - <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
1.150 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
1.151 + <compilerarg line="${javac.compilerargs}"/>
1.152 + <compilerarg value="-processorpath"/>
1.153 + <compilerarg path="@{processorpath}:${empty.dir}"/>
1.154 + <compilerarg line="${ap.processors.internal}"/>
1.155 + <compilerarg line="${annotation.processing.processor.options}"/>
1.156 + <compilerarg value="-s"/>
1.157 + <compilerarg path="@{apgeneratedsrcdir}"/>
1.158 + <compilerarg line="${ap.proc.none.internal}"/>
1.159 <customize/>
1.160 </javac>
1.161 </sequential>
1.162 </macrodef>
1.163 + </target>
1.164 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
1.165 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
1.166 + <attribute default="${src.dir}" name="srcdir"/>
1.167 + <attribute default="${build.classes.dir}" name="destdir"/>
1.168 + <attribute default="${javac.classpath}" name="classpath"/>
1.169 + <attribute default="${javac.processorpath}" name="processorpath"/>
1.170 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
1.171 + <attribute default="${includes}" name="includes"/>
1.172 + <attribute default="${excludes}" name="excludes"/>
1.173 + <attribute default="${javac.debug}" name="debug"/>
1.174 + <attribute default="${empty.dir}" name="sourcepath"/>
1.175 + <attribute default="${empty.dir}" name="gensrcdir"/>
1.176 + <element name="customize" optional="true"/>
1.177 + <sequential>
1.178 + <property location="${build.dir}/empty" name="empty.dir"/>
1.179 + <mkdir dir="${empty.dir}"/>
1.180 + <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.181 + <src>
1.182 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
1.183 + <include name="*"/>
1.184 + </dirset>
1.185 + </src>
1.186 + <classpath>
1.187 + <path path="@{classpath}"/>
1.188 + </classpath>
1.189 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
1.190 + <compilerarg line="${javac.compilerargs}"/>
1.191 + <customize/>
1.192 + </javac>
1.193 + </sequential>
1.194 + </macrodef>
1.195 + </target>
1.196 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
1.197 <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
1.198 <attribute default="${src.dir}" name="srcdir"/>
1.199 <attribute default="${build.classes.dir}" name="destdir"/>
1.200 @@ -199,7 +310,7 @@
1.201 <attribute default="${excludes}" name="excludes"/>
1.202 <attribute default="**" name="testincludes"/>
1.203 <sequential>
1.204 - <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
1.205 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
1.206 <batchtest todir="${build.test.results.dir}">
1.207 <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.208 <filename name="@{testincludes}"/>
1.209 @@ -214,6 +325,7 @@
1.210 </syspropertyset>
1.211 <formatter type="brief" usefile="false"/>
1.212 <formatter type="xml"/>
1.213 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
1.214 <jvmarg line="${run.jvmargs}"/>
1.215 </junit>
1.216 </sequential>
1.217 @@ -270,8 +382,11 @@
1.218 <element name="customize" optional="true"/>
1.219 <sequential>
1.220 <java classname="@{classname}" dir="${work.dir}" fork="true">
1.221 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
1.222 <jvmarg line="${debug-args-line}"/>
1.223 <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
1.224 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
1.225 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
1.226 <jvmarg line="${run.jvmargs}"/>
1.227 <classpath>
1.228 <path path="@{classpath}"/>
1.229 @@ -288,12 +403,16 @@
1.230 <target name="-init-macrodef-java">
1.231 <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
1.232 <attribute default="${main.class}" name="classname"/>
1.233 + <attribute default="${run.classpath}" name="classpath"/>
1.234 <element name="customize" optional="true"/>
1.235 <sequential>
1.236 <java classname="@{classname}" dir="${work.dir}" fork="true">
1.237 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
1.238 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
1.239 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
1.240 <jvmarg line="${run.jvmargs}"/>
1.241 <classpath>
1.242 - <path path="${run.classpath}"/>
1.243 + <path path="@{classpath}"/>
1.244 </classpath>
1.245 <syspropertyset>
1.246 <propertyref prefix="run-sys-prop."/>
1.247 @@ -304,22 +423,99 @@
1.248 </sequential>
1.249 </macrodef>
1.250 </target>
1.251 + <target name="-init-macrodef-copylibs">
1.252 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
1.253 + <element name="customize" optional="true"/>
1.254 + <sequential>
1.255 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1.256 + <pathconvert property="run.classpath.without.build.classes.dir">
1.257 + <path path="${run.classpath}"/>
1.258 + <map from="${build.classes.dir.resolved}" to=""/>
1.259 + </pathconvert>
1.260 + <pathconvert pathsep=" " property="jar.classpath">
1.261 + <path path="${run.classpath.without.build.classes.dir}"/>
1.262 + <chainedmapper>
1.263 + <flattenmapper/>
1.264 + <globmapper from="*" to="lib/*"/>
1.265 + </chainedmapper>
1.266 + </pathconvert>
1.267 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
1.268 + <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
1.269 + <fileset dir="${build.classes.dir}"/>
1.270 + <manifest>
1.271 + <attribute name="Class-Path" value="${jar.classpath}"/>
1.272 + <customize/>
1.273 + </manifest>
1.274 + </copylibs>
1.275 + </sequential>
1.276 + </macrodef>
1.277 + </target>
1.278 <target name="-init-presetdef-jar">
1.279 <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
1.280 - <jar compress="${jar.compress}" jarfile="${dist.jar}">
1.281 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
1.282 <j2seproject1:fileset dir="${build.classes.dir}"/>
1.283 </jar>
1.284 </presetdef>
1.285 </target>
1.286 - <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.287 + <target name="-init-ap-cmdline-properties">
1.288 + <property name="annotation.processing.enabled" value="true"/>
1.289 + <property name="annotation.processing.processors.list" value=""/>
1.290 + <property name="annotation.processing.processor.options" value=""/>
1.291 + <property name="annotation.processing.run.all.processors" value="true"/>
1.292 + <property name="javac.processorpath" value="${javac.classpath}"/>
1.293 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
1.294 + <condition property="ap.supported.internal" value="true">
1.295 + <not>
1.296 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
1.297 + </not>
1.298 + </condition>
1.299 + </target>
1.300 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
1.301 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
1.302 + <isfalse value="${annotation.processing.run.all.processors}"/>
1.303 + </condition>
1.304 + <condition else="" property="ap.proc.none.internal" value="-proc:none">
1.305 + <isfalse value="${annotation.processing.enabled}"/>
1.306 + </condition>
1.307 + </target>
1.308 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
1.309 + <property name="ap.cmd.line.internal" value=""/>
1.310 + </target>
1.311 + <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,-init-ap-cmdline" name="init"/>
1.312 <!--
1.313 ===================
1.314 COMPILATION SECTION
1.315 ===================
1.316 -->
1.317 - <target depends="init" name="deps-jar" unless="no.deps">
1.318 - <ant antfile="${project.JFTable}/build.xml" inheritall="false" target="jar"/>
1.319 - <ant antfile="${project.Postak}/build.xml" inheritall="false" target="jar"/>
1.320 + <target name="-deps-jar-init" unless="built-jar.properties">
1.321 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
1.322 + <delete file="${built-jar.properties}" quiet="true"/>
1.323 + </target>
1.324 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
1.325 + <echo level="warn" message="Cycle detected: SuperPostak was already built"/>
1.326 + </target>
1.327 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
1.328 + <mkdir dir="${build.dir}"/>
1.329 + <touch file="${built-jar.properties}" verbose="false"/>
1.330 + <property file="${built-jar.properties}" prefix="already.built.jar."/>
1.331 + <antcall target="-warn-already-built-jar"/>
1.332 + <propertyfile file="${built-jar.properties}">
1.333 + <entry key="${basedir}" value=""/>
1.334 + </propertyfile>
1.335 + <antcall target="-maybe-call-dep">
1.336 + <param name="call.built.properties" value="${built-jar.properties}"/>
1.337 + <param location="${project.JFTable}" name="call.subproject"/>
1.338 + <param location="${project.JFTable}/build.xml" name="call.script"/>
1.339 + <param name="call.target" value="jar"/>
1.340 + <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
1.341 + </antcall>
1.342 + <antcall target="-maybe-call-dep">
1.343 + <param name="call.built.properties" value="${built-jar.properties}"/>
1.344 + <param location="${project.Postak}" name="call.subproject"/>
1.345 + <param location="${project.Postak}/build.xml" name="call.script"/>
1.346 + <param name="call.target" value="jar"/>
1.347 + <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
1.348 + </antcall>
1.349 </target>
1.350 <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
1.351 <target depends="init" name="-check-automatic-build">
1.352 @@ -336,14 +532,25 @@
1.353 <!-- You can override this target in the ../build.xml file. -->
1.354 </target>
1.355 <target if="do.depend.true" name="-compile-depend">
1.356 - <j2seproject3:depend/>
1.357 + <pathconvert property="build.generated.subdirs">
1.358 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1.359 + <include name="*"/>
1.360 + </dirset>
1.361 + </pathconvert>
1.362 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
1.363 </target>
1.364 - <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
1.365 - <j2seproject3:javac/>
1.366 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
1.367 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
1.368 <copy todir="${build.classes.dir}">
1.369 <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.370 </copy>
1.371 </target>
1.372 + <target if="has.persistence.xml" name="-copy-persistence-xml">
1.373 + <mkdir dir="${build.classes.dir}/META-INF"/>
1.374 + <copy todir="${build.classes.dir}/META-INF">
1.375 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
1.376 + </copy>
1.377 + </target>
1.378 <target name="-post-compile">
1.379 <!-- Empty placeholder for easier customization. -->
1.380 <!-- You can override this target in the ../build.xml file. -->
1.381 @@ -356,7 +563,7 @@
1.382 <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
1.383 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1.384 <j2seproject3:force-recompile/>
1.385 - <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
1.386 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
1.387 </target>
1.388 <target name="-post-compile-single">
1.389 <!-- Empty placeholder for easier customization. -->
1.390 @@ -376,13 +583,13 @@
1.391 <!-- Empty placeholder for easier customization. -->
1.392 <!-- You can override this target in the ../build.xml file. -->
1.393 </target>
1.394 - <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
1.395 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
1.396 <j2seproject1:jar/>
1.397 </target>
1.398 - <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
1.399 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
1.400 <j2seproject1:jar manifest="${manifest.file}"/>
1.401 </target>
1.402 - <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.403 + <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.404 <j2seproject1:jar manifest="${manifest.file}">
1.405 <j2seproject1:manifest>
1.406 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
1.407 @@ -397,27 +604,26 @@
1.408 </pathconvert>
1.409 <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
1.410 </target>
1.411 - <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
1.412 - <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1.413 - <pathconvert property="run.classpath.without.build.classes.dir">
1.414 - <path path="${run.classpath}"/>
1.415 - <map from="${build.classes.dir.resolved}" to=""/>
1.416 - </pathconvert>
1.417 - <pathconvert pathsep=" " property="jar.classpath">
1.418 - <path path="${run.classpath.without.build.classes.dir}"/>
1.419 - <chainedmapper>
1.420 - <flattenmapper/>
1.421 - <globmapper from="*" to="lib/*"/>
1.422 - </chainedmapper>
1.423 - </pathconvert>
1.424 - <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
1.425 - <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
1.426 - <fileset dir="${build.classes.dir}"/>
1.427 - <manifest>
1.428 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
1.429 + <basename file="${application.splash}" property="splashscreen.basename"/>
1.430 + <mkdir dir="${build.classes.dir}/META-INF"/>
1.431 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
1.432 + <j2seproject3:copylibs>
1.433 + <customize>
1.434 <attribute name="Main-Class" value="${main.class}"/>
1.435 - <attribute name="Class-Path" value="${jar.classpath}"/>
1.436 - </manifest>
1.437 - </copylibs>
1.438 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
1.439 + </customize>
1.440 + </j2seproject3:copylibs>
1.441 + <echo>To run this application from the command line without Ant, try:</echo>
1.442 + <property location="${dist.jar}" name="dist.jar.resolved"/>
1.443 + <echo>java -jar "${dist.jar.resolved}"</echo>
1.444 + </target>
1.445 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
1.446 + <j2seproject3:copylibs>
1.447 + <customize>
1.448 + <attribute name="Main-Class" value="${main.class}"/>
1.449 + </customize>
1.450 + </j2seproject3:copylibs>
1.451 <echo>To run this application from the command line without Ant, try:</echo>
1.452 <property location="${dist.jar}" name="dist.jar.resolved"/>
1.453 <echo>java -jar "${dist.jar.resolved}"</echo>
1.454 @@ -426,7 +632,7 @@
1.455 <!-- Empty placeholder for easier customization. -->
1.456 <!-- You can override this target in the ../build.xml file. -->
1.457 </target>
1.458 - <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
1.459 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
1.460 <!--
1.461 =================
1.462 EXECUTION SECTION
1.463 @@ -442,10 +648,14 @@
1.464 <target name="-do-not-recompile">
1.465 <property name="javac.includes.binary" value=""/>
1.466 </target>
1.467 - <target depends="init,-do-not-recompile,compile-single" name="run-single">
1.468 + <target depends="init,compile-single" name="run-single">
1.469 <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1.470 <j2seproject1:java classname="${run.class}"/>
1.471 </target>
1.472 + <target depends="init,compile-test-single" name="run-test-with-main">
1.473 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1.474 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
1.475 + </target>
1.476 <!--
1.477 =================
1.478 DEBUGGING SECTION
1.479 @@ -454,6 +664,9 @@
1.480 <target depends="init" if="netbeans.home" name="-debug-start-debugger">
1.481 <j2seproject1:nbjpdastart name="${debug.class}"/>
1.482 </target>
1.483 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
1.484 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
1.485 + </target>
1.486 <target depends="init,compile" name="-debug-start-debuggee">
1.487 <j2seproject3:debug>
1.488 <customize>
1.489 @@ -470,7 +683,12 @@
1.490 <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1.491 <j2seproject3:debug classname="${debug.class}"/>
1.492 </target>
1.493 - <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1.494 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1.495 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
1.496 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1.497 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
1.498 + </target>
1.499 + <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.500 <target depends="init" name="-pre-debug-fix">
1.501 <fail unless="fix.includes">Must set fix.includes</fail>
1.502 <property name="javac.includes" value="${fix.includes}.java"/>
1.503 @@ -484,7 +702,7 @@
1.504 JAVADOC SECTION
1.505 ===============
1.506 -->
1.507 - <target depends="init" name="-javadoc-build">
1.508 + <target depends="init" if="have.sources" name="-javadoc-build">
1.509 <mkdir dir="${dist.javadoc.dir}"/>
1.510 <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.511 <classpath>
1.512 @@ -493,7 +711,18 @@
1.513 <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1.514 <filename name="**/*.java"/>
1.515 </fileset>
1.516 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1.517 + <include name="**/*.java"/>
1.518 + </fileset>
1.519 </javadoc>
1.520 + <copy todir="${dist.javadoc.dir}">
1.521 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1.522 + <filename name="**/doc-files/**"/>
1.523 + </fileset>
1.524 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1.525 + <include name="**/doc-files/**"/>
1.526 + </fileset>
1.527 + </copy>
1.528 </target>
1.529 <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1.530 <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1.531 @@ -515,7 +744,7 @@
1.532 <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1.533 </target>
1.534 <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
1.535 - <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1.536 + <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.537 <copy todir="${build.test.classes.dir}">
1.538 <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.539 </copy>
1.540 @@ -532,7 +761,7 @@
1.541 <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1.542 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1.543 <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
1.544 - <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.545 + <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.546 <copy todir="${build.test.classes.dir}">
1.547 <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.548 </copy>
1.549 @@ -554,7 +783,7 @@
1.550 <j2seproject3:junit testincludes="**/*Test.java"/>
1.551 </target>
1.552 <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1.553 - <fail if="tests.failed">Some tests failed; see details above.</fail>
1.554 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1.555 </target>
1.556 <target depends="init" if="have.tests" name="test-report"/>
1.557 <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1.558 @@ -567,9 +796,9 @@
1.559 <j2seproject3:junit excludes="" includes="${test.includes}"/>
1.560 </target>
1.561 <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1.562 - <fail if="tests.failed">Some tests failed; see details above.</fail>
1.563 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1.564 </target>
1.565 - <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.566 + <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.567 <!--
1.568 =======================
1.569 JUNIT DEBUGGING SECTION
1.570 @@ -596,7 +825,7 @@
1.571 <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1.572 <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1.573 </target>
1.574 - <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1.575 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1.576 <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1.577 <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1.578 </target>
1.579 @@ -633,17 +862,59 @@
1.580 CLEANUP SECTION
1.581 ===============
1.582 -->
1.583 - <target depends="init" name="deps-clean" unless="no.deps">
1.584 - <ant antfile="${project.JFTable}/build.xml" inheritall="false" target="clean"/>
1.585 - <ant antfile="${project.Postak}/build.xml" inheritall="false" target="clean"/>
1.586 + <target name="-deps-clean-init" unless="built-clean.properties">
1.587 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1.588 + <delete file="${built-clean.properties}" quiet="true"/>
1.589 + </target>
1.590 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1.591 + <echo level="warn" message="Cycle detected: SuperPostak was already built"/>
1.592 + </target>
1.593 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1.594 + <mkdir dir="${build.dir}"/>
1.595 + <touch file="${built-clean.properties}" verbose="false"/>
1.596 + <property file="${built-clean.properties}" prefix="already.built.clean."/>
1.597 + <antcall target="-warn-already-built-clean"/>
1.598 + <propertyfile file="${built-clean.properties}">
1.599 + <entry key="${basedir}" value=""/>
1.600 + </propertyfile>
1.601 + <antcall target="-maybe-call-dep">
1.602 + <param name="call.built.properties" value="${built-clean.properties}"/>
1.603 + <param location="${project.JFTable}" name="call.subproject"/>
1.604 + <param location="${project.JFTable}/build.xml" name="call.script"/>
1.605 + <param name="call.target" value="clean"/>
1.606 + <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
1.607 + </antcall>
1.608 + <antcall target="-maybe-call-dep">
1.609 + <param name="call.built.properties" value="${built-clean.properties}"/>
1.610 + <param location="${project.Postak}" name="call.subproject"/>
1.611 + <param location="${project.Postak}/build.xml" name="call.script"/>
1.612 + <param name="call.target" value="clean"/>
1.613 + <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
1.614 + </antcall>
1.615 </target>
1.616 <target depends="init" name="-do-clean">
1.617 <delete dir="${build.dir}"/>
1.618 - <delete dir="${dist.dir}"/>
1.619 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
1.620 </target>
1.621 <target name="-post-clean">
1.622 <!-- Empty placeholder for easier customization. -->
1.623 <!-- You can override this target in the ../build.xml file. -->
1.624 </target>
1.625 <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1.626 + <target name="-check-call-dep">
1.627 + <property file="${call.built.properties}" prefix="already.built."/>
1.628 + <condition property="should.call.dep">
1.629 + <not>
1.630 + <isset property="already.built.${call.subproject}"/>
1.631 + </not>
1.632 + </condition>
1.633 + </target>
1.634 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1.635 + <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1.636 + <propertyset>
1.637 + <propertyref prefix="transfer."/>
1.638 + <mapper from="transfer.*" to="*" type="glob"/>
1.639 + </propertyset>
1.640 + </ant>
1.641 + </target>
1.642 </project>