1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/alt2xml-bin/build.xml Thu Jun 05 10:07:34 2014 +0200
1.3 @@ -0,0 +1,73 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<!-- You may freely edit this file. See commented blocks below for -->
1.6 +<!-- some examples of how to customize the build. -->
1.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
1.8 +<!-- By default, only the Clean and Build commands use this build script. -->
1.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
1.10 +<!-- the Compile on Save feature is turned off for the project. -->
1.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
1.12 +<!-- in the project's Project Properties dialog box.-->
1.13 +<project name="alt2xml-bin" default="default" basedir=".">
1.14 + <description>Builds, tests, and runs the project alt2xml-bin.</description>
1.15 + <import file="nbproject/build-impl.xml"/>
1.16 + <!--
1.17 +
1.18 + There exist several targets which are by default empty and which can be
1.19 + used for execution of your tasks. These targets are usually executed
1.20 + before and after some main targets. They are:
1.21 +
1.22 + -pre-init: called before initialization of project properties
1.23 + -post-init: called after initialization of project properties
1.24 + -pre-compile: called before javac compilation
1.25 + -post-compile: called after javac compilation
1.26 + -pre-compile-single: called before javac compilation of single file
1.27 + -post-compile-single: called after javac compilation of single file
1.28 + -pre-compile-test: called before javac compilation of JUnit tests
1.29 + -post-compile-test: called after javac compilation of JUnit tests
1.30 + -pre-compile-test-single: called before javac compilation of single JUnit test
1.31 + -post-compile-test-single: called after javac compilation of single JUunit test
1.32 + -pre-jar: called before JAR building
1.33 + -post-jar: called after JAR building
1.34 + -post-clean: called after cleaning build products
1.35 +
1.36 + (Targets beginning with '-' are not intended to be called on their own.)
1.37 +
1.38 + Example of inserting an obfuscator after compilation could look like this:
1.39 +
1.40 + <target name="-post-compile">
1.41 + <obfuscate>
1.42 + <fileset dir="${build.classes.dir}"/>
1.43 + </obfuscate>
1.44 + </target>
1.45 +
1.46 + For list of available properties check the imported
1.47 + nbproject/build-impl.xml file.
1.48 +
1.49 +
1.50 + Another way to customize the build is by overriding existing main targets.
1.51 + The targets of interest are:
1.52 +
1.53 + -init-macrodef-javac: defines macro for javac compilation
1.54 + -init-macrodef-junit: defines macro for junit execution
1.55 + -init-macrodef-debug: defines macro for class debugging
1.56 + -init-macrodef-java: defines macro for class execution
1.57 + -do-jar: JAR building
1.58 + run: execution of project
1.59 + -javadoc-build: Javadoc generation
1.60 + test-report: JUnit report generation
1.61 +
1.62 + An example of overriding the target for project execution could look like this:
1.63 +
1.64 + <target name="run" depends="alt2xml-bin-impl.jar">
1.65 + <exec dir="bin" executable="launcher.exe">
1.66 + <arg file="${dist.jar}"/>
1.67 + </exec>
1.68 + </target>
1.69 +
1.70 + Notice that the overridden target depends on the jar target and not only on
1.71 + the compile target as the regular run target does. Again, for a list of available
1.72 + properties which you can use, check the target you are overriding in the
1.73 + nbproject/build-impl.xml file.
1.74 +
1.75 + -->
1.76 +</project>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/java/alt2xml-bin/manifest.mf Thu Jun 05 10:07:34 2014 +0200
2.3 @@ -0,0 +1,3 @@
2.4 +Manifest-Version: 1.0
2.5 +X-COMMENT: Main-Class will be added automatically by build
2.6 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/java/alt2xml-bin/nbproject/build-impl.xml Thu Jun 05 10:07:34 2014 +0200
3.3 @@ -0,0 +1,1042 @@
3.4 +<?xml version="1.0" encoding="UTF-8"?>
3.5 +<!--
3.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
3.7 +*** EDIT ../build.xml INSTEAD ***
3.8 +
3.9 +For the purpose of easier reading the script
3.10 +is divided into following sections:
3.11 +
3.12 + - initialization
3.13 + - compilation
3.14 + - jar
3.15 + - execution
3.16 + - debugging
3.17 + - javadoc
3.18 + - junit compilation
3.19 + - junit execution
3.20 + - junit debugging
3.21 + - applet
3.22 + - cleanup
3.23 +
3.24 + -->
3.25 +<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="alt2xml-impl">
3.26 + <fail message="Please build using Ant 1.7.1 or higher.">
3.27 + <condition>
3.28 + <not>
3.29 + <antversion atleast="1.7.1"/>
3.30 + </not>
3.31 + </condition>
3.32 + </fail>
3.33 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
3.34 + <!--
3.35 + ======================
3.36 + INITIALIZATION SECTION
3.37 + ======================
3.38 + -->
3.39 + <target name="-pre-init">
3.40 + <!-- Empty placeholder for easier customization. -->
3.41 + <!-- You can override this target in the ../build.xml file. -->
3.42 + </target>
3.43 + <target depends="-pre-init" name="-init-private">
3.44 + <property file="nbproject/private/config.properties"/>
3.45 + <property file="nbproject/private/configs/${config}.properties"/>
3.46 + <property file="nbproject/private/private.properties"/>
3.47 + </target>
3.48 + <target depends="-pre-init,-init-private" name="-init-user">
3.49 + <property file="${user.properties.file}"/>
3.50 + <!-- The two properties below are usually overridden -->
3.51 + <!-- by the active platform. Just a fallback. -->
3.52 + <property name="default.javac.source" value="1.4"/>
3.53 + <property name="default.javac.target" value="1.4"/>
3.54 + </target>
3.55 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
3.56 + <property file="nbproject/configs/${config}.properties"/>
3.57 + <property file="nbproject/project.properties"/>
3.58 + </target>
3.59 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
3.60 + <available file="${manifest.file}" property="manifest.available"/>
3.61 + <condition property="splashscreen.available">
3.62 + <and>
3.63 + <not>
3.64 + <equals arg1="${application.splash}" arg2="" trim="true"/>
3.65 + </not>
3.66 + <available file="${application.splash}"/>
3.67 + </and>
3.68 + </condition>
3.69 + <condition property="main.class.available">
3.70 + <and>
3.71 + <isset property="main.class"/>
3.72 + <not>
3.73 + <equals arg1="${main.class}" arg2="" trim="true"/>
3.74 + </not>
3.75 + </and>
3.76 + </condition>
3.77 + <condition property="manifest.available+main.class">
3.78 + <and>
3.79 + <isset property="manifest.available"/>
3.80 + <isset property="main.class.available"/>
3.81 + </and>
3.82 + </condition>
3.83 + <condition property="do.archive">
3.84 + <not>
3.85 + <istrue value="${jar.archive.disabled}"/>
3.86 + </not>
3.87 + </condition>
3.88 + <condition property="do.mkdist">
3.89 + <and>
3.90 + <isset property="do.archive"/>
3.91 + <isset property="libs.CopyLibs.classpath"/>
3.92 + <not>
3.93 + <istrue value="${mkdist.disabled}"/>
3.94 + </not>
3.95 + </and>
3.96 + </condition>
3.97 + <condition property="manifest.available+main.class+mkdist.available">
3.98 + <and>
3.99 + <istrue value="${manifest.available+main.class}"/>
3.100 + <isset property="do.mkdist"/>
3.101 + </and>
3.102 + </condition>
3.103 + <condition property="do.archive+manifest.available">
3.104 + <and>
3.105 + <isset property="manifest.available"/>
3.106 + <istrue value="${do.archive}"/>
3.107 + </and>
3.108 + </condition>
3.109 + <condition property="do.archive+main.class.available">
3.110 + <and>
3.111 + <isset property="main.class.available"/>
3.112 + <istrue value="${do.archive}"/>
3.113 + </and>
3.114 + </condition>
3.115 + <condition property="do.archive+splashscreen.available">
3.116 + <and>
3.117 + <isset property="splashscreen.available"/>
3.118 + <istrue value="${do.archive}"/>
3.119 + </and>
3.120 + </condition>
3.121 + <condition property="do.archive+manifest.available+main.class">
3.122 + <and>
3.123 + <istrue value="${manifest.available+main.class}"/>
3.124 + <istrue value="${do.archive}"/>
3.125 + </and>
3.126 + </condition>
3.127 + <condition property="manifest.available-mkdist.available">
3.128 + <or>
3.129 + <istrue value="${manifest.available}"/>
3.130 + <isset property="do.mkdist"/>
3.131 + </or>
3.132 + </condition>
3.133 + <condition property="manifest.available+main.class-mkdist.available">
3.134 + <or>
3.135 + <istrue value="${manifest.available+main.class}"/>
3.136 + <isset property="do.mkdist"/>
3.137 + </or>
3.138 + </condition>
3.139 + <condition property="have.tests">
3.140 + <or>
3.141 + <available file="${test.src.dir}"/>
3.142 + </or>
3.143 + </condition>
3.144 + <condition property="have.sources">
3.145 + <or>
3.146 + <available file="${src.dir}"/>
3.147 + </or>
3.148 + </condition>
3.149 + <condition property="netbeans.home+have.tests">
3.150 + <and>
3.151 + <isset property="netbeans.home"/>
3.152 + <isset property="have.tests"/>
3.153 + </and>
3.154 + </condition>
3.155 + <condition property="no.javadoc.preview">
3.156 + <and>
3.157 + <isset property="javadoc.preview"/>
3.158 + <isfalse value="${javadoc.preview}"/>
3.159 + </and>
3.160 + </condition>
3.161 + <property name="run.jvmargs" value=""/>
3.162 + <property name="javac.compilerargs" value=""/>
3.163 + <property name="work.dir" value="${basedir}"/>
3.164 + <condition property="no.deps">
3.165 + <and>
3.166 + <istrue value="${no.dependencies}"/>
3.167 + </and>
3.168 + </condition>
3.169 + <property name="javac.debug" value="true"/>
3.170 + <property name="javadoc.preview" value="true"/>
3.171 + <property name="application.args" value=""/>
3.172 + <property name="source.encoding" value="${file.encoding}"/>
3.173 + <property name="runtime.encoding" value="${source.encoding}"/>
3.174 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
3.175 + <and>
3.176 + <isset property="javadoc.encoding"/>
3.177 + <not>
3.178 + <equals arg1="${javadoc.encoding}" arg2=""/>
3.179 + </not>
3.180 + </and>
3.181 + </condition>
3.182 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
3.183 + <property name="includes" value="**"/>
3.184 + <property name="excludes" value=""/>
3.185 + <property name="do.depend" value="false"/>
3.186 + <condition property="do.depend.true">
3.187 + <istrue value="${do.depend}"/>
3.188 + </condition>
3.189 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
3.190 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
3.191 + <length length="0" string="${endorsed.classpath}" when="greater"/>
3.192 + </condition>
3.193 + <condition else="false" property="jdkBug6558476">
3.194 + <and>
3.195 + <matches pattern="1\.[56]" string="${java.specification.version}"/>
3.196 + <not>
3.197 + <os family="unix"/>
3.198 + </not>
3.199 + </and>
3.200 + </condition>
3.201 + <property name="javac.fork" value="${jdkBug6558476}"/>
3.202 + <property name="jar.index" value="false"/>
3.203 + <property name="jar.index.metainf" value="${jar.index}"/>
3.204 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
3.205 + </target>
3.206 + <target name="-post-init">
3.207 + <!-- Empty placeholder for easier customization. -->
3.208 + <!-- You can override this target in the ../build.xml file. -->
3.209 + </target>
3.210 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
3.211 + <fail unless="src.dir">Must set src.dir</fail>
3.212 + <fail unless="test.src.dir">Must set test.src.dir</fail>
3.213 + <fail unless="build.dir">Must set build.dir</fail>
3.214 + <fail unless="dist.dir">Must set dist.dir</fail>
3.215 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
3.216 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
3.217 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
3.218 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
3.219 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
3.220 + <fail unless="dist.jar">Must set dist.jar</fail>
3.221 + </target>
3.222 + <target name="-init-macrodef-property">
3.223 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
3.224 + <attribute name="name"/>
3.225 + <attribute name="value"/>
3.226 + <sequential>
3.227 + <property name="@{name}" value="${@{value}}"/>
3.228 + </sequential>
3.229 + </macrodef>
3.230 + </target>
3.231 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
3.232 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
3.233 + <attribute default="${src.dir}" name="srcdir"/>
3.234 + <attribute default="${build.classes.dir}" name="destdir"/>
3.235 + <attribute default="${javac.classpath}" name="classpath"/>
3.236 + <attribute default="${javac.processorpath}" name="processorpath"/>
3.237 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
3.238 + <attribute default="${includes}" name="includes"/>
3.239 + <attribute default="${excludes}" name="excludes"/>
3.240 + <attribute default="${javac.debug}" name="debug"/>
3.241 + <attribute default="${empty.dir}" name="sourcepath"/>
3.242 + <attribute default="${empty.dir}" name="gensrcdir"/>
3.243 + <element name="customize" optional="true"/>
3.244 + <sequential>
3.245 + <property location="${build.dir}/empty" name="empty.dir"/>
3.246 + <mkdir dir="${empty.dir}"/>
3.247 + <mkdir dir="@{apgeneratedsrcdir}"/>
3.248 + <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}">
3.249 + <src>
3.250 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
3.251 + <include name="*"/>
3.252 + </dirset>
3.253 + </src>
3.254 + <classpath>
3.255 + <path path="@{classpath}"/>
3.256 + </classpath>
3.257 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
3.258 + <compilerarg line="${javac.compilerargs}"/>
3.259 + <compilerarg value="-processorpath"/>
3.260 + <compilerarg path="@{processorpath}:${empty.dir}"/>
3.261 + <compilerarg line="${ap.processors.internal}"/>
3.262 + <compilerarg line="${annotation.processing.processor.options}"/>
3.263 + <compilerarg value="-s"/>
3.264 + <compilerarg path="@{apgeneratedsrcdir}"/>
3.265 + <compilerarg line="${ap.proc.none.internal}"/>
3.266 + <customize/>
3.267 + </javac>
3.268 + </sequential>
3.269 + </macrodef>
3.270 + </target>
3.271 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
3.272 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
3.273 + <attribute default="${src.dir}" name="srcdir"/>
3.274 + <attribute default="${build.classes.dir}" name="destdir"/>
3.275 + <attribute default="${javac.classpath}" name="classpath"/>
3.276 + <attribute default="${javac.processorpath}" name="processorpath"/>
3.277 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
3.278 + <attribute default="${includes}" name="includes"/>
3.279 + <attribute default="${excludes}" name="excludes"/>
3.280 + <attribute default="${javac.debug}" name="debug"/>
3.281 + <attribute default="${empty.dir}" name="sourcepath"/>
3.282 + <attribute default="${empty.dir}" name="gensrcdir"/>
3.283 + <element name="customize" optional="true"/>
3.284 + <sequential>
3.285 + <property location="${build.dir}/empty" name="empty.dir"/>
3.286 + <mkdir dir="${empty.dir}"/>
3.287 + <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}">
3.288 + <src>
3.289 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
3.290 + <include name="*"/>
3.291 + </dirset>
3.292 + </src>
3.293 + <classpath>
3.294 + <path path="@{classpath}"/>
3.295 + </classpath>
3.296 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
3.297 + <compilerarg line="${javac.compilerargs}"/>
3.298 + <customize/>
3.299 + </javac>
3.300 + </sequential>
3.301 + </macrodef>
3.302 + </target>
3.303 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
3.304 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
3.305 + <attribute default="${src.dir}" name="srcdir"/>
3.306 + <attribute default="${build.classes.dir}" name="destdir"/>
3.307 + <attribute default="${javac.classpath}" name="classpath"/>
3.308 + <sequential>
3.309 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
3.310 + <classpath>
3.311 + <path path="@{classpath}"/>
3.312 + </classpath>
3.313 + </depend>
3.314 + </sequential>
3.315 + </macrodef>
3.316 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
3.317 + <attribute default="${build.classes.dir}" name="destdir"/>
3.318 + <sequential>
3.319 + <fail unless="javac.includes">Must set javac.includes</fail>
3.320 + <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
3.321 + <path>
3.322 + <filelist dir="@{destdir}" files="${javac.includes}"/>
3.323 + </path>
3.324 + <globmapper from="*.java" to="*.class"/>
3.325 + </pathconvert>
3.326 + <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
3.327 + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
3.328 + <delete>
3.329 + <files includesfile="${javac.includesfile.binary}"/>
3.330 + </delete>
3.331 + <delete>
3.332 + <fileset file="${javac.includesfile.binary}"/>
3.333 + </delete>
3.334 + </sequential>
3.335 + </macrodef>
3.336 + </target>
3.337 + <target name="-init-macrodef-junit">
3.338 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
3.339 + <attribute default="${includes}" name="includes"/>
3.340 + <attribute default="${excludes}" name="excludes"/>
3.341 + <attribute default="**" name="testincludes"/>
3.342 + <sequential>
3.343 + <property name="junit.forkmode" value="perTest"/>
3.344 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
3.345 + <batchtest todir="${build.test.results.dir}">
3.346 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
3.347 + <filename name="@{testincludes}"/>
3.348 + </fileset>
3.349 + </batchtest>
3.350 + <classpath>
3.351 + <path path="${run.test.classpath}"/>
3.352 + </classpath>
3.353 + <syspropertyset>
3.354 + <propertyref prefix="test-sys-prop."/>
3.355 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.356 + </syspropertyset>
3.357 + <formatter type="brief" usefile="false"/>
3.358 + <formatter type="xml"/>
3.359 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
3.360 + <jvmarg value="-ea"/>
3.361 + <jvmarg line="${run.jvmargs}"/>
3.362 + </junit>
3.363 + </sequential>
3.364 + </macrodef>
3.365 + </target>
3.366 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
3.367 + <target name="-profile-pre-init">
3.368 + <!-- Empty placeholder for easier customization. -->
3.369 + <!-- You can override this target in the ../build.xml file. -->
3.370 + </target>
3.371 + <target name="-profile-post-init">
3.372 + <!-- Empty placeholder for easier customization. -->
3.373 + <!-- You can override this target in the ../build.xml file. -->
3.374 + </target>
3.375 + <target name="-profile-init-macrodef-profile">
3.376 + <macrodef name="resolve">
3.377 + <attribute name="name"/>
3.378 + <attribute name="value"/>
3.379 + <sequential>
3.380 + <property name="@{name}" value="${env.@{value}}"/>
3.381 + </sequential>
3.382 + </macrodef>
3.383 + <macrodef name="profile">
3.384 + <attribute default="${main.class}" name="classname"/>
3.385 + <element name="customize" optional="true"/>
3.386 + <sequential>
3.387 + <property environment="env"/>
3.388 + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
3.389 + <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
3.390 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
3.391 + <jvmarg line="${profiler.info.jvmargs}"/>
3.392 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
3.393 + <arg line="${application.args}"/>
3.394 + <classpath>
3.395 + <path path="${run.classpath}"/>
3.396 + </classpath>
3.397 + <syspropertyset>
3.398 + <propertyref prefix="run-sys-prop."/>
3.399 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.400 + </syspropertyset>
3.401 + <customize/>
3.402 + </java>
3.403 + </sequential>
3.404 + </macrodef>
3.405 + </target>
3.406 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
3.407 + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
3.408 + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
3.409 + </target>
3.410 + <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
3.411 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
3.412 + <attribute default="${main.class}" name="name"/>
3.413 + <attribute default="${debug.classpath}" name="classpath"/>
3.414 + <attribute default="" name="stopclassname"/>
3.415 + <sequential>
3.416 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
3.417 + <classpath>
3.418 + <path path="@{classpath}"/>
3.419 + </classpath>
3.420 + </nbjpdastart>
3.421 + </sequential>
3.422 + </macrodef>
3.423 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
3.424 + <attribute default="${build.classes.dir}" name="dir"/>
3.425 + <sequential>
3.426 + <nbjpdareload>
3.427 + <fileset dir="@{dir}" includes="${fix.classes}">
3.428 + <include name="${fix.includes}*.class"/>
3.429 + </fileset>
3.430 + </nbjpdareload>
3.431 + </sequential>
3.432 + </macrodef>
3.433 + </target>
3.434 + <target name="-init-debug-args">
3.435 + <property name="version-output" value="java version "${ant.java.version}"/>
3.436 + <condition property="have-jdk-older-than-1.4">
3.437 + <or>
3.438 + <contains string="${version-output}" substring="java version "1.0"/>
3.439 + <contains string="${version-output}" substring="java version "1.1"/>
3.440 + <contains string="${version-output}" substring="java version "1.2"/>
3.441 + <contains string="${version-output}" substring="java version "1.3"/>
3.442 + </or>
3.443 + </condition>
3.444 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
3.445 + <istrue value="${have-jdk-older-than-1.4}"/>
3.446 + </condition>
3.447 + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
3.448 + <os family="windows"/>
3.449 + </condition>
3.450 + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
3.451 + <isset property="debug.transport"/>
3.452 + </condition>
3.453 + </target>
3.454 + <target depends="-init-debug-args" name="-init-macrodef-debug">
3.455 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
3.456 + <attribute default="${main.class}" name="classname"/>
3.457 + <attribute default="${debug.classpath}" name="classpath"/>
3.458 + <element name="customize" optional="true"/>
3.459 + <sequential>
3.460 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.461 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
3.462 + <jvmarg line="${debug-args-line}"/>
3.463 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
3.464 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
3.465 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
3.466 + <jvmarg line="${run.jvmargs}"/>
3.467 + <classpath>
3.468 + <path path="@{classpath}"/>
3.469 + </classpath>
3.470 + <syspropertyset>
3.471 + <propertyref prefix="run-sys-prop."/>
3.472 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.473 + </syspropertyset>
3.474 + <customize/>
3.475 + </java>
3.476 + </sequential>
3.477 + </macrodef>
3.478 + </target>
3.479 + <target name="-init-macrodef-java">
3.480 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
3.481 + <attribute default="${main.class}" name="classname"/>
3.482 + <attribute default="${run.classpath}" name="classpath"/>
3.483 + <element name="customize" optional="true"/>
3.484 + <sequential>
3.485 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.486 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
3.487 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
3.488 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
3.489 + <jvmarg line="${run.jvmargs}"/>
3.490 + <classpath>
3.491 + <path path="@{classpath}"/>
3.492 + </classpath>
3.493 + <syspropertyset>
3.494 + <propertyref prefix="run-sys-prop."/>
3.495 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.496 + </syspropertyset>
3.497 + <customize/>
3.498 + </java>
3.499 + </sequential>
3.500 + </macrodef>
3.501 + </target>
3.502 + <target name="-init-macrodef-copylibs">
3.503 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
3.504 + <attribute default="${manifest.file}" name="manifest"/>
3.505 + <element name="customize" optional="true"/>
3.506 + <sequential>
3.507 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.508 + <pathconvert property="run.classpath.without.build.classes.dir">
3.509 + <path path="${run.classpath}"/>
3.510 + <map from="${build.classes.dir.resolved}" to=""/>
3.511 + </pathconvert>
3.512 + <pathconvert pathsep=" " property="jar.classpath">
3.513 + <path path="${run.classpath.without.build.classes.dir}"/>
3.514 + <chainedmapper>
3.515 + <flattenmapper/>
3.516 + <globmapper from="*" to="lib/*"/>
3.517 + </chainedmapper>
3.518 + </pathconvert>
3.519 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
3.520 + <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
3.521 + <fileset dir="${build.classes.dir}"/>
3.522 + <manifest>
3.523 + <attribute name="Class-Path" value="${jar.classpath}"/>
3.524 + <customize/>
3.525 + </manifest>
3.526 + </copylibs>
3.527 + </sequential>
3.528 + </macrodef>
3.529 + </target>
3.530 + <target name="-init-presetdef-jar">
3.531 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
3.532 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
3.533 + <j2seproject1:fileset dir="${build.classes.dir}"/>
3.534 + </jar>
3.535 + </presetdef>
3.536 + </target>
3.537 + <target name="-init-ap-cmdline-properties">
3.538 + <property name="annotation.processing.enabled" value="true"/>
3.539 + <property name="annotation.processing.processors.list" value=""/>
3.540 + <property name="annotation.processing.processor.options" value=""/>
3.541 + <property name="annotation.processing.run.all.processors" value="true"/>
3.542 + <property name="javac.processorpath" value="${javac.classpath}"/>
3.543 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
3.544 + <condition property="ap.supported.internal" value="true">
3.545 + <not>
3.546 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
3.547 + </not>
3.548 + </condition>
3.549 + </target>
3.550 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
3.551 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
3.552 + <isfalse value="${annotation.processing.run.all.processors}"/>
3.553 + </condition>
3.554 + <condition else="" property="ap.proc.none.internal" value="-proc:none">
3.555 + <isfalse value="${annotation.processing.enabled}"/>
3.556 + </condition>
3.557 + </target>
3.558 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
3.559 + <property name="ap.cmd.line.internal" value=""/>
3.560 + </target>
3.561 + <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"/>
3.562 + <!--
3.563 + ===================
3.564 + COMPILATION SECTION
3.565 + ===================
3.566 + -->
3.567 + <target name="-deps-jar-init" unless="built-jar.properties">
3.568 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
3.569 + <delete file="${built-jar.properties}" quiet="true"/>
3.570 + </target>
3.571 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
3.572 + <echo level="warn" message="Cycle detected: alt2xml was already built"/>
3.573 + </target>
3.574 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
3.575 + <mkdir dir="${build.dir}"/>
3.576 + <touch file="${built-jar.properties}" verbose="false"/>
3.577 + <property file="${built-jar.properties}" prefix="already.built.jar."/>
3.578 + <antcall target="-warn-already-built-jar"/>
3.579 + <propertyfile file="${built-jar.properties}">
3.580 + <entry key="${basedir}" value=""/>
3.581 + </propertyfile>
3.582 + </target>
3.583 + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
3.584 + <target depends="init" name="-check-automatic-build">
3.585 + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
3.586 + </target>
3.587 + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
3.588 + <antcall target="clean"/>
3.589 + </target>
3.590 + <target depends="init,deps-jar" name="-pre-pre-compile">
3.591 + <mkdir dir="${build.classes.dir}"/>
3.592 + </target>
3.593 + <target name="-pre-compile">
3.594 + <!-- Empty placeholder for easier customization. -->
3.595 + <!-- You can override this target in the ../build.xml file. -->
3.596 + </target>
3.597 + <target if="do.depend.true" name="-compile-depend">
3.598 + <pathconvert property="build.generated.subdirs">
3.599 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
3.600 + <include name="*"/>
3.601 + </dirset>
3.602 + </pathconvert>
3.603 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
3.604 + </target>
3.605 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
3.606 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
3.607 + <copy todir="${build.classes.dir}">
3.608 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.609 + </copy>
3.610 + </target>
3.611 + <target if="has.persistence.xml" name="-copy-persistence-xml">
3.612 + <mkdir dir="${build.classes.dir}/META-INF"/>
3.613 + <copy todir="${build.classes.dir}/META-INF">
3.614 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
3.615 + </copy>
3.616 + </target>
3.617 + <target name="-post-compile">
3.618 + <!-- Empty placeholder for easier customization. -->
3.619 + <!-- You can override this target in the ../build.xml file. -->
3.620 + </target>
3.621 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
3.622 + <target name="-pre-compile-single">
3.623 + <!-- Empty placeholder for easier customization. -->
3.624 + <!-- You can override this target in the ../build.xml file. -->
3.625 + </target>
3.626 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
3.627 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.628 + <j2seproject3:force-recompile/>
3.629 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
3.630 + </target>
3.631 + <target name="-post-compile-single">
3.632 + <!-- Empty placeholder for easier customization. -->
3.633 + <!-- You can override this target in the ../build.xml file. -->
3.634 + </target>
3.635 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
3.636 + <!--
3.637 + ====================
3.638 + JAR BUILDING SECTION
3.639 + ====================
3.640 + -->
3.641 + <target depends="init" name="-pre-pre-jar">
3.642 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
3.643 + <mkdir dir="${dist.jar.dir}"/>
3.644 + </target>
3.645 + <target name="-pre-jar">
3.646 + <!-- Empty placeholder for easier customization. -->
3.647 + <!-- You can override this target in the ../build.xml file. -->
3.648 + </target>
3.649 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
3.650 + <j2seproject1:jar/>
3.651 + </target>
3.652 + <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">
3.653 + <j2seproject1:jar manifest="${manifest.file}"/>
3.654 + </target>
3.655 + <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">
3.656 + <j2seproject1:jar manifest="${manifest.file}">
3.657 + <j2seproject1:manifest>
3.658 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
3.659 + </j2seproject1:manifest>
3.660 + </j2seproject1:jar>
3.661 + <echo level="info">To run this application from the command line without Ant, try:</echo>
3.662 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.663 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.664 + <pathconvert property="run.classpath.with.dist.jar">
3.665 + <path path="${run.classpath}"/>
3.666 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
3.667 + </pathconvert>
3.668 + <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
3.669 + </target>
3.670 + <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
3.671 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
3.672 + <touch file="${tmp.manifest.file}" verbose="false"/>
3.673 + </target>
3.674 + <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
3.675 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
3.676 + <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
3.677 + </target>
3.678 + <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">
3.679 + <manifest file="${tmp.manifest.file}" mode="update">
3.680 + <attribute name="Main-Class" value="${main.class}"/>
3.681 + </manifest>
3.682 + </target>
3.683 + <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">
3.684 + <basename file="${application.splash}" property="splashscreen.basename"/>
3.685 + <mkdir dir="${build.classes.dir}/META-INF"/>
3.686 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
3.687 + <manifest file="${tmp.manifest.file}" mode="update">
3.688 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
3.689 + </manifest>
3.690 + </target>
3.691 + <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">
3.692 + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
3.693 + <echo level="info">To run this application from the command line without Ant, try:</echo>
3.694 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.695 + <echo level="info">java -jar "${dist.jar.resolved}"</echo>
3.696 + </target>
3.697 + <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
3.698 + <delete>
3.699 + <fileset file="${tmp.manifest.file}"/>
3.700 + </delete>
3.701 + </target>
3.702 + <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"/>
3.703 + <target name="-post-jar">
3.704 + <!-- Empty placeholder for easier customization. -->
3.705 + <!-- You can override this target in the ../build.xml file. -->
3.706 + </target>
3.707 + <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"/>
3.708 + <!--
3.709 + =================
3.710 + EXECUTION SECTION
3.711 + =================
3.712 + -->
3.713 + <target depends="init,compile" description="Run a main class." name="run">
3.714 + <j2seproject1:java>
3.715 + <customize>
3.716 + <arg line="${application.args}"/>
3.717 + </customize>
3.718 + </j2seproject1:java>
3.719 + </target>
3.720 + <target name="-do-not-recompile">
3.721 + <property name="javac.includes.binary" value=""/>
3.722 + </target>
3.723 + <target depends="init,compile-single" name="run-single">
3.724 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
3.725 + <j2seproject1:java classname="${run.class}"/>
3.726 + </target>
3.727 + <target depends="init,compile-test-single" name="run-test-with-main">
3.728 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
3.729 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
3.730 + </target>
3.731 + <!--
3.732 + =================
3.733 + DEBUGGING SECTION
3.734 + =================
3.735 + -->
3.736 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
3.737 + <j2seproject1:nbjpdastart name="${debug.class}"/>
3.738 + </target>
3.739 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
3.740 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
3.741 + </target>
3.742 + <target depends="init,compile" name="-debug-start-debuggee">
3.743 + <j2seproject3:debug>
3.744 + <customize>
3.745 + <arg line="${application.args}"/>
3.746 + </customize>
3.747 + </j2seproject3:debug>
3.748 + </target>
3.749 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
3.750 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
3.751 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
3.752 + </target>
3.753 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
3.754 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
3.755 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
3.756 + <j2seproject3:debug classname="${debug.class}"/>
3.757 + </target>
3.758 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
3.759 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
3.760 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
3.761 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
3.762 + </target>
3.763 + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
3.764 + <target depends="init" name="-pre-debug-fix">
3.765 + <fail unless="fix.includes">Must set fix.includes</fail>
3.766 + <property name="javac.includes" value="${fix.includes}.java"/>
3.767 + </target>
3.768 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
3.769 + <j2seproject1:nbjpdareload/>
3.770 + </target>
3.771 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
3.772 + <!--
3.773 + =================
3.774 + PROFILING SECTION
3.775 + =================
3.776 + -->
3.777 + <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
3.778 + <nbprofiledirect>
3.779 + <classpath>
3.780 + <path path="${run.classpath}"/>
3.781 + </classpath>
3.782 + </nbprofiledirect>
3.783 + <profile/>
3.784 + </target>
3.785 + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
3.786 + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
3.787 + <nbprofiledirect>
3.788 + <classpath>
3.789 + <path path="${run.classpath}"/>
3.790 + </classpath>
3.791 + </nbprofiledirect>
3.792 + <profile classname="${profile.class}"/>
3.793 + </target>
3.794 + <!--
3.795 + =========================
3.796 + APPLET PROFILING SECTION
3.797 + =========================
3.798 + -->
3.799 + <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
3.800 + <nbprofiledirect>
3.801 + <classpath>
3.802 + <path path="${run.classpath}"/>
3.803 + </classpath>
3.804 + </nbprofiledirect>
3.805 + <profile classname="sun.applet.AppletViewer">
3.806 + <customize>
3.807 + <arg value="${applet.url}"/>
3.808 + </customize>
3.809 + </profile>
3.810 + </target>
3.811 + <!--
3.812 + =========================
3.813 + TESTS PROFILING SECTION
3.814 + =========================
3.815 + -->
3.816 + <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
3.817 + <nbprofiledirect>
3.818 + <classpath>
3.819 + <path path="${run.test.classpath}"/>
3.820 + </classpath>
3.821 + </nbprofiledirect>
3.822 + <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
3.823 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
3.824 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
3.825 + <jvmarg line="${profiler.info.jvmargs}"/>
3.826 + <test name="${profile.class}"/>
3.827 + <classpath>
3.828 + <path path="${run.test.classpath}"/>
3.829 + </classpath>
3.830 + <syspropertyset>
3.831 + <propertyref prefix="test-sys-prop."/>
3.832 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.833 + </syspropertyset>
3.834 + <formatter type="brief" usefile="false"/>
3.835 + <formatter type="xml"/>
3.836 + </junit>
3.837 + </target>
3.838 + <!--
3.839 + ===============
3.840 + JAVADOC SECTION
3.841 + ===============
3.842 + -->
3.843 + <target depends="init" if="have.sources" name="-javadoc-build">
3.844 + <mkdir dir="${dist.javadoc.dir}"/>
3.845 + <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}">
3.846 + <classpath>
3.847 + <path path="${javac.classpath}"/>
3.848 + </classpath>
3.849 + <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
3.850 + <filename name="**/*.java"/>
3.851 + </fileset>
3.852 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
3.853 + <include name="**/*.java"/>
3.854 + <exclude name="*.java"/>
3.855 + </fileset>
3.856 + </javadoc>
3.857 + <copy todir="${dist.javadoc.dir}">
3.858 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
3.859 + <filename name="**/doc-files/**"/>
3.860 + </fileset>
3.861 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
3.862 + <include name="**/doc-files/**"/>
3.863 + </fileset>
3.864 + </copy>
3.865 + </target>
3.866 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
3.867 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
3.868 + </target>
3.869 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
3.870 + <!--
3.871 + =========================
3.872 + JUNIT COMPILATION SECTION
3.873 + =========================
3.874 + -->
3.875 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
3.876 + <mkdir dir="${build.test.classes.dir}"/>
3.877 + </target>
3.878 + <target name="-pre-compile-test">
3.879 + <!-- Empty placeholder for easier customization. -->
3.880 + <!-- You can override this target in the ../build.xml file. -->
3.881 + </target>
3.882 + <target if="do.depend.true" name="-compile-test-depend">
3.883 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
3.884 + </target>
3.885 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
3.886 + <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}"/>
3.887 + <copy todir="${build.test.classes.dir}">
3.888 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.889 + </copy>
3.890 + </target>
3.891 + <target name="-post-compile-test">
3.892 + <!-- Empty placeholder for easier customization. -->
3.893 + <!-- You can override this target in the ../build.xml file. -->
3.894 + </target>
3.895 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
3.896 + <target name="-pre-compile-test-single">
3.897 + <!-- Empty placeholder for easier customization. -->
3.898 + <!-- You can override this target in the ../build.xml file. -->
3.899 + </target>
3.900 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
3.901 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.902 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
3.903 + <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}"/>
3.904 + <copy todir="${build.test.classes.dir}">
3.905 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.906 + </copy>
3.907 + </target>
3.908 + <target name="-post-compile-test-single">
3.909 + <!-- Empty placeholder for easier customization. -->
3.910 + <!-- You can override this target in the ../build.xml file. -->
3.911 + </target>
3.912 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
3.913 + <!--
3.914 + =======================
3.915 + JUNIT EXECUTION SECTION
3.916 + =======================
3.917 + -->
3.918 + <target depends="init" if="have.tests" name="-pre-test-run">
3.919 + <mkdir dir="${build.test.results.dir}"/>
3.920 + </target>
3.921 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
3.922 + <j2seproject3:junit testincludes="**/*Test.java"/>
3.923 + </target>
3.924 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
3.925 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
3.926 + </target>
3.927 + <target depends="init" if="have.tests" name="test-report"/>
3.928 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
3.929 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
3.930 + <target depends="init" if="have.tests" name="-pre-test-run-single">
3.931 + <mkdir dir="${build.test.results.dir}"/>
3.932 + </target>
3.933 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
3.934 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
3.935 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
3.936 + </target>
3.937 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
3.938 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
3.939 + </target>
3.940 + <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"/>
3.941 + <!--
3.942 + =======================
3.943 + JUNIT DEBUGGING SECTION
3.944 + =======================
3.945 + -->
3.946 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
3.947 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
3.948 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
3.949 + <delete file="${test.report.file}"/>
3.950 + <mkdir dir="${build.test.results.dir}"/>
3.951 + <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}">
3.952 + <customize>
3.953 + <syspropertyset>
3.954 + <propertyref prefix="test-sys-prop."/>
3.955 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.956 + </syspropertyset>
3.957 + <arg value="${test.class}"/>
3.958 + <arg value="showoutput=true"/>
3.959 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
3.960 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
3.961 + </customize>
3.962 + </j2seproject3:debug>
3.963 + </target>
3.964 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
3.965 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
3.966 + </target>
3.967 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
3.968 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
3.969 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
3.970 + </target>
3.971 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
3.972 + <!--
3.973 + =========================
3.974 + APPLET EXECUTION SECTION
3.975 + =========================
3.976 + -->
3.977 + <target depends="init,compile-single" name="run-applet">
3.978 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.979 + <j2seproject1:java classname="sun.applet.AppletViewer">
3.980 + <customize>
3.981 + <arg value="${applet.url}"/>
3.982 + </customize>
3.983 + </j2seproject1:java>
3.984 + </target>
3.985 + <!--
3.986 + =========================
3.987 + APPLET DEBUGGING SECTION
3.988 + =========================
3.989 + -->
3.990 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
3.991 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.992 + <j2seproject3:debug classname="sun.applet.AppletViewer">
3.993 + <customize>
3.994 + <arg value="${applet.url}"/>
3.995 + </customize>
3.996 + </j2seproject3:debug>
3.997 + </target>
3.998 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
3.999 + <!--
3.1000 + ===============
3.1001 + CLEANUP SECTION
3.1002 + ===============
3.1003 + -->
3.1004 + <target name="-deps-clean-init" unless="built-clean.properties">
3.1005 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
3.1006 + <delete file="${built-clean.properties}" quiet="true"/>
3.1007 + </target>
3.1008 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
3.1009 + <echo level="warn" message="Cycle detected: alt2xml was already built"/>
3.1010 + </target>
3.1011 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
3.1012 + <mkdir dir="${build.dir}"/>
3.1013 + <touch file="${built-clean.properties}" verbose="false"/>
3.1014 + <property file="${built-clean.properties}" prefix="already.built.clean."/>
3.1015 + <antcall target="-warn-already-built-clean"/>
3.1016 + <propertyfile file="${built-clean.properties}">
3.1017 + <entry key="${basedir}" value=""/>
3.1018 + </propertyfile>
3.1019 + </target>
3.1020 + <target depends="init" name="-do-clean">
3.1021 + <delete dir="${build.dir}"/>
3.1022 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
3.1023 + </target>
3.1024 + <target name="-post-clean">
3.1025 + <!-- Empty placeholder for easier customization. -->
3.1026 + <!-- You can override this target in the ../build.xml file. -->
3.1027 + </target>
3.1028 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
3.1029 + <target name="-check-call-dep">
3.1030 + <property file="${call.built.properties}" prefix="already.built."/>
3.1031 + <condition property="should.call.dep">
3.1032 + <not>
3.1033 + <isset property="already.built.${call.subproject}"/>
3.1034 + </not>
3.1035 + </condition>
3.1036 + </target>
3.1037 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
3.1038 + <ant antfile="${call.script}" inheritall="false" target="${call.target}">
3.1039 + <propertyset>
3.1040 + <propertyref prefix="transfer."/>
3.1041 + <mapper from="transfer.*" to="*" type="glob"/>
3.1042 + </propertyset>
3.1043 + </ant>
3.1044 + </target>
3.1045 +</project>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/java/alt2xml-bin/nbproject/genfiles.properties Thu Jun 05 10:07:34 2014 +0200
4.3 @@ -0,0 +1,11 @@
4.4 +build.xml.data.CRC32=e6d87916
4.5 +build.xml.script.CRC32=98793cfd
4.6 +build.xml.stylesheet.CRC32=8064a381@1.74.2.48
4.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
4.9 +nbproject/build-impl.xml.data.CRC32=31175c28
4.10 +nbproject/build-impl.xml.script.CRC32=aa79723f
4.11 +nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
4.12 +nbproject/groovy-build.xml.data.CRC32=e6d87916
4.13 +nbproject/groovy-build.xml.script.CRC32=66297360
4.14 +nbproject/groovy-build.xml.stylesheet.CRC32=28d0e1f2@1.7.1
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/java/alt2xml-bin/nbproject/project.properties Thu Jun 05 10:07:34 2014 +0200
5.3 @@ -0,0 +1,75 @@
5.4 +annotation.processing.enabled=true
5.5 +annotation.processing.enabled.in.editor=true
5.6 +annotation.processing.processors.list=
5.7 +annotation.processing.run.all.processors=true
5.8 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
5.9 +application.title=alt2xml-bin
5.10 +application.vendor=fiki
5.11 +build.classes.dir=${build.dir}/classes
5.12 +build.classes.excludes=**/*.java,**/*.form,**/*.groovy
5.13 +# This directory is removed when the project is cleaned:
5.14 +build.dir=build
5.15 +build.generated.dir=${build.dir}/generated
5.16 +build.generated.sources.dir=${build.dir}/generated-sources
5.17 +# Only compile against the classpath explicitly listed here:
5.18 +build.sysclasspath=ignore
5.19 +build.test.classes.dir=${build.dir}/test/classes
5.20 +build.test.results.dir=${build.dir}/test/results
5.21 +# Uncomment to specify the preferred debugger connection transport:
5.22 +#debug.transport=dt_socket
5.23 +debug.classpath=\
5.24 + ${run.classpath}
5.25 +debug.test.classpath=\
5.26 + ${run.test.classpath}
5.27 +# This directory is removed when the project is cleaned:
5.28 +dist.dir=dist
5.29 +dist.jar=${dist.dir}/alt2xml-bin.jar
5.30 +dist.javadoc.dir=${dist.dir}/javadoc
5.31 +endorsed.classpath=
5.32 +excludes=
5.33 +includes=**
5.34 +jar.compress=false
5.35 +javac.classpath=\
5.36 + ${libs.json-simple.classpath}
5.37 +# Space-separated list of extra javac options
5.38 +javac.compilerargs=
5.39 +javac.deprecation=false
5.40 +javac.processorpath=\
5.41 + ${javac.classpath}
5.42 +javac.source=1.7
5.43 +javac.target=1.7
5.44 +javac.test.classpath=\
5.45 + ${javac.classpath}:\
5.46 + ${build.classes.dir}
5.47 +javac.test.processorpath=\
5.48 + ${javac.test.classpath}
5.49 +javadoc.additionalparam=
5.50 +javadoc.author=false
5.51 +javadoc.encoding=${source.encoding}
5.52 +javadoc.noindex=false
5.53 +javadoc.nonavbar=false
5.54 +javadoc.notree=false
5.55 +javadoc.private=false
5.56 +javadoc.splitindex=true
5.57 +javadoc.use=true
5.58 +javadoc.version=false
5.59 +javadoc.windowtitle=
5.60 +main.class=cz.frantovo.alt2xml.CLI
5.61 +manifest.file=manifest.mf
5.62 +meta.inf.dir=${src.dir}/META-INF
5.63 +mkdist.disabled=false
5.64 +platform.active=default_platform
5.65 +run.classpath=\
5.66 + ${javac.classpath}:\
5.67 + ${build.classes.dir}
5.68 +# Space-separated list of JVM arguments used when running the project
5.69 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
5.70 +# or test-sys-prop.name=value to set system properties for unit tests):
5.71 +run.jvmargs=
5.72 +run.test.classpath=\
5.73 + ${javac.test.classpath}:\
5.74 + ${build.test.classes.dir}
5.75 +source.encoding=UTF-8
5.76 +src.dir=src
5.77 +test.src.dir=test
5.78 +compile.on.save.unsupported.groovy=true
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/java/alt2xml-bin/nbproject/project.xml Thu Jun 05 10:07:34 2014 +0200
6.3 @@ -0,0 +1,21 @@
6.4 +<?xml version="1.0" encoding="UTF-8"?>
6.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
6.6 + <type>org.netbeans.modules.java.j2seproject</type>
6.7 + <configuration>
6.8 + <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
6.9 + <extension file="groovy-build.xml" id="groovy">
6.10 + <dependency dependsOn="-groovy-init-macrodef-javac" target="-pre-pre-compile"/>
6.11 + </extension>
6.12 + </buildExtensions>
6.13 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
6.14 + <name>alt2xml-bin</name>
6.15 + <source-roots>
6.16 + <root id="src.dir"/>
6.17 + </source-roots>
6.18 + <test-roots>
6.19 + <root id="test.src.dir"/>
6.20 + </test-roots>
6.21 + </data>
6.22 + <references xmlns="http://www.netbeans.org/ns/ant-project-references/1"/>
6.23 + </configuration>
6.24 +</project>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/java/alt2xml-bin/src/cz/frantovo/alt2xml/CLI.java Thu Jun 05 10:07:34 2014 +0200
7.3 @@ -0,0 +1,42 @@
7.4 +package cz.frantovo.alt2xml;
7.5 +
7.6 +import cz.frantovo.alt2xml.výstup.EchoContentHandler;
7.7 +import java.io.InputStream;
7.8 +import java.io.OutputStream;
7.9 +import javax.xml.parsers.SAXParser;
7.10 +import javax.xml.parsers.SAXParserFactory;
7.11 +import javax.xml.stream.XMLOutputFactory;
7.12 +import javax.xml.stream.XMLStreamWriter;
7.13 +import org.xml.sax.helpers.DefaultHandler;
7.14 +
7.15 +/**
7.16 + *
7.17 + * @author fiki
7.18 + */
7.19 +public class CLI {
7.20 +
7.21 + public static void main(String[] args) throws Exception {
7.22 + /**
7.23 + * Použijeme standardní vstup a výstup:
7.24 + */
7.25 + InputStream vstup = System.in;
7.26 + OutputStream výstup = System.out;
7.27 +
7.28 + /**
7.29 + * Serializujeme data do XML.
7.30 + * To normálně vůbec není potřeba – data se do tvaru proudu obsahujícího ostré závorky
7.31 + * vůbec nedostanou – zpracováváme události (volání javovských metod – začátky a konce elementů atd.)
7.32 + * a z nich např. deserializujeme nějaké naše objekty, provádíme nějaké akce, nebo třeba stavíme DOM.
7.33 + */
7.34 + XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newFactory();
7.35 + XMLStreamWriter w = xmlOutputFactory.createXMLStreamWriter(výstup);
7.36 + DefaultHandler h = new EchoContentHandler(w);
7.37 +
7.38 + /**
7.39 + * Parsujeme JSON a děláme z něj XML:
7.40 + */
7.41 + SAXParserFactory t = SAXParserFactory.newInstance(SAXTovarna.class.getName(), null);
7.42 + SAXParser p = t.newSAXParser();
7.43 + p.parse(vstup, h);
7.44 + }
7.45 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/java/alt2xml-bin/src/cz/frantovo/alt2xml/SAXTovarna.java Thu Jun 05 10:07:34 2014 +0200
8.3 @@ -0,0 +1,72 @@
8.4 +package cz.frantovo.alt2xml;
8.5 +
8.6 +import cz.frantovo.alt2xml.vstup.SuperReader;
8.7 +import javax.xml.parsers.ParserConfigurationException;
8.8 +import javax.xml.parsers.SAXParser;
8.9 +import javax.xml.parsers.SAXParserFactory;
8.10 +import org.xml.sax.Parser;
8.11 +import org.xml.sax.SAXException;
8.12 +import org.xml.sax.SAXNotRecognizedException;
8.13 +import org.xml.sax.SAXNotSupportedException;
8.14 +import org.xml.sax.XMLReader;
8.15 +
8.16 +/**
8.17 + *
8.18 + * @author fiki
8.19 + */
8.20 +public class SAXTovarna extends SAXParserFactory {
8.21 +
8.22 + @Override
8.23 + public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
8.24 + return new MůjParser(new SuperReader());
8.25 + }
8.26 +
8.27 + @Override
8.28 + public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
8.29 + throw new SAXNotSupportedException("Zatím není podporováno.");
8.30 + }
8.31 +
8.32 + @Override
8.33 + public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
8.34 + throw new SAXNotSupportedException("Zatím není podporováno.");
8.35 + }
8.36 +
8.37 + private static class MůjParser extends SAXParser {
8.38 +
8.39 + private XMLReader xmlReader;
8.40 +
8.41 + public MůjParser(XMLReader xmlReader) {
8.42 + this.xmlReader = xmlReader;
8.43 + }
8.44 +
8.45 + @Override
8.46 + public Parser getParser() throws SAXException {
8.47 + throw new SAXException("Není podporováno.");
8.48 + }
8.49 +
8.50 + @Override
8.51 + public XMLReader getXMLReader() throws SAXException {
8.52 + return xmlReader;
8.53 + }
8.54 +
8.55 + @Override
8.56 + public boolean isNamespaceAware() {
8.57 + return false;
8.58 + }
8.59 +
8.60 + @Override
8.61 + public boolean isValidating() {
8.62 + return false;
8.63 + }
8.64 +
8.65 + @Override
8.66 + public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
8.67 + xmlReader.setProperty(name, value);
8.68 + }
8.69 +
8.70 + @Override
8.71 + public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
8.72 + return xmlReader.getProperty(name);
8.73 + }
8.74 + }
8.75 +}
8.76 \ No newline at end of file
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/java/alt2xml-bin/src/cz/frantovo/alt2xml/vstup/JsonSimpleContentHandler.java Thu Jun 05 10:07:34 2014 +0200
9.3 @@ -0,0 +1,135 @@
9.4 +package cz.frantovo.alt2xml.vstup;
9.5 +
9.6 +import java.io.IOException;
9.7 +import java.util.Stack;
9.8 +import org.json.simple.parser.ParseException;
9.9 +import org.xml.sax.ContentHandler;
9.10 +import org.xml.sax.SAXException;
9.11 +
9.12 +/**
9.13 + *
9.14 + * @author fiki
9.15 + */
9.16 +public class JsonSimpleContentHandler implements org.json.simple.parser.ContentHandler {
9.17 +
9.18 + /** Sem vypisujeme XML události */
9.19 + private ContentHandler saxVýstup;
9.20 + /** Musíme si pamatovat polohu v XML stromu, abychom věděli, kterou značku kdy uzavřít */
9.21 + private Stack<String> poloha = new Stack<>();
9.22 + /**
9.23 + * Po textových uzlech vkládáme konce elementů rovnou,
9.24 + * ale pokud jeden element končí hned po jiném,
9.25 + * vložíme mezi ně ještě konec řádku a odsazení.
9.26 + */
9.27 + private boolean zalomitŘádek = false;
9.28 +
9.29 + public JsonSimpleContentHandler(ContentHandler saxVýstup) {
9.30 + this.saxVýstup = saxVýstup;
9.31 + }
9.32 +
9.33 + private void začniElement(String název) throws IOException {
9.34 + try {
9.35 + vložOdsazení();
9.36 + saxVýstup.startElement(null, null, název, null);
9.37 + poloha.push(název);
9.38 + } catch (SAXException e) {
9.39 + throw new IOException("Chyba při začátku elementu.", e);
9.40 + }
9.41 + }
9.42 +
9.43 + private void ukončiElement() throws IOException {
9.44 + try {
9.45 + String značka = poloha.pop();
9.46 + if (zalomitŘádek) {
9.47 + vložOdsazení();
9.48 + }
9.49 + zalomitŘádek = true;
9.50 + saxVýstup.endElement(null, null, značka);
9.51 + } catch (SAXException e) {
9.52 + throw new IOException("Chyba při ukončování elementu.", e);
9.53 + }
9.54 + }
9.55 +
9.56 + private void vložOdsazení() throws IOException {
9.57 + /**
9.58 + * TODO: ignorableWhitespace() ?
9.59 + */
9.60 + vložText("\n");
9.61 + for (int i = 0; i < poloha.size(); i++) {
9.62 + vložText("\t");
9.63 + }
9.64 + }
9.65 +
9.66 + private void vložText(String text) throws IOException {
9.67 + try {
9.68 + saxVýstup.characters(text.toCharArray(), 0, text.length());
9.69 + } catch (SAXException e) {
9.70 + throw new IOException("Chyba při vkládání textu.", e);
9.71 + }
9.72 + }
9.73 +
9.74 + @Override
9.75 + public void startJSON() throws ParseException, IOException {
9.76 + try {
9.77 + saxVýstup.startDocument();
9.78 + začniElement("objekt");
9.79 + } catch (SAXException e) {
9.80 + throw new IOException("Chyba při začátku dokumentu.", e);
9.81 + }
9.82 + }
9.83 +
9.84 + @Override
9.85 + public void endJSON() throws ParseException, IOException {
9.86 + try {
9.87 + ukončiElement();
9.88 + vložText("\n");
9.89 + saxVýstup.endDocument();
9.90 + } catch (SAXException e) {
9.91 + throw new IOException(e);
9.92 + }
9.93 + }
9.94 +
9.95 + @Override
9.96 + public boolean startObject() throws ParseException, IOException {
9.97 + // System.err.println("startObject");
9.98 + return true;
9.99 + }
9.100 +
9.101 + @Override
9.102 + public boolean endObject() throws ParseException, IOException {
9.103 + // System.err.println("endObject");
9.104 + return true;
9.105 + }
9.106 +
9.107 + @Override
9.108 + public boolean startObjectEntry(String key) throws ParseException, IOException {
9.109 + začniElement(key);
9.110 + return true;
9.111 + }
9.112 +
9.113 + @Override
9.114 + public boolean endObjectEntry() throws ParseException, IOException {
9.115 + ukončiElement();
9.116 + // System.err.println("endObjectEntry");
9.117 + return true;
9.118 + }
9.119 +
9.120 + @Override
9.121 + public boolean startArray() throws ParseException, IOException {
9.122 + // System.err.println("startArray");
9.123 + return true;
9.124 + }
9.125 +
9.126 + @Override
9.127 + public boolean endArray() throws ParseException, IOException {
9.128 + // System.err.println("endArray");
9.129 + return true;
9.130 + }
9.131 +
9.132 + @Override
9.133 + public boolean primitive(Object value) throws ParseException, IOException {
9.134 + vložText(String.valueOf(value));
9.135 + zalomitŘádek = false;
9.136 + return true;
9.137 + }
9.138 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/java/alt2xml-bin/src/cz/frantovo/alt2xml/vstup/SuperReader.java Thu Jun 05 10:07:34 2014 +0200
10.3 @@ -0,0 +1,117 @@
10.4 +package cz.frantovo.alt2xml.vstup;
10.5 +
10.6 +import java.io.IOException;
10.7 +import java.io.InputStreamReader;
10.8 +import java.util.HashMap;
10.9 +import java.util.Map;
10.10 +import org.json.simple.parser.JSONParser;
10.11 +import org.json.simple.parser.ParseException;
10.12 +import org.xml.sax.ContentHandler;
10.13 +import org.xml.sax.DTDHandler;
10.14 +import org.xml.sax.EntityResolver;
10.15 +import org.xml.sax.ErrorHandler;
10.16 +import org.xml.sax.InputSource;
10.17 +import org.xml.sax.SAXException;
10.18 +import org.xml.sax.SAXNotRecognizedException;
10.19 +import org.xml.sax.SAXNotSupportedException;
10.20 +import org.xml.sax.XMLReader;
10.21 +
10.22 +/**
10.23 + *
10.24 + * @author fiki
10.25 + */
10.26 +public class SuperReader implements XMLReader {
10.27 +
10.28 + private ContentHandler contentHandler;
10.29 + private ErrorHandler errorHandler;
10.30 + private DTDHandler dtdHandler;
10.31 + private EntityResolver entityResolver;
10.32 + private Map<String, Object> konfigurace = new HashMap<>();
10.33 +
10.34 + @Override
10.35 + public void parse(InputSource input) throws IOException, SAXException {
10.36 + /**
10.37 + * TODO: rozpornat formát vstupu a podle toho delegovat
10.38 + */
10.39 + JSONParser p = new JSONParser();
10.40 + InputStreamReader vstup = new InputStreamReader(input.getByteStream());
10.41 + JsonSimpleContentHandler handler = new JsonSimpleContentHandler(contentHandler);
10.42 +
10.43 + try {
10.44 + p.parse(vstup, handler);
10.45 + } catch (ParseException e) {
10.46 + throw new SAXException("Chyba při načítání JSONu", e);
10.47 + }
10.48 + }
10.49 +
10.50 + @Override
10.51 + public void parse(String systemId) throws IOException, SAXException {
10.52 + parse(new InputSource(systemId));
10.53 + }
10.54 +
10.55 + @Override
10.56 + public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
10.57 + /**
10.58 + * TODO:
10.59 + * All XMLReaders are required to recognize
10.60 + * the http://xml.org/sax/features/namespaces
10.61 + * and the http://xml.org/sax/features/namespace-prefixes feature names.
10.62 + */
10.63 + throw new SAXNotSupportedException("Zatím není podporováno.");
10.64 + }
10.65 +
10.66 + @Override
10.67 + public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
10.68 + throw new SAXNotSupportedException("Zatím není podporováno.");
10.69 + }
10.70 +
10.71 + @Override
10.72 + public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
10.73 + return konfigurace.get(name);
10.74 + }
10.75 +
10.76 + @Override
10.77 + public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
10.78 + konfigurace.put(name, value);
10.79 + }
10.80 +
10.81 + @Override
10.82 + public void setEntityResolver(EntityResolver entityResolver) {
10.83 + this.entityResolver = entityResolver;
10.84 + }
10.85 +
10.86 + @Override
10.87 + public EntityResolver getEntityResolver() {
10.88 + return entityResolver;
10.89 + }
10.90 +
10.91 + @Override
10.92 + public void setDTDHandler(DTDHandler dtdHandler) {
10.93 + this.dtdHandler = dtdHandler;
10.94 + }
10.95 +
10.96 + @Override
10.97 + public DTDHandler getDTDHandler() {
10.98 + return dtdHandler;
10.99 + }
10.100 +
10.101 + @Override
10.102 + public void setContentHandler(ContentHandler contentHandler) {
10.103 + this.contentHandler = contentHandler;
10.104 + }
10.105 +
10.106 + @Override
10.107 + public ContentHandler getContentHandler() {
10.108 + return contentHandler;
10.109 + }
10.110 +
10.111 + @Override
10.112 + public void setErrorHandler(ErrorHandler errorHandler) {
10.113 + this.errorHandler = errorHandler;
10.114 + }
10.115 +
10.116 + @Override
10.117 + public ErrorHandler getErrorHandler() {
10.118 + return errorHandler;
10.119 + }
10.120 +}
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/java/alt2xml-bin/src/cz/frantovo/alt2xml/výstup/EchoContentHandler.java Thu Jun 05 10:07:34 2014 +0200
11.3 @@ -0,0 +1,83 @@
11.4 +package cz.frantovo.alt2xml.výstup;
11.5 +
11.6 +import javax.xml.stream.XMLStreamException;
11.7 +import javax.xml.stream.XMLStreamWriter;
11.8 +import org.xml.sax.Attributes;
11.9 +import org.xml.sax.SAXException;
11.10 +import org.xml.sax.helpers.DefaultHandler;
11.11 +
11.12 +/**
11.13 + * Slouží k převodu právě parsovaného XML zpět na XML.
11.14 + * Určen pro testování a ladění a pro použití s neobvyklými „XML“ parsery,
11.15 + * které nečtou XML ale jiný jazyk (např. JSON, INI atd.), ale používají stejné rozhraní (SAX).
11.16 + *
11.17 + * TODO: další typy uzlů a jmenné prostory.
11.18 + * @author fiki
11.19 + */
11.20 +public class EchoContentHandler extends DefaultHandler {
11.21 +
11.22 + private XMLStreamWriter w;
11.23 +
11.24 + /**
11.25 + * @param writer kam se bude vypisovat XML.
11.26 + */
11.27 + public EchoContentHandler(XMLStreamWriter writer) {
11.28 + w = writer;
11.29 + }
11.30 +
11.31 + @Override
11.32 + public void startDocument() throws SAXException {
11.33 + try {
11.34 + w.writeStartDocument();
11.35 + } catch (XMLStreamException e) {
11.36 + throw new SAXException(e);
11.37 + }
11.38 + }
11.39 +
11.40 + @Override
11.41 + public void endDocument() throws SAXException {
11.42 + try {
11.43 + w.writeEndDocument();
11.44 + w.close();
11.45 + } catch (XMLStreamException e) {
11.46 + throw new SAXException(e);
11.47 + }
11.48 + }
11.49 +
11.50 + @Override
11.51 + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
11.52 + try {
11.53 + w.writeStartElement(qName);
11.54 +
11.55 + if (attributes != null) {
11.56 + for (int i = 0; i < attributes.getLength(); i++) {
11.57 + w.writeAttribute(attributes.getQName(i), attributes.getValue(i));
11.58 + }
11.59 + }
11.60 +
11.61 + w.flush();
11.62 + } catch (XMLStreamException e) {
11.63 + throw new SAXException(e);
11.64 + }
11.65 + }
11.66 +
11.67 + @Override
11.68 + public void endElement(String uri, String localName, String qName) throws SAXException {
11.69 + try {
11.70 + w.writeEndElement();
11.71 + w.flush();
11.72 + } catch (XMLStreamException e) {
11.73 + throw new SAXException(e);
11.74 + }
11.75 + }
11.76 +
11.77 + @Override
11.78 + public void characters(char[] ch, int start, int length) throws SAXException {
11.79 + try {
11.80 + w.writeCharacters(ch, start, length);
11.81 + w.flush();
11.82 + } catch (XMLStreamException e) {
11.83 + throw new SAXException(e);
11.84 + }
11.85 + }
11.86 +}
12.1 --- a/java/alt2xml/manifest.mf Tue Jan 03 14:47:22 2012 +0100
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,3 +0,0 @@
12.4 -Manifest-Version: 1.0
12.5 -X-COMMENT: Main-Class will be added automatically by build
12.6 -
13.1 --- a/java/alt2xml/nbproject/build-impl.xml Tue Jan 03 14:47:22 2012 +0100
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,1042 +0,0 @@
13.4 -<?xml version="1.0" encoding="UTF-8"?>
13.5 -<!--
13.6 -*** GENERATED FROM project.xml - DO NOT EDIT ***
13.7 -*** EDIT ../build.xml INSTEAD ***
13.8 -
13.9 -For the purpose of easier reading the script
13.10 -is divided into following sections:
13.11 -
13.12 - - initialization
13.13 - - compilation
13.14 - - jar
13.15 - - execution
13.16 - - debugging
13.17 - - javadoc
13.18 - - junit compilation
13.19 - - junit execution
13.20 - - junit debugging
13.21 - - applet
13.22 - - cleanup
13.23 -
13.24 - -->
13.25 -<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="alt2xml-impl">
13.26 - <fail message="Please build using Ant 1.7.1 or higher.">
13.27 - <condition>
13.28 - <not>
13.29 - <antversion atleast="1.7.1"/>
13.30 - </not>
13.31 - </condition>
13.32 - </fail>
13.33 - <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
13.34 - <!--
13.35 - ======================
13.36 - INITIALIZATION SECTION
13.37 - ======================
13.38 - -->
13.39 - <target name="-pre-init">
13.40 - <!-- Empty placeholder for easier customization. -->
13.41 - <!-- You can override this target in the ../build.xml file. -->
13.42 - </target>
13.43 - <target depends="-pre-init" name="-init-private">
13.44 - <property file="nbproject/private/config.properties"/>
13.45 - <property file="nbproject/private/configs/${config}.properties"/>
13.46 - <property file="nbproject/private/private.properties"/>
13.47 - </target>
13.48 - <target depends="-pre-init,-init-private" name="-init-user">
13.49 - <property file="${user.properties.file}"/>
13.50 - <!-- The two properties below are usually overridden -->
13.51 - <!-- by the active platform. Just a fallback. -->
13.52 - <property name="default.javac.source" value="1.4"/>
13.53 - <property name="default.javac.target" value="1.4"/>
13.54 - </target>
13.55 - <target depends="-pre-init,-init-private,-init-user" name="-init-project">
13.56 - <property file="nbproject/configs/${config}.properties"/>
13.57 - <property file="nbproject/project.properties"/>
13.58 - </target>
13.59 - <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
13.60 - <available file="${manifest.file}" property="manifest.available"/>
13.61 - <condition property="splashscreen.available">
13.62 - <and>
13.63 - <not>
13.64 - <equals arg1="${application.splash}" arg2="" trim="true"/>
13.65 - </not>
13.66 - <available file="${application.splash}"/>
13.67 - </and>
13.68 - </condition>
13.69 - <condition property="main.class.available">
13.70 - <and>
13.71 - <isset property="main.class"/>
13.72 - <not>
13.73 - <equals arg1="${main.class}" arg2="" trim="true"/>
13.74 - </not>
13.75 - </and>
13.76 - </condition>
13.77 - <condition property="manifest.available+main.class">
13.78 - <and>
13.79 - <isset property="manifest.available"/>
13.80 - <isset property="main.class.available"/>
13.81 - </and>
13.82 - </condition>
13.83 - <condition property="do.archive">
13.84 - <not>
13.85 - <istrue value="${jar.archive.disabled}"/>
13.86 - </not>
13.87 - </condition>
13.88 - <condition property="do.mkdist">
13.89 - <and>
13.90 - <isset property="do.archive"/>
13.91 - <isset property="libs.CopyLibs.classpath"/>
13.92 - <not>
13.93 - <istrue value="${mkdist.disabled}"/>
13.94 - </not>
13.95 - </and>
13.96 - </condition>
13.97 - <condition property="manifest.available+main.class+mkdist.available">
13.98 - <and>
13.99 - <istrue value="${manifest.available+main.class}"/>
13.100 - <isset property="do.mkdist"/>
13.101 - </and>
13.102 - </condition>
13.103 - <condition property="do.archive+manifest.available">
13.104 - <and>
13.105 - <isset property="manifest.available"/>
13.106 - <istrue value="${do.archive}"/>
13.107 - </and>
13.108 - </condition>
13.109 - <condition property="do.archive+main.class.available">
13.110 - <and>
13.111 - <isset property="main.class.available"/>
13.112 - <istrue value="${do.archive}"/>
13.113 - </and>
13.114 - </condition>
13.115 - <condition property="do.archive+splashscreen.available">
13.116 - <and>
13.117 - <isset property="splashscreen.available"/>
13.118 - <istrue value="${do.archive}"/>
13.119 - </and>
13.120 - </condition>
13.121 - <condition property="do.archive+manifest.available+main.class">
13.122 - <and>
13.123 - <istrue value="${manifest.available+main.class}"/>
13.124 - <istrue value="${do.archive}"/>
13.125 - </and>
13.126 - </condition>
13.127 - <condition property="manifest.available-mkdist.available">
13.128 - <or>
13.129 - <istrue value="${manifest.available}"/>
13.130 - <isset property="do.mkdist"/>
13.131 - </or>
13.132 - </condition>
13.133 - <condition property="manifest.available+main.class-mkdist.available">
13.134 - <or>
13.135 - <istrue value="${manifest.available+main.class}"/>
13.136 - <isset property="do.mkdist"/>
13.137 - </or>
13.138 - </condition>
13.139 - <condition property="have.tests">
13.140 - <or>
13.141 - <available file="${test.src.dir}"/>
13.142 - </or>
13.143 - </condition>
13.144 - <condition property="have.sources">
13.145 - <or>
13.146 - <available file="${src.dir}"/>
13.147 - </or>
13.148 - </condition>
13.149 - <condition property="netbeans.home+have.tests">
13.150 - <and>
13.151 - <isset property="netbeans.home"/>
13.152 - <isset property="have.tests"/>
13.153 - </and>
13.154 - </condition>
13.155 - <condition property="no.javadoc.preview">
13.156 - <and>
13.157 - <isset property="javadoc.preview"/>
13.158 - <isfalse value="${javadoc.preview}"/>
13.159 - </and>
13.160 - </condition>
13.161 - <property name="run.jvmargs" value=""/>
13.162 - <property name="javac.compilerargs" value=""/>
13.163 - <property name="work.dir" value="${basedir}"/>
13.164 - <condition property="no.deps">
13.165 - <and>
13.166 - <istrue value="${no.dependencies}"/>
13.167 - </and>
13.168 - </condition>
13.169 - <property name="javac.debug" value="true"/>
13.170 - <property name="javadoc.preview" value="true"/>
13.171 - <property name="application.args" value=""/>
13.172 - <property name="source.encoding" value="${file.encoding}"/>
13.173 - <property name="runtime.encoding" value="${source.encoding}"/>
13.174 - <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
13.175 - <and>
13.176 - <isset property="javadoc.encoding"/>
13.177 - <not>
13.178 - <equals arg1="${javadoc.encoding}" arg2=""/>
13.179 - </not>
13.180 - </and>
13.181 - </condition>
13.182 - <property name="javadoc.encoding.used" value="${source.encoding}"/>
13.183 - <property name="includes" value="**"/>
13.184 - <property name="excludes" value=""/>
13.185 - <property name="do.depend" value="false"/>
13.186 - <condition property="do.depend.true">
13.187 - <istrue value="${do.depend}"/>
13.188 - </condition>
13.189 - <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
13.190 - <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
13.191 - <length length="0" string="${endorsed.classpath}" when="greater"/>
13.192 - </condition>
13.193 - <condition else="false" property="jdkBug6558476">
13.194 - <and>
13.195 - <matches pattern="1\.[56]" string="${java.specification.version}"/>
13.196 - <not>
13.197 - <os family="unix"/>
13.198 - </not>
13.199 - </and>
13.200 - </condition>
13.201 - <property name="javac.fork" value="${jdkBug6558476}"/>
13.202 - <property name="jar.index" value="false"/>
13.203 - <property name="jar.index.metainf" value="${jar.index}"/>
13.204 - <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
13.205 - </target>
13.206 - <target name="-post-init">
13.207 - <!-- Empty placeholder for easier customization. -->
13.208 - <!-- You can override this target in the ../build.xml file. -->
13.209 - </target>
13.210 - <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
13.211 - <fail unless="src.dir">Must set src.dir</fail>
13.212 - <fail unless="test.src.dir">Must set test.src.dir</fail>
13.213 - <fail unless="build.dir">Must set build.dir</fail>
13.214 - <fail unless="dist.dir">Must set dist.dir</fail>
13.215 - <fail unless="build.classes.dir">Must set build.classes.dir</fail>
13.216 - <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
13.217 - <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
13.218 - <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
13.219 - <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
13.220 - <fail unless="dist.jar">Must set dist.jar</fail>
13.221 - </target>
13.222 - <target name="-init-macrodef-property">
13.223 - <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
13.224 - <attribute name="name"/>
13.225 - <attribute name="value"/>
13.226 - <sequential>
13.227 - <property name="@{name}" value="${@{value}}"/>
13.228 - </sequential>
13.229 - </macrodef>
13.230 - </target>
13.231 - <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
13.232 - <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
13.233 - <attribute default="${src.dir}" name="srcdir"/>
13.234 - <attribute default="${build.classes.dir}" name="destdir"/>
13.235 - <attribute default="${javac.classpath}" name="classpath"/>
13.236 - <attribute default="${javac.processorpath}" name="processorpath"/>
13.237 - <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
13.238 - <attribute default="${includes}" name="includes"/>
13.239 - <attribute default="${excludes}" name="excludes"/>
13.240 - <attribute default="${javac.debug}" name="debug"/>
13.241 - <attribute default="${empty.dir}" name="sourcepath"/>
13.242 - <attribute default="${empty.dir}" name="gensrcdir"/>
13.243 - <element name="customize" optional="true"/>
13.244 - <sequential>
13.245 - <property location="${build.dir}/empty" name="empty.dir"/>
13.246 - <mkdir dir="${empty.dir}"/>
13.247 - <mkdir dir="@{apgeneratedsrcdir}"/>
13.248 - <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}">
13.249 - <src>
13.250 - <dirset dir="@{gensrcdir}" erroronmissingdir="false">
13.251 - <include name="*"/>
13.252 - </dirset>
13.253 - </src>
13.254 - <classpath>
13.255 - <path path="@{classpath}"/>
13.256 - </classpath>
13.257 - <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
13.258 - <compilerarg line="${javac.compilerargs}"/>
13.259 - <compilerarg value="-processorpath"/>
13.260 - <compilerarg path="@{processorpath}:${empty.dir}"/>
13.261 - <compilerarg line="${ap.processors.internal}"/>
13.262 - <compilerarg line="${annotation.processing.processor.options}"/>
13.263 - <compilerarg value="-s"/>
13.264 - <compilerarg path="@{apgeneratedsrcdir}"/>
13.265 - <compilerarg line="${ap.proc.none.internal}"/>
13.266 - <customize/>
13.267 - </javac>
13.268 - </sequential>
13.269 - </macrodef>
13.270 - </target>
13.271 - <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
13.272 - <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
13.273 - <attribute default="${src.dir}" name="srcdir"/>
13.274 - <attribute default="${build.classes.dir}" name="destdir"/>
13.275 - <attribute default="${javac.classpath}" name="classpath"/>
13.276 - <attribute default="${javac.processorpath}" name="processorpath"/>
13.277 - <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
13.278 - <attribute default="${includes}" name="includes"/>
13.279 - <attribute default="${excludes}" name="excludes"/>
13.280 - <attribute default="${javac.debug}" name="debug"/>
13.281 - <attribute default="${empty.dir}" name="sourcepath"/>
13.282 - <attribute default="${empty.dir}" name="gensrcdir"/>
13.283 - <element name="customize" optional="true"/>
13.284 - <sequential>
13.285 - <property location="${build.dir}/empty" name="empty.dir"/>
13.286 - <mkdir dir="${empty.dir}"/>
13.287 - <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}">
13.288 - <src>
13.289 - <dirset dir="@{gensrcdir}" erroronmissingdir="false">
13.290 - <include name="*"/>
13.291 - </dirset>
13.292 - </src>
13.293 - <classpath>
13.294 - <path path="@{classpath}"/>
13.295 - </classpath>
13.296 - <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
13.297 - <compilerarg line="${javac.compilerargs}"/>
13.298 - <customize/>
13.299 - </javac>
13.300 - </sequential>
13.301 - </macrodef>
13.302 - </target>
13.303 - <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
13.304 - <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
13.305 - <attribute default="${src.dir}" name="srcdir"/>
13.306 - <attribute default="${build.classes.dir}" name="destdir"/>
13.307 - <attribute default="${javac.classpath}" name="classpath"/>
13.308 - <sequential>
13.309 - <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
13.310 - <classpath>
13.311 - <path path="@{classpath}"/>
13.312 - </classpath>
13.313 - </depend>
13.314 - </sequential>
13.315 - </macrodef>
13.316 - <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
13.317 - <attribute default="${build.classes.dir}" name="destdir"/>
13.318 - <sequential>
13.319 - <fail unless="javac.includes">Must set javac.includes</fail>
13.320 - <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
13.321 - <path>
13.322 - <filelist dir="@{destdir}" files="${javac.includes}"/>
13.323 - </path>
13.324 - <globmapper from="*.java" to="*.class"/>
13.325 - </pathconvert>
13.326 - <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
13.327 - <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
13.328 - <delete>
13.329 - <files includesfile="${javac.includesfile.binary}"/>
13.330 - </delete>
13.331 - <delete>
13.332 - <fileset file="${javac.includesfile.binary}"/>
13.333 - </delete>
13.334 - </sequential>
13.335 - </macrodef>
13.336 - </target>
13.337 - <target name="-init-macrodef-junit">
13.338 - <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
13.339 - <attribute default="${includes}" name="includes"/>
13.340 - <attribute default="${excludes}" name="excludes"/>
13.341 - <attribute default="**" name="testincludes"/>
13.342 - <sequential>
13.343 - <property name="junit.forkmode" value="perTest"/>
13.344 - <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
13.345 - <batchtest todir="${build.test.results.dir}">
13.346 - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
13.347 - <filename name="@{testincludes}"/>
13.348 - </fileset>
13.349 - </batchtest>
13.350 - <classpath>
13.351 - <path path="${run.test.classpath}"/>
13.352 - </classpath>
13.353 - <syspropertyset>
13.354 - <propertyref prefix="test-sys-prop."/>
13.355 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
13.356 - </syspropertyset>
13.357 - <formatter type="brief" usefile="false"/>
13.358 - <formatter type="xml"/>
13.359 - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
13.360 - <jvmarg value="-ea"/>
13.361 - <jvmarg line="${run.jvmargs}"/>
13.362 - </junit>
13.363 - </sequential>
13.364 - </macrodef>
13.365 - </target>
13.366 - <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
13.367 - <target name="-profile-pre-init">
13.368 - <!-- Empty placeholder for easier customization. -->
13.369 - <!-- You can override this target in the ../build.xml file. -->
13.370 - </target>
13.371 - <target name="-profile-post-init">
13.372 - <!-- Empty placeholder for easier customization. -->
13.373 - <!-- You can override this target in the ../build.xml file. -->
13.374 - </target>
13.375 - <target name="-profile-init-macrodef-profile">
13.376 - <macrodef name="resolve">
13.377 - <attribute name="name"/>
13.378 - <attribute name="value"/>
13.379 - <sequential>
13.380 - <property name="@{name}" value="${env.@{value}}"/>
13.381 - </sequential>
13.382 - </macrodef>
13.383 - <macrodef name="profile">
13.384 - <attribute default="${main.class}" name="classname"/>
13.385 - <element name="customize" optional="true"/>
13.386 - <sequential>
13.387 - <property environment="env"/>
13.388 - <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
13.389 - <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
13.390 - <jvmarg value="${profiler.info.jvmargs.agent}"/>
13.391 - <jvmarg line="${profiler.info.jvmargs}"/>
13.392 - <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
13.393 - <arg line="${application.args}"/>
13.394 - <classpath>
13.395 - <path path="${run.classpath}"/>
13.396 - </classpath>
13.397 - <syspropertyset>
13.398 - <propertyref prefix="run-sys-prop."/>
13.399 - <mapper from="run-sys-prop.*" to="*" type="glob"/>
13.400 - </syspropertyset>
13.401 - <customize/>
13.402 - </java>
13.403 - </sequential>
13.404 - </macrodef>
13.405 - </target>
13.406 - <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
13.407 - <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
13.408 - <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
13.409 - </target>
13.410 - <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
13.411 - <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
13.412 - <attribute default="${main.class}" name="name"/>
13.413 - <attribute default="${debug.classpath}" name="classpath"/>
13.414 - <attribute default="" name="stopclassname"/>
13.415 - <sequential>
13.416 - <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
13.417 - <classpath>
13.418 - <path path="@{classpath}"/>
13.419 - </classpath>
13.420 - </nbjpdastart>
13.421 - </sequential>
13.422 - </macrodef>
13.423 - <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
13.424 - <attribute default="${build.classes.dir}" name="dir"/>
13.425 - <sequential>
13.426 - <nbjpdareload>
13.427 - <fileset dir="@{dir}" includes="${fix.classes}">
13.428 - <include name="${fix.includes}*.class"/>
13.429 - </fileset>
13.430 - </nbjpdareload>
13.431 - </sequential>
13.432 - </macrodef>
13.433 - </target>
13.434 - <target name="-init-debug-args">
13.435 - <property name="version-output" value="java version "${ant.java.version}"/>
13.436 - <condition property="have-jdk-older-than-1.4">
13.437 - <or>
13.438 - <contains string="${version-output}" substring="java version "1.0"/>
13.439 - <contains string="${version-output}" substring="java version "1.1"/>
13.440 - <contains string="${version-output}" substring="java version "1.2"/>
13.441 - <contains string="${version-output}" substring="java version "1.3"/>
13.442 - </or>
13.443 - </condition>
13.444 - <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
13.445 - <istrue value="${have-jdk-older-than-1.4}"/>
13.446 - </condition>
13.447 - <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
13.448 - <os family="windows"/>
13.449 - </condition>
13.450 - <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
13.451 - <isset property="debug.transport"/>
13.452 - </condition>
13.453 - </target>
13.454 - <target depends="-init-debug-args" name="-init-macrodef-debug">
13.455 - <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
13.456 - <attribute default="${main.class}" name="classname"/>
13.457 - <attribute default="${debug.classpath}" name="classpath"/>
13.458 - <element name="customize" optional="true"/>
13.459 - <sequential>
13.460 - <java classname="@{classname}" dir="${work.dir}" fork="true">
13.461 - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
13.462 - <jvmarg line="${debug-args-line}"/>
13.463 - <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
13.464 - <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
13.465 - <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
13.466 - <jvmarg line="${run.jvmargs}"/>
13.467 - <classpath>
13.468 - <path path="@{classpath}"/>
13.469 - </classpath>
13.470 - <syspropertyset>
13.471 - <propertyref prefix="run-sys-prop."/>
13.472 - <mapper from="run-sys-prop.*" to="*" type="glob"/>
13.473 - </syspropertyset>
13.474 - <customize/>
13.475 - </java>
13.476 - </sequential>
13.477 - </macrodef>
13.478 - </target>
13.479 - <target name="-init-macrodef-java">
13.480 - <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
13.481 - <attribute default="${main.class}" name="classname"/>
13.482 - <attribute default="${run.classpath}" name="classpath"/>
13.483 - <element name="customize" optional="true"/>
13.484 - <sequential>
13.485 - <java classname="@{classname}" dir="${work.dir}" fork="true">
13.486 - <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
13.487 - <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
13.488 - <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
13.489 - <jvmarg line="${run.jvmargs}"/>
13.490 - <classpath>
13.491 - <path path="@{classpath}"/>
13.492 - </classpath>
13.493 - <syspropertyset>
13.494 - <propertyref prefix="run-sys-prop."/>
13.495 - <mapper from="run-sys-prop.*" to="*" type="glob"/>
13.496 - </syspropertyset>
13.497 - <customize/>
13.498 - </java>
13.499 - </sequential>
13.500 - </macrodef>
13.501 - </target>
13.502 - <target name="-init-macrodef-copylibs">
13.503 - <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
13.504 - <attribute default="${manifest.file}" name="manifest"/>
13.505 - <element name="customize" optional="true"/>
13.506 - <sequential>
13.507 - <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
13.508 - <pathconvert property="run.classpath.without.build.classes.dir">
13.509 - <path path="${run.classpath}"/>
13.510 - <map from="${build.classes.dir.resolved}" to=""/>
13.511 - </pathconvert>
13.512 - <pathconvert pathsep=" " property="jar.classpath">
13.513 - <path path="${run.classpath.without.build.classes.dir}"/>
13.514 - <chainedmapper>
13.515 - <flattenmapper/>
13.516 - <globmapper from="*" to="lib/*"/>
13.517 - </chainedmapper>
13.518 - </pathconvert>
13.519 - <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
13.520 - <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
13.521 - <fileset dir="${build.classes.dir}"/>
13.522 - <manifest>
13.523 - <attribute name="Class-Path" value="${jar.classpath}"/>
13.524 - <customize/>
13.525 - </manifest>
13.526 - </copylibs>
13.527 - </sequential>
13.528 - </macrodef>
13.529 - </target>
13.530 - <target name="-init-presetdef-jar">
13.531 - <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
13.532 - <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
13.533 - <j2seproject1:fileset dir="${build.classes.dir}"/>
13.534 - </jar>
13.535 - </presetdef>
13.536 - </target>
13.537 - <target name="-init-ap-cmdline-properties">
13.538 - <property name="annotation.processing.enabled" value="true"/>
13.539 - <property name="annotation.processing.processors.list" value=""/>
13.540 - <property name="annotation.processing.processor.options" value=""/>
13.541 - <property name="annotation.processing.run.all.processors" value="true"/>
13.542 - <property name="javac.processorpath" value="${javac.classpath}"/>
13.543 - <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
13.544 - <condition property="ap.supported.internal" value="true">
13.545 - <not>
13.546 - <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
13.547 - </not>
13.548 - </condition>
13.549 - </target>
13.550 - <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
13.551 - <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
13.552 - <isfalse value="${annotation.processing.run.all.processors}"/>
13.553 - </condition>
13.554 - <condition else="" property="ap.proc.none.internal" value="-proc:none">
13.555 - <isfalse value="${annotation.processing.enabled}"/>
13.556 - </condition>
13.557 - </target>
13.558 - <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
13.559 - <property name="ap.cmd.line.internal" value=""/>
13.560 - </target>
13.561 - <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"/>
13.562 - <!--
13.563 - ===================
13.564 - COMPILATION SECTION
13.565 - ===================
13.566 - -->
13.567 - <target name="-deps-jar-init" unless="built-jar.properties">
13.568 - <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
13.569 - <delete file="${built-jar.properties}" quiet="true"/>
13.570 - </target>
13.571 - <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
13.572 - <echo level="warn" message="Cycle detected: alt2xml was already built"/>
13.573 - </target>
13.574 - <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
13.575 - <mkdir dir="${build.dir}"/>
13.576 - <touch file="${built-jar.properties}" verbose="false"/>
13.577 - <property file="${built-jar.properties}" prefix="already.built.jar."/>
13.578 - <antcall target="-warn-already-built-jar"/>
13.579 - <propertyfile file="${built-jar.properties}">
13.580 - <entry key="${basedir}" value=""/>
13.581 - </propertyfile>
13.582 - </target>
13.583 - <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
13.584 - <target depends="init" name="-check-automatic-build">
13.585 - <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
13.586 - </target>
13.587 - <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
13.588 - <antcall target="clean"/>
13.589 - </target>
13.590 - <target depends="init,deps-jar" name="-pre-pre-compile">
13.591 - <mkdir dir="${build.classes.dir}"/>
13.592 - </target>
13.593 - <target name="-pre-compile">
13.594 - <!-- Empty placeholder for easier customization. -->
13.595 - <!-- You can override this target in the ../build.xml file. -->
13.596 - </target>
13.597 - <target if="do.depend.true" name="-compile-depend">
13.598 - <pathconvert property="build.generated.subdirs">
13.599 - <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
13.600 - <include name="*"/>
13.601 - </dirset>
13.602 - </pathconvert>
13.603 - <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
13.604 - </target>
13.605 - <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
13.606 - <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
13.607 - <copy todir="${build.classes.dir}">
13.608 - <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
13.609 - </copy>
13.610 - </target>
13.611 - <target if="has.persistence.xml" name="-copy-persistence-xml">
13.612 - <mkdir dir="${build.classes.dir}/META-INF"/>
13.613 - <copy todir="${build.classes.dir}/META-INF">
13.614 - <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
13.615 - </copy>
13.616 - </target>
13.617 - <target name="-post-compile">
13.618 - <!-- Empty placeholder for easier customization. -->
13.619 - <!-- You can override this target in the ../build.xml file. -->
13.620 - </target>
13.621 - <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
13.622 - <target name="-pre-compile-single">
13.623 - <!-- Empty placeholder for easier customization. -->
13.624 - <!-- You can override this target in the ../build.xml file. -->
13.625 - </target>
13.626 - <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
13.627 - <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
13.628 - <j2seproject3:force-recompile/>
13.629 - <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
13.630 - </target>
13.631 - <target name="-post-compile-single">
13.632 - <!-- Empty placeholder for easier customization. -->
13.633 - <!-- You can override this target in the ../build.xml file. -->
13.634 - </target>
13.635 - <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
13.636 - <!--
13.637 - ====================
13.638 - JAR BUILDING SECTION
13.639 - ====================
13.640 - -->
13.641 - <target depends="init" name="-pre-pre-jar">
13.642 - <dirname file="${dist.jar}" property="dist.jar.dir"/>
13.643 - <mkdir dir="${dist.jar.dir}"/>
13.644 - </target>
13.645 - <target name="-pre-jar">
13.646 - <!-- Empty placeholder for easier customization. -->
13.647 - <!-- You can override this target in the ../build.xml file. -->
13.648 - </target>
13.649 - <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
13.650 - <j2seproject1:jar/>
13.651 - </target>
13.652 - <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">
13.653 - <j2seproject1:jar manifest="${manifest.file}"/>
13.654 - </target>
13.655 - <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">
13.656 - <j2seproject1:jar manifest="${manifest.file}">
13.657 - <j2seproject1:manifest>
13.658 - <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
13.659 - </j2seproject1:manifest>
13.660 - </j2seproject1:jar>
13.661 - <echo level="info">To run this application from the command line without Ant, try:</echo>
13.662 - <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
13.663 - <property location="${dist.jar}" name="dist.jar.resolved"/>
13.664 - <pathconvert property="run.classpath.with.dist.jar">
13.665 - <path path="${run.classpath}"/>
13.666 - <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
13.667 - </pathconvert>
13.668 - <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
13.669 - </target>
13.670 - <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
13.671 - <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
13.672 - <touch file="${tmp.manifest.file}" verbose="false"/>
13.673 - </target>
13.674 - <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
13.675 - <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
13.676 - <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
13.677 - </target>
13.678 - <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">
13.679 - <manifest file="${tmp.manifest.file}" mode="update">
13.680 - <attribute name="Main-Class" value="${main.class}"/>
13.681 - </manifest>
13.682 - </target>
13.683 - <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">
13.684 - <basename file="${application.splash}" property="splashscreen.basename"/>
13.685 - <mkdir dir="${build.classes.dir}/META-INF"/>
13.686 - <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
13.687 - <manifest file="${tmp.manifest.file}" mode="update">
13.688 - <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
13.689 - </manifest>
13.690 - </target>
13.691 - <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">
13.692 - <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
13.693 - <echo level="info">To run this application from the command line without Ant, try:</echo>
13.694 - <property location="${dist.jar}" name="dist.jar.resolved"/>
13.695 - <echo level="info">java -jar "${dist.jar.resolved}"</echo>
13.696 - </target>
13.697 - <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
13.698 - <delete>
13.699 - <fileset file="${tmp.manifest.file}"/>
13.700 - </delete>
13.701 - </target>
13.702 - <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"/>
13.703 - <target name="-post-jar">
13.704 - <!-- Empty placeholder for easier customization. -->
13.705 - <!-- You can override this target in the ../build.xml file. -->
13.706 - </target>
13.707 - <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"/>
13.708 - <!--
13.709 - =================
13.710 - EXECUTION SECTION
13.711 - =================
13.712 - -->
13.713 - <target depends="init,compile" description="Run a main class." name="run">
13.714 - <j2seproject1:java>
13.715 - <customize>
13.716 - <arg line="${application.args}"/>
13.717 - </customize>
13.718 - </j2seproject1:java>
13.719 - </target>
13.720 - <target name="-do-not-recompile">
13.721 - <property name="javac.includes.binary" value=""/>
13.722 - </target>
13.723 - <target depends="init,compile-single" name="run-single">
13.724 - <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
13.725 - <j2seproject1:java classname="${run.class}"/>
13.726 - </target>
13.727 - <target depends="init,compile-test-single" name="run-test-with-main">
13.728 - <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
13.729 - <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
13.730 - </target>
13.731 - <!--
13.732 - =================
13.733 - DEBUGGING SECTION
13.734 - =================
13.735 - -->
13.736 - <target depends="init" if="netbeans.home" name="-debug-start-debugger">
13.737 - <j2seproject1:nbjpdastart name="${debug.class}"/>
13.738 - </target>
13.739 - <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
13.740 - <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
13.741 - </target>
13.742 - <target depends="init,compile" name="-debug-start-debuggee">
13.743 - <j2seproject3:debug>
13.744 - <customize>
13.745 - <arg line="${application.args}"/>
13.746 - </customize>
13.747 - </j2seproject3:debug>
13.748 - </target>
13.749 - <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
13.750 - <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
13.751 - <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
13.752 - </target>
13.753 - <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
13.754 - <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
13.755 - <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
13.756 - <j2seproject3:debug classname="${debug.class}"/>
13.757 - </target>
13.758 - <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
13.759 - <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
13.760 - <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
13.761 - <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
13.762 - </target>
13.763 - <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
13.764 - <target depends="init" name="-pre-debug-fix">
13.765 - <fail unless="fix.includes">Must set fix.includes</fail>
13.766 - <property name="javac.includes" value="${fix.includes}.java"/>
13.767 - </target>
13.768 - <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
13.769 - <j2seproject1:nbjpdareload/>
13.770 - </target>
13.771 - <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
13.772 - <!--
13.773 - =================
13.774 - PROFILING SECTION
13.775 - =================
13.776 - -->
13.777 - <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
13.778 - <nbprofiledirect>
13.779 - <classpath>
13.780 - <path path="${run.classpath}"/>
13.781 - </classpath>
13.782 - </nbprofiledirect>
13.783 - <profile/>
13.784 - </target>
13.785 - <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
13.786 - <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
13.787 - <nbprofiledirect>
13.788 - <classpath>
13.789 - <path path="${run.classpath}"/>
13.790 - </classpath>
13.791 - </nbprofiledirect>
13.792 - <profile classname="${profile.class}"/>
13.793 - </target>
13.794 - <!--
13.795 - =========================
13.796 - APPLET PROFILING SECTION
13.797 - =========================
13.798 - -->
13.799 - <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
13.800 - <nbprofiledirect>
13.801 - <classpath>
13.802 - <path path="${run.classpath}"/>
13.803 - </classpath>
13.804 - </nbprofiledirect>
13.805 - <profile classname="sun.applet.AppletViewer">
13.806 - <customize>
13.807 - <arg value="${applet.url}"/>
13.808 - </customize>
13.809 - </profile>
13.810 - </target>
13.811 - <!--
13.812 - =========================
13.813 - TESTS PROFILING SECTION
13.814 - =========================
13.815 - -->
13.816 - <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
13.817 - <nbprofiledirect>
13.818 - <classpath>
13.819 - <path path="${run.test.classpath}"/>
13.820 - </classpath>
13.821 - </nbprofiledirect>
13.822 - <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
13.823 - <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
13.824 - <jvmarg value="${profiler.info.jvmargs.agent}"/>
13.825 - <jvmarg line="${profiler.info.jvmargs}"/>
13.826 - <test name="${profile.class}"/>
13.827 - <classpath>
13.828 - <path path="${run.test.classpath}"/>
13.829 - </classpath>
13.830 - <syspropertyset>
13.831 - <propertyref prefix="test-sys-prop."/>
13.832 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
13.833 - </syspropertyset>
13.834 - <formatter type="brief" usefile="false"/>
13.835 - <formatter type="xml"/>
13.836 - </junit>
13.837 - </target>
13.838 - <!--
13.839 - ===============
13.840 - JAVADOC SECTION
13.841 - ===============
13.842 - -->
13.843 - <target depends="init" if="have.sources" name="-javadoc-build">
13.844 - <mkdir dir="${dist.javadoc.dir}"/>
13.845 - <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}">
13.846 - <classpath>
13.847 - <path path="${javac.classpath}"/>
13.848 - </classpath>
13.849 - <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
13.850 - <filename name="**/*.java"/>
13.851 - </fileset>
13.852 - <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
13.853 - <include name="**/*.java"/>
13.854 - <exclude name="*.java"/>
13.855 - </fileset>
13.856 - </javadoc>
13.857 - <copy todir="${dist.javadoc.dir}">
13.858 - <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
13.859 - <filename name="**/doc-files/**"/>
13.860 - </fileset>
13.861 - <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
13.862 - <include name="**/doc-files/**"/>
13.863 - </fileset>
13.864 - </copy>
13.865 - </target>
13.866 - <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
13.867 - <nbbrowse file="${dist.javadoc.dir}/index.html"/>
13.868 - </target>
13.869 - <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
13.870 - <!--
13.871 - =========================
13.872 - JUNIT COMPILATION SECTION
13.873 - =========================
13.874 - -->
13.875 - <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
13.876 - <mkdir dir="${build.test.classes.dir}"/>
13.877 - </target>
13.878 - <target name="-pre-compile-test">
13.879 - <!-- Empty placeholder for easier customization. -->
13.880 - <!-- You can override this target in the ../build.xml file. -->
13.881 - </target>
13.882 - <target if="do.depend.true" name="-compile-test-depend">
13.883 - <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
13.884 - </target>
13.885 - <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
13.886 - <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}"/>
13.887 - <copy todir="${build.test.classes.dir}">
13.888 - <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
13.889 - </copy>
13.890 - </target>
13.891 - <target name="-post-compile-test">
13.892 - <!-- Empty placeholder for easier customization. -->
13.893 - <!-- You can override this target in the ../build.xml file. -->
13.894 - </target>
13.895 - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
13.896 - <target name="-pre-compile-test-single">
13.897 - <!-- Empty placeholder for easier customization. -->
13.898 - <!-- You can override this target in the ../build.xml file. -->
13.899 - </target>
13.900 - <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
13.901 - <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
13.902 - <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
13.903 - <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}"/>
13.904 - <copy todir="${build.test.classes.dir}">
13.905 - <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
13.906 - </copy>
13.907 - </target>
13.908 - <target name="-post-compile-test-single">
13.909 - <!-- Empty placeholder for easier customization. -->
13.910 - <!-- You can override this target in the ../build.xml file. -->
13.911 - </target>
13.912 - <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
13.913 - <!--
13.914 - =======================
13.915 - JUNIT EXECUTION SECTION
13.916 - =======================
13.917 - -->
13.918 - <target depends="init" if="have.tests" name="-pre-test-run">
13.919 - <mkdir dir="${build.test.results.dir}"/>
13.920 - </target>
13.921 - <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
13.922 - <j2seproject3:junit testincludes="**/*Test.java"/>
13.923 - </target>
13.924 - <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
13.925 - <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
13.926 - </target>
13.927 - <target depends="init" if="have.tests" name="test-report"/>
13.928 - <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
13.929 - <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
13.930 - <target depends="init" if="have.tests" name="-pre-test-run-single">
13.931 - <mkdir dir="${build.test.results.dir}"/>
13.932 - </target>
13.933 - <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
13.934 - <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
13.935 - <j2seproject3:junit excludes="" includes="${test.includes}"/>
13.936 - </target>
13.937 - <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
13.938 - <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
13.939 - </target>
13.940 - <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"/>
13.941 - <!--
13.942 - =======================
13.943 - JUNIT DEBUGGING SECTION
13.944 - =======================
13.945 - -->
13.946 - <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
13.947 - <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
13.948 - <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
13.949 - <delete file="${test.report.file}"/>
13.950 - <mkdir dir="${build.test.results.dir}"/>
13.951 - <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}">
13.952 - <customize>
13.953 - <syspropertyset>
13.954 - <propertyref prefix="test-sys-prop."/>
13.955 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
13.956 - </syspropertyset>
13.957 - <arg value="${test.class}"/>
13.958 - <arg value="showoutput=true"/>
13.959 - <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
13.960 - <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
13.961 - </customize>
13.962 - </j2seproject3:debug>
13.963 - </target>
13.964 - <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
13.965 - <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
13.966 - </target>
13.967 - <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
13.968 - <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
13.969 - <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
13.970 - </target>
13.971 - <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
13.972 - <!--
13.973 - =========================
13.974 - APPLET EXECUTION SECTION
13.975 - =========================
13.976 - -->
13.977 - <target depends="init,compile-single" name="run-applet">
13.978 - <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
13.979 - <j2seproject1:java classname="sun.applet.AppletViewer">
13.980 - <customize>
13.981 - <arg value="${applet.url}"/>
13.982 - </customize>
13.983 - </j2seproject1:java>
13.984 - </target>
13.985 - <!--
13.986 - =========================
13.987 - APPLET DEBUGGING SECTION
13.988 - =========================
13.989 - -->
13.990 - <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
13.991 - <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
13.992 - <j2seproject3:debug classname="sun.applet.AppletViewer">
13.993 - <customize>
13.994 - <arg value="${applet.url}"/>
13.995 - </customize>
13.996 - </j2seproject3:debug>
13.997 - </target>
13.998 - <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
13.999 - <!--
13.1000 - ===============
13.1001 - CLEANUP SECTION
13.1002 - ===============
13.1003 - -->
13.1004 - <target name="-deps-clean-init" unless="built-clean.properties">
13.1005 - <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
13.1006 - <delete file="${built-clean.properties}" quiet="true"/>
13.1007 - </target>
13.1008 - <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
13.1009 - <echo level="warn" message="Cycle detected: alt2xml was already built"/>
13.1010 - </target>
13.1011 - <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
13.1012 - <mkdir dir="${build.dir}"/>
13.1013 - <touch file="${built-clean.properties}" verbose="false"/>
13.1014 - <property file="${built-clean.properties}" prefix="already.built.clean."/>
13.1015 - <antcall target="-warn-already-built-clean"/>
13.1016 - <propertyfile file="${built-clean.properties}">
13.1017 - <entry key="${basedir}" value=""/>
13.1018 - </propertyfile>
13.1019 - </target>
13.1020 - <target depends="init" name="-do-clean">
13.1021 - <delete dir="${build.dir}"/>
13.1022 - <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
13.1023 - </target>
13.1024 - <target name="-post-clean">
13.1025 - <!-- Empty placeholder for easier customization. -->
13.1026 - <!-- You can override this target in the ../build.xml file. -->
13.1027 - </target>
13.1028 - <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
13.1029 - <target name="-check-call-dep">
13.1030 - <property file="${call.built.properties}" prefix="already.built."/>
13.1031 - <condition property="should.call.dep">
13.1032 - <not>
13.1033 - <isset property="already.built.${call.subproject}"/>
13.1034 - </not>
13.1035 - </condition>
13.1036 - </target>
13.1037 - <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
13.1038 - <ant antfile="${call.script}" inheritall="false" target="${call.target}">
13.1039 - <propertyset>
13.1040 - <propertyref prefix="transfer."/>
13.1041 - <mapper from="transfer.*" to="*" type="glob"/>
13.1042 - </propertyset>
13.1043 - </ant>
13.1044 - </target>
13.1045 -</project>
14.1 --- a/java/alt2xml/nbproject/genfiles.properties Tue Jan 03 14:47:22 2012 +0100
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,8 +0,0 @@
14.4 -build.xml.data.CRC32=ec5db5e3
14.5 -build.xml.script.CRC32=bb4dbef7
14.6 -build.xml.stylesheet.CRC32=28e38971@1.44.1.45
14.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
14.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
14.9 -nbproject/build-impl.xml.data.CRC32=ec5db5e3
14.10 -nbproject/build-impl.xml.script.CRC32=9cc781c1
14.11 -nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
15.1 --- a/java/alt2xml/nbproject/project.properties Tue Jan 03 14:47:22 2012 +0100
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,73 +0,0 @@
15.4 -annotation.processing.enabled=true
15.5 -annotation.processing.enabled.in.editor=false
15.6 -annotation.processing.run.all.processors=true
15.7 -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
15.8 -application.title=alt2xml
15.9 -application.vendor=fiki
15.10 -build.classes.dir=${build.dir}/classes
15.11 -build.classes.excludes=**/*.java,**/*.form
15.12 -# This directory is removed when the project is cleaned:
15.13 -build.dir=build
15.14 -build.generated.dir=${build.dir}/generated
15.15 -build.generated.sources.dir=${build.dir}/generated-sources
15.16 -# Only compile against the classpath explicitly listed here:
15.17 -build.sysclasspath=ignore
15.18 -build.test.classes.dir=${build.dir}/test/classes
15.19 -build.test.results.dir=${build.dir}/test/results
15.20 -# Uncomment to specify the preferred debugger connection transport:
15.21 -#debug.transport=dt_socket
15.22 -debug.classpath=\
15.23 - ${run.classpath}
15.24 -debug.test.classpath=\
15.25 - ${run.test.classpath}
15.26 -# This directory is removed when the project is cleaned:
15.27 -dist.dir=dist
15.28 -dist.jar=${dist.dir}/alt2xml.jar
15.29 -dist.javadoc.dir=${dist.dir}/javadoc
15.30 -endorsed.classpath=
15.31 -excludes=
15.32 -includes=**
15.33 -jar.compress=false
15.34 -javac.classpath=\
15.35 - ${libs.json-simple.classpath}
15.36 -# Space-separated list of extra javac options
15.37 -javac.compilerargs=
15.38 -javac.deprecation=false
15.39 -javac.processorpath=\
15.40 - ${javac.classpath}
15.41 -javac.source=1.7
15.42 -javac.target=1.7
15.43 -javac.test.classpath=\
15.44 - ${javac.classpath}:\
15.45 - ${build.classes.dir}
15.46 -javac.test.processorpath=\
15.47 - ${javac.test.classpath}
15.48 -javadoc.additionalparam=
15.49 -javadoc.author=false
15.50 -javadoc.encoding=${source.encoding}
15.51 -javadoc.noindex=false
15.52 -javadoc.nonavbar=false
15.53 -javadoc.notree=false
15.54 -javadoc.private=false
15.55 -javadoc.splitindex=true
15.56 -javadoc.use=true
15.57 -javadoc.version=false
15.58 -javadoc.windowtitle=
15.59 -main.class=cz.frantovo.alt2xml.CLI
15.60 -manifest.file=manifest.mf
15.61 -meta.inf.dir=${src.dir}/META-INF
15.62 -mkdist.disabled=false
15.63 -platform.active=default_platform
15.64 -run.classpath=\
15.65 - ${javac.classpath}:\
15.66 - ${build.classes.dir}
15.67 -# Space-separated list of JVM arguments used when running the project
15.68 -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
15.69 -# or test-sys-prop.name=value to set system properties for unit tests):
15.70 -run.jvmargs=
15.71 -run.test.classpath=\
15.72 - ${javac.test.classpath}:\
15.73 - ${build.test.classes.dir}
15.74 -source.encoding=UTF-8
15.75 -src.dir=src
15.76 -test.src.dir=test
16.1 --- a/java/alt2xml/nbproject/project.xml Tue Jan 03 14:47:22 2012 +0100
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,15 +0,0 @@
16.4 -<?xml version="1.0" encoding="UTF-8"?>
16.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
16.6 - <type>org.netbeans.modules.java.j2seproject</type>
16.7 - <configuration>
16.8 - <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
16.9 - <name>alt2xml</name>
16.10 - <source-roots>
16.11 - <root id="src.dir"/>
16.12 - </source-roots>
16.13 - <test-roots>
16.14 - <root id="test.src.dir"/>
16.15 - </test-roots>
16.16 - </data>
16.17 - </configuration>
16.18 -</project>
17.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/CLI.java Tue Jan 03 14:47:22 2012 +0100
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,42 +0,0 @@
17.4 -package cz.frantovo.alt2xml;
17.5 -
17.6 -import cz.frantovo.alt2xml.výstup.EchoContentHandler;
17.7 -import java.io.InputStream;
17.8 -import java.io.OutputStream;
17.9 -import javax.xml.parsers.SAXParser;
17.10 -import javax.xml.parsers.SAXParserFactory;
17.11 -import javax.xml.stream.XMLOutputFactory;
17.12 -import javax.xml.stream.XMLStreamWriter;
17.13 -import org.xml.sax.helpers.DefaultHandler;
17.14 -
17.15 -/**
17.16 - *
17.17 - * @author fiki
17.18 - */
17.19 -public class CLI {
17.20 -
17.21 - public static void main(String[] args) throws Exception {
17.22 - /**
17.23 - * Použijeme standardní vstup a výstup:
17.24 - */
17.25 - InputStream vstup = System.in;
17.26 - OutputStream výstup = System.out;
17.27 -
17.28 - /**
17.29 - * Serializujeme data do XML.
17.30 - * To normálně vůbec není potřeba – data se do tvaru proudu obsahujícího ostré závorky
17.31 - * vůbec nedostanou – zpracováváme události (volání javovských metod – začátky a konce elementů atd.)
17.32 - * a z nich např. deserializujeme nějaké naše objekty, provádíme nějaké akce, nebo třeba stavíme DOM.
17.33 - */
17.34 - XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newFactory();
17.35 - XMLStreamWriter w = xmlOutputFactory.createXMLStreamWriter(výstup);
17.36 - DefaultHandler h = new EchoContentHandler(w);
17.37 -
17.38 - /**
17.39 - * Parsujeme JSON a děláme z něj XML:
17.40 - */
17.41 - SAXParserFactory t = SAXParserFactory.newInstance(SAXTovarna.class.getName(), null);
17.42 - SAXParser p = t.newSAXParser();
17.43 - p.parse(vstup, h);
17.44 - }
17.45 -}
18.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/SAXTovarna.java Tue Jan 03 14:47:22 2012 +0100
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,72 +0,0 @@
18.4 -package cz.frantovo.alt2xml;
18.5 -
18.6 -import cz.frantovo.alt2xml.vstup.SuperReader;
18.7 -import javax.xml.parsers.ParserConfigurationException;
18.8 -import javax.xml.parsers.SAXParser;
18.9 -import javax.xml.parsers.SAXParserFactory;
18.10 -import org.xml.sax.Parser;
18.11 -import org.xml.sax.SAXException;
18.12 -import org.xml.sax.SAXNotRecognizedException;
18.13 -import org.xml.sax.SAXNotSupportedException;
18.14 -import org.xml.sax.XMLReader;
18.15 -
18.16 -/**
18.17 - *
18.18 - * @author fiki
18.19 - */
18.20 -public class SAXTovarna extends SAXParserFactory {
18.21 -
18.22 - @Override
18.23 - public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
18.24 - return new MůjParser(new SuperReader());
18.25 - }
18.26 -
18.27 - @Override
18.28 - public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
18.29 - throw new SAXNotSupportedException("Zatím není podporováno.");
18.30 - }
18.31 -
18.32 - @Override
18.33 - public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
18.34 - throw new SAXNotSupportedException("Zatím není podporováno.");
18.35 - }
18.36 -
18.37 - private static class MůjParser extends SAXParser {
18.38 -
18.39 - private XMLReader xmlReader;
18.40 -
18.41 - public MůjParser(XMLReader xmlReader) {
18.42 - this.xmlReader = xmlReader;
18.43 - }
18.44 -
18.45 - @Override
18.46 - public Parser getParser() throws SAXException {
18.47 - throw new SAXException("Není podporováno.");
18.48 - }
18.49 -
18.50 - @Override
18.51 - public XMLReader getXMLReader() throws SAXException {
18.52 - return xmlReader;
18.53 - }
18.54 -
18.55 - @Override
18.56 - public boolean isNamespaceAware() {
18.57 - return false;
18.58 - }
18.59 -
18.60 - @Override
18.61 - public boolean isValidating() {
18.62 - return false;
18.63 - }
18.64 -
18.65 - @Override
18.66 - public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
18.67 - xmlReader.setProperty(name, value);
18.68 - }
18.69 -
18.70 - @Override
18.71 - public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
18.72 - return xmlReader.getProperty(name);
18.73 - }
18.74 - }
18.75 -}
18.76 \ No newline at end of file
19.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/vstup/JsonSimpleContentHandler.java Tue Jan 03 14:47:22 2012 +0100
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,135 +0,0 @@
19.4 -package cz.frantovo.alt2xml.vstup;
19.5 -
19.6 -import java.io.IOException;
19.7 -import java.util.Stack;
19.8 -import org.json.simple.parser.ParseException;
19.9 -import org.xml.sax.ContentHandler;
19.10 -import org.xml.sax.SAXException;
19.11 -
19.12 -/**
19.13 - *
19.14 - * @author fiki
19.15 - */
19.16 -public class JsonSimpleContentHandler implements org.json.simple.parser.ContentHandler {
19.17 -
19.18 - /** Sem vypisujeme XML události */
19.19 - private ContentHandler saxVýstup;
19.20 - /** Musíme si pamatovat polohu v XML stromu, abychom věděli, kterou značku kdy uzavřít */
19.21 - private Stack<String> poloha = new Stack<>();
19.22 - /**
19.23 - * Po textových uzlech vkládáme konce elementů rovnou,
19.24 - * ale pokud jeden element končí hned po jiném,
19.25 - * vložíme mezi ně ještě konec řádku a odsazení.
19.26 - */
19.27 - private boolean zalomitŘádek = false;
19.28 -
19.29 - public JsonSimpleContentHandler(ContentHandler saxVýstup) {
19.30 - this.saxVýstup = saxVýstup;
19.31 - }
19.32 -
19.33 - private void začniElement(String název) throws IOException {
19.34 - try {
19.35 - vložOdsazení();
19.36 - saxVýstup.startElement(null, null, název, null);
19.37 - poloha.push(název);
19.38 - } catch (SAXException e) {
19.39 - throw new IOException("Chyba při začátku elementu.", e);
19.40 - }
19.41 - }
19.42 -
19.43 - private void ukončiElement() throws IOException {
19.44 - try {
19.45 - String značka = poloha.pop();
19.46 - if (zalomitŘádek) {
19.47 - vložOdsazení();
19.48 - }
19.49 - zalomitŘádek = true;
19.50 - saxVýstup.endElement(null, null, značka);
19.51 - } catch (SAXException e) {
19.52 - throw new IOException("Chyba při ukončování elementu.", e);
19.53 - }
19.54 - }
19.55 -
19.56 - private void vložOdsazení() throws IOException {
19.57 - /**
19.58 - * TODO: ignorableWhitespace() ?
19.59 - */
19.60 - vložText("\n");
19.61 - for (int i = 0; i < poloha.size(); i++) {
19.62 - vložText("\t");
19.63 - }
19.64 - }
19.65 -
19.66 - private void vložText(String text) throws IOException {
19.67 - try {
19.68 - saxVýstup.characters(text.toCharArray(), 0, text.length());
19.69 - } catch (SAXException e) {
19.70 - throw new IOException("Chyba při vkládání textu.", e);
19.71 - }
19.72 - }
19.73 -
19.74 - @Override
19.75 - public void startJSON() throws ParseException, IOException {
19.76 - try {
19.77 - saxVýstup.startDocument();
19.78 - začniElement("objekt");
19.79 - } catch (SAXException e) {
19.80 - throw new IOException("Chyba při začátku dokumentu.", e);
19.81 - }
19.82 - }
19.83 -
19.84 - @Override
19.85 - public void endJSON() throws ParseException, IOException {
19.86 - try {
19.87 - ukončiElement();
19.88 - vložText("\n");
19.89 - saxVýstup.endDocument();
19.90 - } catch (SAXException e) {
19.91 - throw new IOException(e);
19.92 - }
19.93 - }
19.94 -
19.95 - @Override
19.96 - public boolean startObject() throws ParseException, IOException {
19.97 - // System.err.println("startObject");
19.98 - return true;
19.99 - }
19.100 -
19.101 - @Override
19.102 - public boolean endObject() throws ParseException, IOException {
19.103 - // System.err.println("endObject");
19.104 - return true;
19.105 - }
19.106 -
19.107 - @Override
19.108 - public boolean startObjectEntry(String key) throws ParseException, IOException {
19.109 - začniElement(key);
19.110 - return true;
19.111 - }
19.112 -
19.113 - @Override
19.114 - public boolean endObjectEntry() throws ParseException, IOException {
19.115 - ukončiElement();
19.116 - // System.err.println("endObjectEntry");
19.117 - return true;
19.118 - }
19.119 -
19.120 - @Override
19.121 - public boolean startArray() throws ParseException, IOException {
19.122 - // System.err.println("startArray");
19.123 - return true;
19.124 - }
19.125 -
19.126 - @Override
19.127 - public boolean endArray() throws ParseException, IOException {
19.128 - // System.err.println("endArray");
19.129 - return true;
19.130 - }
19.131 -
19.132 - @Override
19.133 - public boolean primitive(Object value) throws ParseException, IOException {
19.134 - vložText(String.valueOf(value));
19.135 - zalomitŘádek = false;
19.136 - return true;
19.137 - }
19.138 -}
20.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/vstup/SuperReader.java Tue Jan 03 14:47:22 2012 +0100
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,111 +0,0 @@
20.4 -package cz.frantovo.alt2xml.vstup;
20.5 -
20.6 -import java.io.IOException;
20.7 -import java.io.InputStreamReader;
20.8 -import java.util.HashMap;
20.9 -import java.util.Map;
20.10 -import org.json.simple.parser.JSONParser;
20.11 -import org.json.simple.parser.ParseException;
20.12 -import org.xml.sax.ContentHandler;
20.13 -import org.xml.sax.DTDHandler;
20.14 -import org.xml.sax.EntityResolver;
20.15 -import org.xml.sax.ErrorHandler;
20.16 -import org.xml.sax.InputSource;
20.17 -import org.xml.sax.SAXException;
20.18 -import org.xml.sax.SAXNotRecognizedException;
20.19 -import org.xml.sax.SAXNotSupportedException;
20.20 -import org.xml.sax.XMLReader;
20.21 -
20.22 -/**
20.23 - *
20.24 - * @author fiki
20.25 - */
20.26 -public class SuperReader implements XMLReader {
20.27 -
20.28 - private ContentHandler contentHandler;
20.29 - private ErrorHandler errorHandler;
20.30 - private DTDHandler dtdHandler;
20.31 - private EntityResolver entityResolver;
20.32 - private Map<String, Object> konfigurace = new HashMap<>();
20.33 -
20.34 - @Override
20.35 - public void parse(InputSource input) throws IOException, SAXException {
20.36 - /**
20.37 - * TODO: rozpornat formát vstupu a podle toho delegovat
20.38 - */
20.39 - JSONParser p = new JSONParser();
20.40 - InputStreamReader vstup = new InputStreamReader(input.getByteStream());
20.41 - JsonSimpleContentHandler handler = new JsonSimpleContentHandler(contentHandler);
20.42 -
20.43 - try {
20.44 - p.parse(vstup, handler);
20.45 - } catch (ParseException e) {
20.46 - throw new SAXException("Chyba při načítání JSONu", e);
20.47 - }
20.48 - }
20.49 -
20.50 - @Override
20.51 - public void parse(String systemId) throws IOException, SAXException {
20.52 - parse(new InputSource(systemId));
20.53 - }
20.54 -
20.55 - @Override
20.56 - public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
20.57 - throw new SAXNotSupportedException("Zatím není podporováno.");
20.58 - }
20.59 -
20.60 - @Override
20.61 - public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
20.62 - throw new SAXNotSupportedException("Zatím není podporováno.");
20.63 - }
20.64 -
20.65 - @Override
20.66 - public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
20.67 - return konfigurace.get(name);
20.68 - }
20.69 -
20.70 - @Override
20.71 - public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
20.72 - konfigurace.put(name, value);
20.73 - }
20.74 -
20.75 - @Override
20.76 - public void setEntityResolver(EntityResolver entityResolver) {
20.77 - this.entityResolver = entityResolver;
20.78 - }
20.79 -
20.80 - @Override
20.81 - public EntityResolver getEntityResolver() {
20.82 - return entityResolver;
20.83 - }
20.84 -
20.85 - @Override
20.86 - public void setDTDHandler(DTDHandler dtdHandler) {
20.87 - this.dtdHandler = dtdHandler;
20.88 - }
20.89 -
20.90 - @Override
20.91 - public DTDHandler getDTDHandler() {
20.92 - return dtdHandler;
20.93 - }
20.94 -
20.95 - @Override
20.96 - public void setContentHandler(ContentHandler contentHandler) {
20.97 - this.contentHandler = contentHandler;
20.98 - }
20.99 -
20.100 - @Override
20.101 - public ContentHandler getContentHandler() {
20.102 - return contentHandler;
20.103 - }
20.104 -
20.105 - @Override
20.106 - public void setErrorHandler(ErrorHandler errorHandler) {
20.107 - this.errorHandler = errorHandler;
20.108 - }
20.109 -
20.110 - @Override
20.111 - public ErrorHandler getErrorHandler() {
20.112 - return errorHandler;
20.113 - }
20.114 -}
21.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/výstup/EchoContentHandler.java Tue Jan 03 14:47:22 2012 +0100
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,83 +0,0 @@
21.4 -package cz.frantovo.alt2xml.výstup;
21.5 -
21.6 -import javax.xml.stream.XMLStreamException;
21.7 -import javax.xml.stream.XMLStreamWriter;
21.8 -import org.xml.sax.Attributes;
21.9 -import org.xml.sax.SAXException;
21.10 -import org.xml.sax.helpers.DefaultHandler;
21.11 -
21.12 -/**
21.13 - * Slouží k převodu právě parsovaného XML zpět na XML.
21.14 - * Určen pro testování a ladění a pro použití s neobvyklými „XML“ parsery,
21.15 - * které nečtou XML ale jiný jazyk (např. JSON, INI atd.), ale používají stejné rozhraní (SAX).
21.16 - *
21.17 - * TODO: další typy uzlů a jmenné prostory.
21.18 - * @author fiki
21.19 - */
21.20 -public class EchoContentHandler extends DefaultHandler {
21.21 -
21.22 - private XMLStreamWriter w;
21.23 -
21.24 - /**
21.25 - * @param writer kam se bude vypisovat XML.
21.26 - */
21.27 - public EchoContentHandler(XMLStreamWriter writer) {
21.28 - w = writer;
21.29 - }
21.30 -
21.31 - @Override
21.32 - public void startDocument() throws SAXException {
21.33 - try {
21.34 - w.writeStartDocument();
21.35 - } catch (XMLStreamException e) {
21.36 - throw new SAXException(e);
21.37 - }
21.38 - }
21.39 -
21.40 - @Override
21.41 - public void endDocument() throws SAXException {
21.42 - try {
21.43 - w.writeEndDocument();
21.44 - w.close();
21.45 - } catch (XMLStreamException e) {
21.46 - throw new SAXException(e);
21.47 - }
21.48 - }
21.49 -
21.50 - @Override
21.51 - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
21.52 - try {
21.53 - w.writeStartElement(qName);
21.54 -
21.55 - if (attributes != null) {
21.56 - for (int i = 0; i < attributes.getLength(); i++) {
21.57 - w.writeAttribute(attributes.getQName(i), attributes.getValue(i));
21.58 - }
21.59 - }
21.60 -
21.61 - w.flush();
21.62 - } catch (XMLStreamException e) {
21.63 - throw new SAXException(e);
21.64 - }
21.65 - }
21.66 -
21.67 - @Override
21.68 - public void endElement(String uri, String localName, String qName) throws SAXException {
21.69 - try {
21.70 - w.writeEndElement();
21.71 - w.flush();
21.72 - } catch (XMLStreamException e) {
21.73 - throw new SAXException(e);
21.74 - }
21.75 - }
21.76 -
21.77 - @Override
21.78 - public void characters(char[] ch, int start, int length) throws SAXException {
21.79 - try {
21.80 - w.writeCharacters(ch, start, length);
21.81 - w.flush();
21.82 - } catch (XMLStreamException e) {
21.83 - throw new SAXException(e);
21.84 - }
21.85 - }
21.86 -}