Automated merge with http://bitbucket.org/jlahoda/jackpot30
authorJan Lahoda <jlahoda@netbeans.org>
Mon, 20 Jun 2011 23:28:38 +0200
changeset 593d88e4597c5c6
parent 592 5e8e6fc3dc98
parent 591 8c7e6dfbb560
child 594 c129535fb3c5
Automated merge with http://bitbucket.org/jlahoda/jackpot30
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/MainPage.java
server/temp-build-indexing-backend
     1.1 --- a/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Fri Jun 10 11:20:36 2011 -0400
     1.2 +++ b/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Mon Jun 20 23:28:38 2011 +0200
     1.3 @@ -92,7 +92,7 @@
     1.4      public void computeTypeNames(Context context, Result result) {
     1.5          for (RemoteIndex ri : RemoteIndex.loadIndices()) {
     1.6              try {
     1.7 -                URI resolved = new URI(ri.remote.toExternalForm() + "/findType?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
     1.8 +                URI resolved = new URI(ri.remote.toExternalForm() + "/type/search?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
     1.9                  @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
    1.10                  Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, WebUtilities.requestStringResponse(resolved));
    1.11  
     2.1 --- a/build.xml	Fri Jun 10 11:20:36 2011 -0400
     2.2 +++ b/build.xml	Mon Jun 20 23:28:38 2011 +0200
     2.3 @@ -15,8 +15,15 @@
     2.4          <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util.jar" todir="server/lib" />
     2.5          <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util-lookup.jar" todir="server/lib" />
     2.6          <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-spi-editor-hints.jar" todir="server/lib" />
     2.7 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-api-java-classpath.jar" todir="server/lib" />
     2.8          <copy file="${nbplatform.active.dir}/java/modules/ext/javac-api-nb-7.0-b07.jar" todir="server/lib/javac" />
     2.9          <copy file="${nbplatform.active.dir}/java/modules/ext/javac-impl-nb-7.0-b07.jar" todir="server/lib/javac" />
    2.10 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-jumpto.jar" todir="server/lib" />
    2.11 +        <copy file="${nbplatform.active.dir}/platform/modules/org-netbeans-modules-masterfs.jar" todir="server/lib" />
    2.12 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-lucene.jar" todir="server/lib" />
    2.13 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-api.jar" todir="server/lib" />
    2.14 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-projectapi.jar" todir="server/lib" />
    2.15 +        <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-project.jar" todir="server/lib" />
    2.16      </target>
    2.17      
    2.18      <target name="findbugs" depends="-init">
     3.1 --- a/cmdline/compiler/nbproject/genfiles.properties	Fri Jun 10 11:20:36 2011 -0400
     3.2 +++ b/cmdline/compiler/nbproject/genfiles.properties	Mon Jun 20 23:28:38 2011 +0200
     3.3 @@ -3,6 +3,6 @@
     3.4  build.xml.stylesheet.CRC32=79c3b980@1.33
     3.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     3.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     3.7 -nbproject/build-impl.xml.data.CRC32=4af71746
     3.8 +nbproject/build-impl.xml.data.CRC32=0275465b
     3.9  nbproject/build-impl.xml.script.CRC32=64f6fe95
    3.10 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.44
    3.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
     4.1 --- a/cmdline/tool/nbproject/genfiles.properties	Fri Jun 10 11:20:36 2011 -0400
     4.2 +++ b/cmdline/tool/nbproject/genfiles.properties	Mon Jun 20 23:28:38 2011 +0200
     4.3 @@ -3,6 +3,6 @@
     4.4  build.xml.stylesheet.CRC32=a56c6a5b@1.44
     4.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     4.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     4.7 -nbproject/build-impl.xml.data.CRC32=24278154
     4.8 +nbproject/build-impl.xml.data.CRC32=1f28cdee
     4.9  nbproject/build-impl.xml.script.CRC32=08f1fb11
    4.10  nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
     5.1 --- a/help/jackpot30-help.tex	Fri Jun 10 11:20:36 2011 -0400
     5.2 +++ b/help/jackpot30-help.tex	Mon Jun 20 23:28:38 2011 +0200
     5.3 @@ -6,7 +6,7 @@
     5.4  \verbdef\statementvariable=$[0-9A-Za-z_]+;=
     5.5  \verbdef\multipletreevariable=$[0-9A-Za-z_]+$=
     5.6  \verbdef\multiplestatementvariable=$[0-9A-Za-z_]+$;=
     5.7 -\verbdef\wholepattern=$$_=
     5.8 +\verbdef\wholepattern=$_=
     5.9  \verbdef\reserved=$$[0-9A-Za-z_]+=
    5.10  
    5.11  \begin{document}
    5.12 @@ -64,7 +64,7 @@
    5.13  
    5.14  \subsection{Variables}
    5.15  
    5.16 -Variables start with the dollar sign \verb=$=). In the pattern, first occurrences
    5.17 +Variables start with the dollar sign (\verb=$=). In the pattern, first occurrences
    5.18  of a variable is bound to the actual sub-tree that appears in the code. Second and
    5.19  following occurrences of the variable the actual sub-tree is verified against the subtree
    5.20  bound to the variable. The pattern occurs in the text only if the actual sub-tree
     6.1 --- a/hudson/trunk	Fri Jun 10 11:20:36 2011 -0400
     6.2 +++ b/hudson/trunk	Mon Jun 20 23:28:38 2011 +0200
     6.3 @@ -60,5 +60,4 @@
     6.4  mkdir -p build/server
     6.5  (cp server/do-indexing server/indexer/dist; cd server/indexer/dist/; zip -r ../../../build/server/indexer.zip *)
     6.6  (cd server/web.api/dist/; zip -r ../../../build/server/web.api.zip *)
     6.7 -(cd server/backend; call_ant clean && call_ant build && call_ant test && call_ant build-zip) || exit
     6.8 -(cd server; ./temp-build-indexing-backend) || exit
     6.9 +(cd server/backend; ./build-indexing-backend) || exit
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/server/backend/base.web.api/build.xml	Mon Jun 20 23:28:38 2011 +0200
     7.3 @@ -0,0 +1,74 @@
     7.4 +<?xml version="1.0" encoding="UTF-8"?>
     7.5 +<!-- You may freely edit this file. See commented blocks below for -->
     7.6 +<!-- some examples of how to customize the build. -->
     7.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
     7.8 +<!-- By default, only the Clean and Build commands use this build script. -->
     7.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
    7.10 +<!-- the Compile on Save feature is turned off for the project. -->
    7.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    7.12 +<!-- in the project's Project Properties dialog box.-->
    7.13 +<project name="base.web.api" default="default" basedir=".">
    7.14 +    <description>Builds, tests, and runs the project base.web.api.</description>
    7.15 +    <import file="nbproject/build-impl.xml"/>
    7.16 +    <!--
    7.17 +
    7.18 +    There exist several targets which are by default empty and which can be 
    7.19 +    used for execution of your tasks. These targets are usually executed 
    7.20 +    before and after some main targets. They are: 
    7.21 +
    7.22 +      -pre-init:                 called before initialization of project properties
    7.23 +      -post-init:                called after initialization of project properties
    7.24 +      -pre-compile:              called before javac compilation
    7.25 +      -post-compile:             called after javac compilation
    7.26 +      -pre-compile-single:       called before javac compilation of single file
    7.27 +      -post-compile-single:      called after javac compilation of single file
    7.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
    7.29 +      -post-compile-test:        called after javac compilation of JUnit tests
    7.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
    7.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
    7.32 +      -pre-jar:                  called before JAR building
    7.33 +      -post-jar:                 called after JAR building
    7.34 +      -post-clean:               called after cleaning build products
    7.35 +
    7.36 +    (Targets beginning with '-' are not intended to be called on their own.)
    7.37 +
    7.38 +    Example of inserting an obfuscator after compilation could look like this:
    7.39 +
    7.40 +        <target name="-post-compile">
    7.41 +            <obfuscate>
    7.42 +                <fileset dir="${build.classes.dir}"/>
    7.43 +            </obfuscate>
    7.44 +        </target>
    7.45 +
    7.46 +    For list of available properties check the imported 
    7.47 +    nbproject/build-impl.xml file. 
    7.48 +
    7.49 +
    7.50 +    Another way to customize the build is by overriding existing main targets.
    7.51 +    The targets of interest are: 
    7.52 +
    7.53 +      -init-macrodef-javac:     defines macro for javac compilation
    7.54 +      -init-macrodef-junit:     defines macro for junit execution
    7.55 +      -init-macrodef-debug:     defines macro for class debugging
    7.56 +      -init-macrodef-java:      defines macro for class execution
    7.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
    7.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
    7.59 +      run:                      execution of project 
    7.60 +      -javadoc-build:           Javadoc generation
    7.61 +      test-report:              JUnit report generation
    7.62 +
    7.63 +    An example of overriding the target for project execution could look like this:
    7.64 +
    7.65 +        <target name="run" depends="base.web.api-impl.jar">
    7.66 +            <exec dir="bin" executable="launcher.exe">
    7.67 +                <arg file="${dist.jar}"/>
    7.68 +            </exec>
    7.69 +        </target>
    7.70 +
    7.71 +    Notice that the overridden target depends on the jar target and not only on 
    7.72 +    the compile target as the regular run target does. Again, for a list of available 
    7.73 +    properties which you can use, check the target you are overriding in the
    7.74 +    nbproject/build-impl.xml file. 
    7.75 +
    7.76 +    -->
    7.77 +</project>
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/server/backend/base.web.api/manifest.mf	Mon Jun 20 23:28:38 2011 +0200
     8.3 @@ -0,0 +1,3 @@
     8.4 +Manifest-Version: 1.0
     8.5 +X-COMMENT: Main-Class will be added automatically by build
     8.6 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/server/backend/base.web.api/nbproject/build-impl.xml	Mon Jun 20 23:28:38 2011 +0200
     9.3 @@ -0,0 +1,1068 @@
     9.4 +<?xml version="1.0" encoding="UTF-8"?>
     9.5 +<!--
     9.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
     9.7 +***         EDIT ../build.xml INSTEAD         ***
     9.8 +
     9.9 +For the purpose of easier reading the script
    9.10 +is divided into following sections:
    9.11 +
    9.12 +  - initialization
    9.13 +  - compilation
    9.14 +  - jar
    9.15 +  - execution
    9.16 +  - debugging
    9.17 +  - javadoc
    9.18 +  - junit compilation
    9.19 +  - junit execution
    9.20 +  - junit debugging
    9.21 +  - applet
    9.22 +  - cleanup
    9.23 +
    9.24 +        -->
    9.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="base.web.api-impl">
    9.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
    9.27 +        <condition>
    9.28 +            <not>
    9.29 +                <antversion atleast="1.8.0"/>
    9.30 +            </not>
    9.31 +        </condition>
    9.32 +    </fail>
    9.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    9.34 +    <!-- 
    9.35 +                ======================
    9.36 +                INITIALIZATION SECTION 
    9.37 +                ======================
    9.38 +            -->
    9.39 +    <target name="-pre-init">
    9.40 +        <!-- Empty placeholder for easier customization. -->
    9.41 +        <!-- You can override this target in the ../build.xml file. -->
    9.42 +    </target>
    9.43 +    <target depends="-pre-init" name="-init-private">
    9.44 +        <property file="nbproject/private/config.properties"/>
    9.45 +        <property file="nbproject/private/configs/${config}.properties"/>
    9.46 +        <property file="nbproject/private/private.properties"/>
    9.47 +    </target>
    9.48 +    <target name="-pre-init-libraries">
    9.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
    9.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
    9.51 +        <pathconvert dirsep="/" property="libraries.dir">
    9.52 +            <path path="${libraries.dir.nativedirsep}"/>
    9.53 +        </pathconvert>
    9.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
    9.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
    9.56 +    </target>
    9.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
    9.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
    9.59 +            <filterchain>
    9.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
    9.61 +                <escapeunicode/>
    9.62 +            </filterchain>
    9.63 +        </loadproperties>
    9.64 +    </target>
    9.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
    9.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
    9.67 +            <filterchain>
    9.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
    9.69 +                <escapeunicode/>
    9.70 +            </filterchain>
    9.71 +        </loadproperties>
    9.72 +    </target>
    9.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
    9.74 +        <property file="${user.properties.file}"/>
    9.75 +        <!-- The two properties below are usually overridden -->
    9.76 +        <!-- by the active platform. Just a fallback. -->
    9.77 +        <property name="default.javac.source" value="1.4"/>
    9.78 +        <property name="default.javac.target" value="1.4"/>
    9.79 +    </target>
    9.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
    9.81 +        <property file="nbproject/configs/${config}.properties"/>
    9.82 +        <property file="nbproject/project.properties"/>
    9.83 +    </target>
    9.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    9.85 +        <available file="${manifest.file}" property="manifest.available"/>
    9.86 +        <condition property="splashscreen.available">
    9.87 +            <and>
    9.88 +                <not>
    9.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
    9.90 +                </not>
    9.91 +                <available file="${application.splash}"/>
    9.92 +            </and>
    9.93 +        </condition>
    9.94 +        <condition property="main.class.available">
    9.95 +            <and>
    9.96 +                <isset property="main.class"/>
    9.97 +                <not>
    9.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
    9.99 +                </not>
   9.100 +            </and>
   9.101 +        </condition>
   9.102 +        <condition property="manifest.available+main.class">
   9.103 +            <and>
   9.104 +                <isset property="manifest.available"/>
   9.105 +                <isset property="main.class.available"/>
   9.106 +            </and>
   9.107 +        </condition>
   9.108 +        <condition property="do.archive">
   9.109 +            <not>
   9.110 +                <istrue value="${jar.archive.disabled}"/>
   9.111 +            </not>
   9.112 +        </condition>
   9.113 +        <condition property="do.mkdist">
   9.114 +            <and>
   9.115 +                <isset property="do.archive"/>
   9.116 +                <isset property="libs.CopyLibs.classpath"/>
   9.117 +                <not>
   9.118 +                    <istrue value="${mkdist.disabled}"/>
   9.119 +                </not>
   9.120 +            </and>
   9.121 +        </condition>
   9.122 +        <condition property="manifest.available+main.class+mkdist.available">
   9.123 +            <and>
   9.124 +                <istrue value="${manifest.available+main.class}"/>
   9.125 +                <isset property="do.mkdist"/>
   9.126 +            </and>
   9.127 +        </condition>
   9.128 +        <condition property="do.archive+manifest.available">
   9.129 +            <and>
   9.130 +                <isset property="manifest.available"/>
   9.131 +                <istrue value="${do.archive}"/>
   9.132 +            </and>
   9.133 +        </condition>
   9.134 +        <condition property="do.archive+main.class.available">
   9.135 +            <and>
   9.136 +                <isset property="main.class.available"/>
   9.137 +                <istrue value="${do.archive}"/>
   9.138 +            </and>
   9.139 +        </condition>
   9.140 +        <condition property="do.archive+splashscreen.available">
   9.141 +            <and>
   9.142 +                <isset property="splashscreen.available"/>
   9.143 +                <istrue value="${do.archive}"/>
   9.144 +            </and>
   9.145 +        </condition>
   9.146 +        <condition property="do.archive+manifest.available+main.class">
   9.147 +            <and>
   9.148 +                <istrue value="${manifest.available+main.class}"/>
   9.149 +                <istrue value="${do.archive}"/>
   9.150 +            </and>
   9.151 +        </condition>
   9.152 +        <condition property="manifest.available-mkdist.available">
   9.153 +            <or>
   9.154 +                <istrue value="${manifest.available}"/>
   9.155 +                <isset property="do.mkdist"/>
   9.156 +            </or>
   9.157 +        </condition>
   9.158 +        <condition property="manifest.available+main.class-mkdist.available">
   9.159 +            <or>
   9.160 +                <istrue value="${manifest.available+main.class}"/>
   9.161 +                <isset property="do.mkdist"/>
   9.162 +            </or>
   9.163 +        </condition>
   9.164 +        <condition property="have.tests">
   9.165 +            <or>
   9.166 +                <available file="${test.src.dir}"/>
   9.167 +            </or>
   9.168 +        </condition>
   9.169 +        <condition property="have.sources">
   9.170 +            <or>
   9.171 +                <available file="${src.dir}"/>
   9.172 +            </or>
   9.173 +        </condition>
   9.174 +        <condition property="netbeans.home+have.tests">
   9.175 +            <and>
   9.176 +                <isset property="netbeans.home"/>
   9.177 +                <isset property="have.tests"/>
   9.178 +            </and>
   9.179 +        </condition>
   9.180 +        <condition property="no.javadoc.preview">
   9.181 +            <and>
   9.182 +                <isset property="javadoc.preview"/>
   9.183 +                <isfalse value="${javadoc.preview}"/>
   9.184 +            </and>
   9.185 +        </condition>
   9.186 +        <property name="run.jvmargs" value=""/>
   9.187 +        <property name="javac.compilerargs" value=""/>
   9.188 +        <property name="work.dir" value="${basedir}"/>
   9.189 +        <condition property="no.deps">
   9.190 +            <and>
   9.191 +                <istrue value="${no.dependencies}"/>
   9.192 +            </and>
   9.193 +        </condition>
   9.194 +        <property name="javac.debug" value="true"/>
   9.195 +        <property name="javadoc.preview" value="true"/>
   9.196 +        <property name="application.args" value=""/>
   9.197 +        <property name="source.encoding" value="${file.encoding}"/>
   9.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
   9.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   9.200 +            <and>
   9.201 +                <isset property="javadoc.encoding"/>
   9.202 +                <not>
   9.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
   9.204 +                </not>
   9.205 +            </and>
   9.206 +        </condition>
   9.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
   9.208 +        <property name="includes" value="**"/>
   9.209 +        <property name="excludes" value=""/>
   9.210 +        <property name="do.depend" value="false"/>
   9.211 +        <condition property="do.depend.true">
   9.212 +            <istrue value="${do.depend}"/>
   9.213 +        </condition>
   9.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   9.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   9.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
   9.217 +        </condition>
   9.218 +        <condition else="false" property="jdkBug6558476">
   9.219 +            <and>
   9.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   9.221 +                <not>
   9.222 +                    <os family="unix"/>
   9.223 +                </not>
   9.224 +            </and>
   9.225 +        </condition>
   9.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
   9.227 +        <property name="jar.index" value="false"/>
   9.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
   9.229 +        <property name="copylibs.rebase" value="true"/>
   9.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   9.231 +    </target>
   9.232 +    <target name="-post-init">
   9.233 +        <!-- Empty placeholder for easier customization. -->
   9.234 +        <!-- You can override this target in the ../build.xml file. -->
   9.235 +    </target>
   9.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
   9.237 +        <fail unless="src.dir">Must set src.dir</fail>
   9.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
   9.239 +        <fail unless="build.dir">Must set build.dir</fail>
   9.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
   9.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
   9.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
   9.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
   9.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   9.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   9.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
   9.247 +    </target>
   9.248 +    <target name="-init-macrodef-property">
   9.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.250 +            <attribute name="name"/>
   9.251 +            <attribute name="value"/>
   9.252 +            <sequential>
   9.253 +                <property name="@{name}" value="${@{value}}"/>
   9.254 +            </sequential>
   9.255 +        </macrodef>
   9.256 +    </target>
   9.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   9.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.259 +            <attribute default="${src.dir}" name="srcdir"/>
   9.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
   9.261 +            <attribute default="${javac.classpath}" name="classpath"/>
   9.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   9.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   9.264 +            <attribute default="${includes}" name="includes"/>
   9.265 +            <attribute default="${excludes}" name="excludes"/>
   9.266 +            <attribute default="${javac.debug}" name="debug"/>
   9.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
   9.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   9.269 +            <element name="customize" optional="true"/>
   9.270 +            <sequential>
   9.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
   9.272 +                <mkdir dir="${empty.dir}"/>
   9.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   9.274 +                <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}">
   9.275 +                    <src>
   9.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   9.277 +                            <include name="*"/>
   9.278 +                        </dirset>
   9.279 +                    </src>
   9.280 +                    <classpath>
   9.281 +                        <path path="@{classpath}"/>
   9.282 +                    </classpath>
   9.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.284 +                    <compilerarg line="${javac.compilerargs}"/>
   9.285 +                    <compilerarg value="-processorpath"/>
   9.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   9.287 +                    <compilerarg line="${ap.processors.internal}"/>
   9.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   9.289 +                    <compilerarg value="-s"/>
   9.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   9.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
   9.292 +                    <customize/>
   9.293 +                </javac>
   9.294 +            </sequential>
   9.295 +        </macrodef>
   9.296 +    </target>
   9.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   9.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.299 +            <attribute default="${src.dir}" name="srcdir"/>
   9.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
   9.301 +            <attribute default="${javac.classpath}" name="classpath"/>
   9.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   9.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   9.304 +            <attribute default="${includes}" name="includes"/>
   9.305 +            <attribute default="${excludes}" name="excludes"/>
   9.306 +            <attribute default="${javac.debug}" name="debug"/>
   9.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
   9.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   9.309 +            <element name="customize" optional="true"/>
   9.310 +            <sequential>
   9.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
   9.312 +                <mkdir dir="${empty.dir}"/>
   9.313 +                <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}">
   9.314 +                    <src>
   9.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   9.316 +                            <include name="*"/>
   9.317 +                        </dirset>
   9.318 +                    </src>
   9.319 +                    <classpath>
   9.320 +                        <path path="@{classpath}"/>
   9.321 +                    </classpath>
   9.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.323 +                    <compilerarg line="${javac.compilerargs}"/>
   9.324 +                    <customize/>
   9.325 +                </javac>
   9.326 +            </sequential>
   9.327 +        </macrodef>
   9.328 +    </target>
   9.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   9.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.331 +            <attribute default="${src.dir}" name="srcdir"/>
   9.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
   9.333 +            <attribute default="${javac.classpath}" name="classpath"/>
   9.334 +            <sequential>
   9.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
   9.336 +                    <classpath>
   9.337 +                        <path path="@{classpath}"/>
   9.338 +                    </classpath>
   9.339 +                </depend>
   9.340 +            </sequential>
   9.341 +        </macrodef>
   9.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
   9.344 +            <sequential>
   9.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
   9.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   9.347 +                    <path>
   9.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
   9.349 +                    </path>
   9.350 +                    <globmapper from="*.java" to="*.class"/>
   9.351 +                </pathconvert>
   9.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   9.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   9.354 +                <delete>
   9.355 +                    <files includesfile="${javac.includesfile.binary}"/>
   9.356 +                </delete>
   9.357 +                <delete>
   9.358 +                    <fileset file="${javac.includesfile.binary}"/>
   9.359 +                </delete>
   9.360 +            </sequential>
   9.361 +        </macrodef>
   9.362 +    </target>
   9.363 +    <target name="-init-macrodef-junit">
   9.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.365 +            <attribute default="${includes}" name="includes"/>
   9.366 +            <attribute default="${excludes}" name="excludes"/>
   9.367 +            <attribute default="**" name="testincludes"/>
   9.368 +            <sequential>
   9.369 +                <property name="junit.forkmode" value="perTest"/>
   9.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   9.371 +                    <batchtest todir="${build.test.results.dir}">
   9.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   9.373 +                            <filename name="@{testincludes}"/>
   9.374 +                        </fileset>
   9.375 +                    </batchtest>
   9.376 +                    <classpath>
   9.377 +                        <path path="${run.test.classpath}"/>
   9.378 +                    </classpath>
   9.379 +                    <syspropertyset>
   9.380 +                        <propertyref prefix="test-sys-prop."/>
   9.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.382 +                    </syspropertyset>
   9.383 +                    <formatter type="brief" usefile="false"/>
   9.384 +                    <formatter type="xml"/>
   9.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.386 +                    <jvmarg value="-ea"/>
   9.387 +                    <jvmarg line="${run.jvmargs}"/>
   9.388 +                </junit>
   9.389 +            </sequential>
   9.390 +        </macrodef>
   9.391 +    </target>
   9.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
   9.393 +    <target name="-profile-pre-init">
   9.394 +        <!-- Empty placeholder for easier customization. -->
   9.395 +        <!-- You can override this target in the ../build.xml file. -->
   9.396 +    </target>
   9.397 +    <target name="-profile-post-init">
   9.398 +        <!-- Empty placeholder for easier customization. -->
   9.399 +        <!-- You can override this target in the ../build.xml file. -->
   9.400 +    </target>
   9.401 +    <target name="-profile-init-macrodef-profile">
   9.402 +        <macrodef name="resolve">
   9.403 +            <attribute name="name"/>
   9.404 +            <attribute name="value"/>
   9.405 +            <sequential>
   9.406 +                <property name="@{name}" value="${env.@{value}}"/>
   9.407 +            </sequential>
   9.408 +        </macrodef>
   9.409 +        <macrodef name="profile">
   9.410 +            <attribute default="${main.class}" name="classname"/>
   9.411 +            <element name="customize" optional="true"/>
   9.412 +            <sequential>
   9.413 +                <property environment="env"/>
   9.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   9.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   9.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   9.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
   9.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   9.419 +                    <arg line="${application.args}"/>
   9.420 +                    <classpath>
   9.421 +                        <path path="${run.classpath}"/>
   9.422 +                    </classpath>
   9.423 +                    <syspropertyset>
   9.424 +                        <propertyref prefix="run-sys-prop."/>
   9.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   9.426 +                    </syspropertyset>
   9.427 +                    <customize/>
   9.428 +                </java>
   9.429 +            </sequential>
   9.430 +        </macrodef>
   9.431 +    </target>
   9.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
   9.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   9.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   9.435 +    </target>
   9.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   9.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.438 +            <attribute default="${main.class}" name="name"/>
   9.439 +            <attribute default="${debug.classpath}" name="classpath"/>
   9.440 +            <attribute default="" name="stopclassname"/>
   9.441 +            <sequential>
   9.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   9.443 +                    <classpath>
   9.444 +                        <path path="@{classpath}"/>
   9.445 +                    </classpath>
   9.446 +                </nbjpdastart>
   9.447 +            </sequential>
   9.448 +        </macrodef>
   9.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.450 +            <attribute default="${build.classes.dir}" name="dir"/>
   9.451 +            <sequential>
   9.452 +                <nbjpdareload>
   9.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
   9.454 +                        <include name="${fix.includes}*.class"/>
   9.455 +                    </fileset>
   9.456 +                </nbjpdareload>
   9.457 +            </sequential>
   9.458 +        </macrodef>
   9.459 +    </target>
   9.460 +    <target name="-init-debug-args">
   9.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   9.462 +        <condition property="have-jdk-older-than-1.4">
   9.463 +            <or>
   9.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
   9.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
   9.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
   9.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
   9.468 +            </or>
   9.469 +        </condition>
   9.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   9.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
   9.472 +        </condition>
   9.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   9.474 +            <os family="windows"/>
   9.475 +        </condition>
   9.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   9.477 +            <isset property="debug.transport"/>
   9.478 +        </condition>
   9.479 +    </target>
   9.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
   9.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.482 +            <attribute default="${main.class}" name="classname"/>
   9.483 +            <attribute default="${debug.classpath}" name="classpath"/>
   9.484 +            <element name="customize" optional="true"/>
   9.485 +            <sequential>
   9.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
   9.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.488 +                    <jvmarg line="${debug-args-line}"/>
   9.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   9.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   9.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   9.492 +                    <jvmarg line="${run.jvmargs}"/>
   9.493 +                    <classpath>
   9.494 +                        <path path="@{classpath}"/>
   9.495 +                    </classpath>
   9.496 +                    <syspropertyset>
   9.497 +                        <propertyref prefix="run-sys-prop."/>
   9.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   9.499 +                    </syspropertyset>
   9.500 +                    <customize/>
   9.501 +                </java>
   9.502 +            </sequential>
   9.503 +        </macrodef>
   9.504 +    </target>
   9.505 +    <target name="-init-macrodef-java">
   9.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.507 +            <attribute default="${main.class}" name="classname"/>
   9.508 +            <attribute default="${run.classpath}" name="classpath"/>
   9.509 +            <element name="customize" optional="true"/>
   9.510 +            <sequential>
   9.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
   9.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   9.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   9.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   9.515 +                    <jvmarg line="${run.jvmargs}"/>
   9.516 +                    <classpath>
   9.517 +                        <path path="@{classpath}"/>
   9.518 +                    </classpath>
   9.519 +                    <syspropertyset>
   9.520 +                        <propertyref prefix="run-sys-prop."/>
   9.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   9.522 +                    </syspropertyset>
   9.523 +                    <customize/>
   9.524 +                </java>
   9.525 +            </sequential>
   9.526 +        </macrodef>
   9.527 +    </target>
   9.528 +    <target name="-init-macrodef-copylibs">
   9.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   9.530 +            <attribute default="${manifest.file}" name="manifest"/>
   9.531 +            <element name="customize" optional="true"/>
   9.532 +            <sequential>
   9.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   9.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
   9.535 +                    <path path="${run.classpath}"/>
   9.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
   9.537 +                </pathconvert>
   9.538 +                <pathconvert pathsep=" " property="jar.classpath">
   9.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
   9.540 +                    <chainedmapper>
   9.541 +                        <flattenmapper/>
   9.542 +                        <globmapper from="*" to="lib/*"/>
   9.543 +                    </chainedmapper>
   9.544 +                </pathconvert>
   9.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   9.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   9.547 +                    <fileset dir="${build.classes.dir}"/>
   9.548 +                    <manifest>
   9.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
   9.550 +                        <customize/>
   9.551 +                    </manifest>
   9.552 +                </copylibs>
   9.553 +            </sequential>
   9.554 +        </macrodef>
   9.555 +    </target>
   9.556 +    <target name="-init-presetdef-jar">
   9.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   9.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   9.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
   9.560 +            </jar>
   9.561 +        </presetdef>
   9.562 +    </target>
   9.563 +    <target name="-init-ap-cmdline-properties">
   9.564 +        <property name="annotation.processing.enabled" value="true"/>
   9.565 +        <property name="annotation.processing.processors.list" value=""/>
   9.566 +        <property name="annotation.processing.processor.options" value=""/>
   9.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
   9.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
   9.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
   9.570 +        <condition property="ap.supported.internal" value="true">
   9.571 +            <not>
   9.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
   9.573 +            </not>
   9.574 +        </condition>
   9.575 +    </target>
   9.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
   9.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
   9.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
   9.579 +        </condition>
   9.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
   9.581 +            <isfalse value="${annotation.processing.enabled}"/>
   9.582 +        </condition>
   9.583 +    </target>
   9.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   9.585 +        <property name="ap.cmd.line.internal" value=""/>
   9.586 +    </target>
   9.587 +    <target depends="-pre-init,-init-private,-init-libraries,-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"/>
   9.588 +    <!--
   9.589 +                ===================
   9.590 +                COMPILATION SECTION
   9.591 +                ===================
   9.592 +            -->
   9.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
   9.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
   9.595 +        <delete file="${built-jar.properties}" quiet="true"/>
   9.596 +    </target>
   9.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
   9.598 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
   9.599 +    </target>
   9.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
   9.601 +        <mkdir dir="${build.dir}"/>
   9.602 +        <touch file="${built-jar.properties}" verbose="false"/>
   9.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
   9.604 +        <antcall target="-warn-already-built-jar"/>
   9.605 +        <propertyfile file="${built-jar.properties}">
   9.606 +            <entry key="${basedir}" value=""/>
   9.607 +        </propertyfile>
   9.608 +    </target>
   9.609 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
   9.610 +    <target depends="init" name="-check-automatic-build">
   9.611 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   9.612 +    </target>
   9.613 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
   9.614 +        <antcall target="clean"/>
   9.615 +    </target>
   9.616 +    <target depends="init,deps-jar" name="-pre-pre-compile">
   9.617 +        <mkdir dir="${build.classes.dir}"/>
   9.618 +    </target>
   9.619 +    <target name="-pre-compile">
   9.620 +        <!-- Empty placeholder for easier customization. -->
   9.621 +        <!-- You can override this target in the ../build.xml file. -->
   9.622 +    </target>
   9.623 +    <target if="do.depend.true" name="-compile-depend">
   9.624 +        <pathconvert property="build.generated.subdirs">
   9.625 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   9.626 +                <include name="*"/>
   9.627 +            </dirset>
   9.628 +        </pathconvert>
   9.629 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
   9.630 +    </target>
   9.631 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
   9.632 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
   9.633 +        <copy todir="${build.classes.dir}">
   9.634 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   9.635 +        </copy>
   9.636 +    </target>
   9.637 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
   9.638 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   9.639 +        <copy todir="${build.classes.dir}/META-INF">
   9.640 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
   9.641 +        </copy>
   9.642 +    </target>
   9.643 +    <target name="-post-compile">
   9.644 +        <!-- Empty placeholder for easier customization. -->
   9.645 +        <!-- You can override this target in the ../build.xml file. -->
   9.646 +    </target>
   9.647 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
   9.648 +    <target name="-pre-compile-single">
   9.649 +        <!-- Empty placeholder for easier customization. -->
   9.650 +        <!-- You can override this target in the ../build.xml file. -->
   9.651 +    </target>
   9.652 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   9.653 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   9.654 +        <j2seproject3:force-recompile/>
   9.655 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   9.656 +    </target>
   9.657 +    <target name="-post-compile-single">
   9.658 +        <!-- Empty placeholder for easier customization. -->
   9.659 +        <!-- You can override this target in the ../build.xml file. -->
   9.660 +    </target>
   9.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   9.662 +    <!--
   9.663 +                ====================
   9.664 +                JAR BUILDING SECTION
   9.665 +                ====================
   9.666 +            -->
   9.667 +    <target depends="init" name="-pre-pre-jar">
   9.668 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
   9.669 +        <mkdir dir="${dist.jar.dir}"/>
   9.670 +    </target>
   9.671 +    <target name="-pre-jar">
   9.672 +        <!-- Empty placeholder for easier customization. -->
   9.673 +        <!-- You can override this target in the ../build.xml file. -->
   9.674 +    </target>
   9.675 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   9.676 +        <j2seproject1:jar/>
   9.677 +    </target>
   9.678 +    <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">
   9.679 +        <j2seproject1:jar manifest="${manifest.file}"/>
   9.680 +    </target>
   9.681 +    <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">
   9.682 +        <j2seproject1:jar manifest="${manifest.file}">
   9.683 +            <j2seproject1:manifest>
   9.684 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
   9.685 +            </j2seproject1:manifest>
   9.686 +        </j2seproject1:jar>
   9.687 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   9.688 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   9.689 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   9.690 +        <pathconvert property="run.classpath.with.dist.jar">
   9.691 +            <path path="${run.classpath}"/>
   9.692 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   9.693 +        </pathconvert>
   9.694 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   9.695 +    </target>
   9.696 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
   9.697 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   9.698 +        <touch file="${tmp.manifest.file}" verbose="false"/>
   9.699 +    </target>
   9.700 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
   9.701 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   9.702 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
   9.703 +    </target>
   9.704 +    <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">
   9.705 +        <manifest file="${tmp.manifest.file}" mode="update">
   9.706 +            <attribute name="Main-Class" value="${main.class}"/>
   9.707 +        </manifest>
   9.708 +    </target>
   9.709 +    <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">
   9.710 +        <basename file="${application.splash}" property="splashscreen.basename"/>
   9.711 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   9.712 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   9.713 +        <manifest file="${tmp.manifest.file}" mode="update">
   9.714 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   9.715 +        </manifest>
   9.716 +    </target>
   9.717 +    <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">
   9.718 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   9.719 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   9.720 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   9.721 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   9.722 +    </target>
   9.723 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
   9.724 +        <delete>
   9.725 +            <fileset file="${tmp.manifest.file}"/>
   9.726 +        </delete>
   9.727 +    </target>
   9.728 +    <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"/>
   9.729 +    <target name="-post-jar">
   9.730 +        <!-- Empty placeholder for easier customization. -->
   9.731 +        <!-- You can override this target in the ../build.xml file. -->
   9.732 +    </target>
   9.733 +    <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"/>
   9.734 +    <!--
   9.735 +                =================
   9.736 +                EXECUTION SECTION
   9.737 +                =================
   9.738 +            -->
   9.739 +    <target depends="init,compile" description="Run a main class." name="run">
   9.740 +        <j2seproject1:java>
   9.741 +            <customize>
   9.742 +                <arg line="${application.args}"/>
   9.743 +            </customize>
   9.744 +        </j2seproject1:java>
   9.745 +    </target>
   9.746 +    <target name="-do-not-recompile">
   9.747 +        <property name="javac.includes.binary" value=""/>
   9.748 +    </target>
   9.749 +    <target depends="init,compile-single" name="run-single">
   9.750 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   9.751 +        <j2seproject1:java classname="${run.class}"/>
   9.752 +    </target>
   9.753 +    <target depends="init,compile-test-single" name="run-test-with-main">
   9.754 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   9.755 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   9.756 +    </target>
   9.757 +    <!--
   9.758 +                =================
   9.759 +                DEBUGGING SECTION
   9.760 +                =================
   9.761 +            -->
   9.762 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
   9.763 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
   9.764 +    </target>
   9.765 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
   9.766 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
   9.767 +    </target>
   9.768 +    <target depends="init,compile" name="-debug-start-debuggee">
   9.769 +        <j2seproject3:debug>
   9.770 +            <customize>
   9.771 +                <arg line="${application.args}"/>
   9.772 +            </customize>
   9.773 +        </j2seproject3:debug>
   9.774 +    </target>
   9.775 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
   9.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
   9.777 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
   9.778 +    </target>
   9.779 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
   9.780 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
   9.781 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   9.782 +        <j2seproject3:debug classname="${debug.class}"/>
   9.783 +    </target>
   9.784 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   9.785 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
   9.786 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   9.787 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
   9.788 +    </target>
   9.789 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
   9.790 +    <target depends="init" name="-pre-debug-fix">
   9.791 +        <fail unless="fix.includes">Must set fix.includes</fail>
   9.792 +        <property name="javac.includes" value="${fix.includes}.java"/>
   9.793 +    </target>
   9.794 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
   9.795 +        <j2seproject1:nbjpdareload/>
   9.796 +    </target>
   9.797 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
   9.798 +    <!--
   9.799 +                =================
   9.800 +                PROFILING SECTION
   9.801 +                =================
   9.802 +            -->
   9.803 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
   9.804 +        <nbprofiledirect>
   9.805 +            <classpath>
   9.806 +                <path path="${run.classpath}"/>
   9.807 +            </classpath>
   9.808 +        </nbprofiledirect>
   9.809 +        <profile/>
   9.810 +    </target>
   9.811 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
   9.812 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
   9.813 +        <nbprofiledirect>
   9.814 +            <classpath>
   9.815 +                <path path="${run.classpath}"/>
   9.816 +            </classpath>
   9.817 +        </nbprofiledirect>
   9.818 +        <profile classname="${profile.class}"/>
   9.819 +    </target>
   9.820 +    <!--
   9.821 +                =========================
   9.822 +                APPLET PROFILING  SECTION
   9.823 +                =========================
   9.824 +            -->
   9.825 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
   9.826 +        <nbprofiledirect>
   9.827 +            <classpath>
   9.828 +                <path path="${run.classpath}"/>
   9.829 +            </classpath>
   9.830 +        </nbprofiledirect>
   9.831 +        <profile classname="sun.applet.AppletViewer">
   9.832 +            <customize>
   9.833 +                <arg value="${applet.url}"/>
   9.834 +            </customize>
   9.835 +        </profile>
   9.836 +    </target>
   9.837 +    <!--
   9.838 +                =========================
   9.839 +                TESTS PROFILING  SECTION
   9.840 +                =========================
   9.841 +            -->
   9.842 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
   9.843 +        <nbprofiledirect>
   9.844 +            <classpath>
   9.845 +                <path path="${run.test.classpath}"/>
   9.846 +            </classpath>
   9.847 +        </nbprofiledirect>
   9.848 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
   9.849 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   9.850 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
   9.851 +            <jvmarg line="${profiler.info.jvmargs}"/>
   9.852 +            <test name="${profile.class}"/>
   9.853 +            <classpath>
   9.854 +                <path path="${run.test.classpath}"/>
   9.855 +            </classpath>
   9.856 +            <syspropertyset>
   9.857 +                <propertyref prefix="test-sys-prop."/>
   9.858 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.859 +            </syspropertyset>
   9.860 +            <formatter type="brief" usefile="false"/>
   9.861 +            <formatter type="xml"/>
   9.862 +        </junit>
   9.863 +    </target>
   9.864 +    <!--
   9.865 +                ===============
   9.866 +                JAVADOC SECTION
   9.867 +                ===============
   9.868 +            -->
   9.869 +    <target depends="init" if="have.sources" name="-javadoc-build">
   9.870 +        <mkdir dir="${dist.javadoc.dir}"/>
   9.871 +        <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}">
   9.872 +            <classpath>
   9.873 +                <path path="${javac.classpath}"/>
   9.874 +            </classpath>
   9.875 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
   9.876 +                <filename name="**/*.java"/>
   9.877 +            </fileset>
   9.878 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   9.879 +                <include name="**/*.java"/>
   9.880 +                <exclude name="*.java"/>
   9.881 +            </fileset>
   9.882 +        </javadoc>
   9.883 +        <copy todir="${dist.javadoc.dir}">
   9.884 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
   9.885 +                <filename name="**/doc-files/**"/>
   9.886 +            </fileset>
   9.887 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   9.888 +                <include name="**/doc-files/**"/>
   9.889 +            </fileset>
   9.890 +        </copy>
   9.891 +    </target>
   9.892 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
   9.893 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
   9.894 +    </target>
   9.895 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
   9.896 +    <!--
   9.897 +                =========================
   9.898 +                JUNIT COMPILATION SECTION
   9.899 +                =========================
   9.900 +            -->
   9.901 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
   9.902 +        <mkdir dir="${build.test.classes.dir}"/>
   9.903 +    </target>
   9.904 +    <target name="-pre-compile-test">
   9.905 +        <!-- Empty placeholder for easier customization. -->
   9.906 +        <!-- You can override this target in the ../build.xml file. -->
   9.907 +    </target>
   9.908 +    <target if="do.depend.true" name="-compile-test-depend">
   9.909 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
   9.910 +    </target>
   9.911 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
   9.912 +        <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}"/>
   9.913 +        <copy todir="${build.test.classes.dir}">
   9.914 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   9.915 +        </copy>
   9.916 +    </target>
   9.917 +    <target name="-post-compile-test">
   9.918 +        <!-- Empty placeholder for easier customization. -->
   9.919 +        <!-- You can override this target in the ../build.xml file. -->
   9.920 +    </target>
   9.921 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
   9.922 +    <target name="-pre-compile-test-single">
   9.923 +        <!-- Empty placeholder for easier customization. -->
   9.924 +        <!-- You can override this target in the ../build.xml file. -->
   9.925 +    </target>
   9.926 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
   9.927 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   9.928 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
   9.929 +        <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}"/>
   9.930 +        <copy todir="${build.test.classes.dir}">
   9.931 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   9.932 +        </copy>
   9.933 +    </target>
   9.934 +    <target name="-post-compile-test-single">
   9.935 +        <!-- Empty placeholder for easier customization. -->
   9.936 +        <!-- You can override this target in the ../build.xml file. -->
   9.937 +    </target>
   9.938 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
   9.939 +    <!--
   9.940 +                =======================
   9.941 +                JUNIT EXECUTION SECTION
   9.942 +                =======================
   9.943 +            -->
   9.944 +    <target depends="init" if="have.tests" name="-pre-test-run">
   9.945 +        <mkdir dir="${build.test.results.dir}"/>
   9.946 +    </target>
   9.947 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
   9.948 +        <j2seproject3:junit testincludes="**/*Test.java"/>
   9.949 +    </target>
   9.950 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
   9.951 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   9.952 +    </target>
   9.953 +    <target depends="init" if="have.tests" name="test-report"/>
   9.954 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
   9.955 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
   9.956 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
   9.957 +        <mkdir dir="${build.test.results.dir}"/>
   9.958 +    </target>
   9.959 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
   9.960 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
   9.961 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
   9.962 +    </target>
   9.963 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
   9.964 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   9.965 +    </target>
   9.966 +    <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"/>
   9.967 +    <!--
   9.968 +                =======================
   9.969 +                JUNIT DEBUGGING SECTION
   9.970 +                =======================
   9.971 +            -->
   9.972 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
   9.973 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
   9.974 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
   9.975 +        <delete file="${test.report.file}"/>
   9.976 +        <mkdir dir="${build.test.results.dir}"/>
   9.977 +        <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}">
   9.978 +            <customize>
   9.979 +                <syspropertyset>
   9.980 +                    <propertyref prefix="test-sys-prop."/>
   9.981 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
   9.982 +                </syspropertyset>
   9.983 +                <arg value="${test.class}"/>
   9.984 +                <arg value="showoutput=true"/>
   9.985 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
   9.986 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
   9.987 +            </customize>
   9.988 +        </j2seproject3:debug>
   9.989 +    </target>
   9.990 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
   9.991 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
   9.992 +    </target>
   9.993 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
   9.994 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
   9.995 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
   9.996 +    </target>
   9.997 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
   9.998 +    <!--
   9.999 +                =========================
  9.1000 +                APPLET EXECUTION SECTION
  9.1001 +                =========================
  9.1002 +            -->
  9.1003 +    <target depends="init,compile-single" name="run-applet">
  9.1004 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  9.1005 +        <j2seproject1:java classname="sun.applet.AppletViewer">
  9.1006 +            <customize>
  9.1007 +                <arg value="${applet.url}"/>
  9.1008 +            </customize>
  9.1009 +        </j2seproject1:java>
  9.1010 +    </target>
  9.1011 +    <!--
  9.1012 +                =========================
  9.1013 +                APPLET DEBUGGING  SECTION
  9.1014 +                =========================
  9.1015 +            -->
  9.1016 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  9.1017 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  9.1018 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
  9.1019 +            <customize>
  9.1020 +                <arg value="${applet.url}"/>
  9.1021 +            </customize>
  9.1022 +        </j2seproject3:debug>
  9.1023 +    </target>
  9.1024 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  9.1025 +    <!--
  9.1026 +                ===============
  9.1027 +                CLEANUP SECTION
  9.1028 +                ===============
  9.1029 +            -->
  9.1030 +    <target name="-deps-clean-init" unless="built-clean.properties">
  9.1031 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  9.1032 +        <delete file="${built-clean.properties}" quiet="true"/>
  9.1033 +    </target>
  9.1034 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  9.1035 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
  9.1036 +    </target>
  9.1037 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  9.1038 +        <mkdir dir="${build.dir}"/>
  9.1039 +        <touch file="${built-clean.properties}" verbose="false"/>
  9.1040 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  9.1041 +        <antcall target="-warn-already-built-clean"/>
  9.1042 +        <propertyfile file="${built-clean.properties}">
  9.1043 +            <entry key="${basedir}" value=""/>
  9.1044 +        </propertyfile>
  9.1045 +    </target>
  9.1046 +    <target depends="init" name="-do-clean">
  9.1047 +        <delete dir="${build.dir}"/>
  9.1048 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  9.1049 +    </target>
  9.1050 +    <target name="-post-clean">
  9.1051 +        <!-- Empty placeholder for easier customization. -->
  9.1052 +        <!-- You can override this target in the ../build.xml file. -->
  9.1053 +    </target>
  9.1054 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  9.1055 +    <target name="-check-call-dep">
  9.1056 +        <property file="${call.built.properties}" prefix="already.built."/>
  9.1057 +        <condition property="should.call.dep">
  9.1058 +            <not>
  9.1059 +                <isset property="already.built.${call.subproject}"/>
  9.1060 +            </not>
  9.1061 +        </condition>
  9.1062 +    </target>
  9.1063 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  9.1064 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  9.1065 +            <propertyset>
  9.1066 +                <propertyref prefix="transfer."/>
  9.1067 +                <mapper from="transfer.*" to="*" type="glob"/>
  9.1068 +            </propertyset>
  9.1069 +        </ant>
  9.1070 +    </target>
  9.1071 +</project>
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/server/backend/base.web.api/nbproject/genfiles.properties	Mon Jun 20 23:28:38 2011 +0200
    10.3 @@ -0,0 +1,8 @@
    10.4 +build.xml.data.CRC32=a7c02ab2
    10.5 +build.xml.script.CRC32=f51e627e
    10.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
    10.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    10.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    10.9 +nbproject/build-impl.xml.data.CRC32=a7c02ab2
   10.10 +nbproject/build-impl.xml.script.CRC32=e2e70d24
   10.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/server/backend/base.web.api/nbproject/project.properties	Mon Jun 20 23:28:38 2011 +0200
    11.3 @@ -0,0 +1,81 @@
    11.4 +annotation.processing.enabled=true
    11.5 +annotation.processing.enabled.in.editor=false
    11.6 +annotation.processing.processor.options=
    11.7 +annotation.processing.processors.list=
    11.8 +annotation.processing.run.all.processors=true
    11.9 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   11.10 +build.classes.dir=${build.dir}/classes
   11.11 +build.classes.excludes=**/*.java,**/*.form
   11.12 +# This directory is removed when the project is cleaned:
   11.13 +build.dir=build
   11.14 +build.generated.dir=${build.dir}/generated
   11.15 +build.generated.sources.dir=${build.dir}/generated-sources
   11.16 +# Only compile against the classpath explicitly listed here:
   11.17 +build.sysclasspath=ignore
   11.18 +build.test.classes.dir=${build.dir}/test/classes
   11.19 +build.test.results.dir=${build.dir}/test/results
   11.20 +# Uncomment to specify the preferred debugger connection transport:
   11.21 +#debug.transport=dt_socket
   11.22 +debug.classpath=\
   11.23 +    ${run.classpath}
   11.24 +debug.test.classpath=\
   11.25 +    ${run.test.classpath}
   11.26 +# This directory is removed when the project is cleaned:
   11.27 +dist.dir=dist
   11.28 +dist.jar=${dist.dir}/base.web.api.jar
   11.29 +dist.javadoc.dir=${dist.dir}/javadoc
   11.30 +excludes=
   11.31 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
   11.32 +file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
   11.33 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
   11.34 +file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
   11.35 +includes=**
   11.36 +jar.compress=false
   11.37 +javac.classpath=\
   11.38 +    ${libs.freemarker.classpath}:\
   11.39 +    ${libs.jersey.classpath}:\
   11.40 +    ${file.reference.org-openide-filesystems.jar}:\
   11.41 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
   11.42 +    ${file.reference.org-openide-util-lookup.jar}:\
   11.43 +    ${file.reference.org-netbeans-modules-java-source.jar}
   11.44 +# Space-separated list of extra javac options
   11.45 +javac.compilerargs=
   11.46 +javac.deprecation=false
   11.47 +javac.processorpath=\
   11.48 +    ${javac.classpath}
   11.49 +javac.source=1.6
   11.50 +javac.target=1.6
   11.51 +javac.test.classpath=\
   11.52 +    ${javac.classpath}:\
   11.53 +    ${build.classes.dir}
   11.54 +javac.test.processorpath=\
   11.55 +    ${javac.test.classpath}
   11.56 +javadoc.additionalparam=
   11.57 +javadoc.author=false
   11.58 +javadoc.encoding=${source.encoding}
   11.59 +javadoc.noindex=false
   11.60 +javadoc.nonavbar=false
   11.61 +javadoc.notree=false
   11.62 +javadoc.private=false
   11.63 +javadoc.splitindex=true
   11.64 +javadoc.use=true
   11.65 +javadoc.version=false
   11.66 +javadoc.windowtitle=
   11.67 +main.class=org.netbeans.modules.jackpot30.backend.base.BaseWebApi
   11.68 +manifest.file=manifest.mf
   11.69 +meta.inf.dir=${src.dir}/META-INF
   11.70 +mkdist.disabled=false
   11.71 +platform.active=default_platform
   11.72 +run.classpath=\
   11.73 +    ${javac.classpath}:\
   11.74 +    ${build.classes.dir}
   11.75 +# Space-separated list of JVM arguments used when running the project
   11.76 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
   11.77 +# or test-sys-prop.name=value to set system properties for unit tests):
   11.78 +run.jvmargs=
   11.79 +run.test.classpath=\
   11.80 +    ${javac.test.classpath}:\
   11.81 +    ${build.test.classes.dir}
   11.82 +source.encoding=UTF-8
   11.83 +src.dir=src
   11.84 +test.src.dir=test
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/server/backend/base.web.api/nbproject/project.xml	Mon Jun 20 23:28:38 2011 +0200
    12.3 @@ -0,0 +1,18 @@
    12.4 +<?xml version="1.0" encoding="UTF-8"?>
    12.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    12.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    12.7 +    <configuration>
    12.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    12.9 +            <name>base.web.api</name>
   12.10 +            <source-roots>
   12.11 +                <root id="src.dir"/>
   12.12 +            </source-roots>
   12.13 +            <test-roots>
   12.14 +                <root id="test.src.dir"/>
   12.15 +            </test-roots>
   12.16 +        </data>
   12.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
   12.18 +            <definitions>../../lib/nblibraries.properties</definitions>
   12.19 +        </libraries>
   12.20 +    </configuration>
   12.21 +</project>
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java	Mon Jun 20 23:28:38 2011 +0200
    13.3 @@ -0,0 +1,141 @@
    13.4 +/*
    13.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    13.6 + *
    13.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    13.8 + *
    13.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   13.10 + * Other names may be trademarks of their respective owners.
   13.11 + *
   13.12 + * The contents of this file are subject to the terms of either the GNU
   13.13 + * General Public License Version 2 only ("GPL") or the Common
   13.14 + * Development and Distribution License("CDDL") (collectively, the
   13.15 + * "License"). You may not use this file except in compliance with the
   13.16 + * License. You can obtain a copy of the License at
   13.17 + * http://www.netbeans.org/cddl-gplv2.html
   13.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   13.19 + * specific language governing permissions and limitations under the
   13.20 + * License.  When distributing the software, include this License Header
   13.21 + * Notice in each file and include the License file at
   13.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   13.23 + * particular file as subject to the "Classpath" exception as provided
   13.24 + * by Oracle in the GPL Version 2 section of the License file that
   13.25 + * accompanied this code. If applicable, add the following below the
   13.26 + * License Header, with the fields enclosed by brackets [] replaced by
   13.27 + * your own identifying information:
   13.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   13.29 + *
   13.30 + * If you wish your version of this file to be governed by only the CDDL
   13.31 + * or only the GPL Version 2, indicate your decision by adding
   13.32 + * "[Contributor] elects to include this software in this distribution
   13.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   13.34 + * single choice of license, a recipient has the option to distribute
   13.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   13.36 + * to extend the choice of license to its licensees as provided above.
   13.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   13.38 + * Version 2 license, then the option applies only if the new code is
   13.39 + * made subject to such option by the copyright holder.
   13.40 + *
   13.41 + * Contributor(s):
   13.42 + *
   13.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   13.44 + */
   13.45 +package org.netbeans.modules.jackpot30.backend.base;
   13.46 +
   13.47 +import java.io.File;
   13.48 +import java.io.IOException;
   13.49 +import java.lang.reflect.Field;
   13.50 +import java.net.URL;
   13.51 +import java.util.ArrayList;
   13.52 +import java.util.Collections;
   13.53 +import java.util.HashSet;
   13.54 +import java.util.List;
   13.55 +import java.util.Map;
   13.56 +import java.util.Set;
   13.57 +import java.util.logging.Level;
   13.58 +import java.util.logging.Logger;
   13.59 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
   13.60 +import org.openide.filesystems.FileObject;
   13.61 +import org.openide.filesystems.FileUtil;
   13.62 +
   13.63 +/**
   13.64 + *
   13.65 + * @author lahvac
   13.66 + */
   13.67 +public class CategoryStorage {
   13.68 +
   13.69 +    public static void setCacheRoot(File cacheRoot) {
   13.70 +        CategoryStorage.cacheRoot = cacheRoot;
   13.71 +    }
   13.72 +
   13.73 +    private static File cacheRoot;
   13.74 +
   13.75 +    public static Iterable<? extends CategoryStorage> listCategories() {
   13.76 +        List<CategoryStorage> result = new ArrayList<CategoryStorage>();
   13.77 +
   13.78 +        for (File cat : cacheRoot.listFiles()) {
   13.79 +            result.add(new CategoryStorage(cat.getName()));
   13.80 +        }
   13.81 +
   13.82 +        return result;
   13.83 +    }
   13.84 +
   13.85 +    public static CategoryStorage forId(String id) {
   13.86 +        for (CategoryStorage s : listCategories()) {
   13.87 +            if (s.id.equals(id)) return s;
   13.88 +        }
   13.89 +
   13.90 +        return null;
   13.91 +    }
   13.92 +    
   13.93 +    private final String id;
   13.94 +
   13.95 +    private CategoryStorage(String id) {
   13.96 +        this.id = id;
   13.97 +    }
   13.98 +
   13.99 +    public Iterable<? extends URL> getCategoryIndexFolders() {
  13.100 +        try {
  13.101 +            FileObject root = getCacheRoot();
  13.102 +            CacheFolder.setCacheFolder(root);
  13.103 +            Set<URL> result = new HashSet<URL>();
  13.104 +
  13.105 +            CacheFolder.getDataFolder(new URL("file:/"), true);
  13.106 +            
  13.107 +            //XXX:
  13.108 +            Field invertedSegmentsField = CacheFolder.class.getDeclaredField("invertedSegments");
  13.109 +
  13.110 +            invertedSegmentsField.setAccessible(true);
  13.111 +            
  13.112 +            Map<String, String> invertedSegments = (Map<String, String>) invertedSegmentsField.get(null);
  13.113 +
  13.114 +            for (String c : invertedSegments.keySet()) {
  13.115 +                result.add(new URL(c));
  13.116 +            }
  13.117 +
  13.118 +            return result;
  13.119 +        } catch (IllegalArgumentException ex) {
  13.120 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  13.121 +        } catch (IllegalAccessException ex) {
  13.122 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  13.123 +        } catch (NoSuchFieldException ex) {
  13.124 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  13.125 +        } catch (SecurityException ex) {
  13.126 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  13.127 +        } catch (IOException ex) {
  13.128 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  13.129 +        }
  13.130 +        return Collections.emptyList();
  13.131 +    }
  13.132 +
  13.133 +    public String getId() {
  13.134 +        return id;
  13.135 +    }
  13.136 +
  13.137 +    public String getDisplayName() {
  13.138 +        return id;//XXX
  13.139 +    }
  13.140 +
  13.141 +    public FileObject getCacheRoot() {
  13.142 +        return FileUtil.toFileObject(FileUtil.normalizeFile(new File(cacheRoot, id)));
  13.143 +    }
  13.144 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java	Mon Jun 20 23:28:38 2011 +0200
    14.3 @@ -0,0 +1,94 @@
    14.4 +/*
    14.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    14.6 + *
    14.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    14.8 + *
    14.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   14.10 + * Other names may be trademarks of their respective owners.
   14.11 + *
   14.12 + * The contents of this file are subject to the terms of either the GNU
   14.13 + * General Public License Version 2 only ("GPL") or the Common
   14.14 + * Development and Distribution License("CDDL") (collectively, the
   14.15 + * "License"). You may not use this file except in compliance with the
   14.16 + * License. You can obtain a copy of the License at
   14.17 + * http://www.netbeans.org/cddl-gplv2.html
   14.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   14.19 + * specific language governing permissions and limitations under the
   14.20 + * License.  When distributing the software, include this License Header
   14.21 + * Notice in each file and include the License file at
   14.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   14.23 + * particular file as subject to the "Classpath" exception as provided
   14.24 + * by Oracle in the GPL Version 2 section of the License file that
   14.25 + * accompanied this code. If applicable, add the following below the
   14.26 + * License Header, with the fields enclosed by brackets [] replaced by
   14.27 + * your own identifying information:
   14.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   14.29 + *
   14.30 + * If you wish your version of this file to be governed by only the CDDL
   14.31 + * or only the GPL Version 2, indicate your decision by adding
   14.32 + * "[Contributor] elects to include this software in this distribution
   14.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   14.34 + * single choice of license, a recipient has the option to distribute
   14.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   14.36 + * to extend the choice of license to its licensees as provided above.
   14.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   14.38 + * Version 2 license, then the option applies only if the new code is
   14.39 + * made subject to such option by the copyright holder.
   14.40 + *
   14.41 + * Contributor(s):
   14.42 + *
   14.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   14.44 + */
   14.45 +package org.netbeans.modules.jackpot30.backend.base;
   14.46 +
   14.47 +import freemarker.cache.TemplateLoader;
   14.48 +import freemarker.template.Configuration;
   14.49 +import freemarker.template.Template;
   14.50 +import freemarker.template.TemplateException;
   14.51 +import java.io.IOException;
   14.52 +import java.io.InputStream;
   14.53 +import java.io.InputStreamReader;
   14.54 +import java.io.Reader;
   14.55 +import java.io.StringWriter;
   14.56 +import java.util.Map;
   14.57 +
   14.58 +/**
   14.59 + *
   14.60 + * @author lahvac
   14.61 + */
   14.62 +public class FreemarkerUtilities {
   14.63 +
   14.64 +    public static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
   14.65 +        Configuration conf = new Configuration();
   14.66 +
   14.67 +        conf.setTemplateLoader(new TemplateLoaderImpl());
   14.68 +
   14.69 +        Template templ = conf.getTemplate(template);
   14.70 +        StringWriter out = new StringWriter();
   14.71 +
   14.72 +        templ.process(configurationData, out);
   14.73 +
   14.74 +        return out.toString();
   14.75 +    }
   14.76 +
   14.77 +    private static final class TemplateLoaderImpl implements TemplateLoader {
   14.78 +
   14.79 +        public Object findTemplateSource(String name) throws IOException {
   14.80 +            return TemplateLoaderImpl.class.getResourceAsStream("/" + name);
   14.81 +        }
   14.82 +
   14.83 +        public long getLastModified(Object templateSource) {
   14.84 +            return 0L;
   14.85 +        }
   14.86 +
   14.87 +        public Reader getReader(Object templateSource, String encoding) throws IOException {
   14.88 +            InputStream in = (InputStream) templateSource;
   14.89 +
   14.90 +            return new InputStreamReader(in);
   14.91 +        }
   14.92 +
   14.93 +        public void closeTemplateSource(Object templateSource) throws IOException {
   14.94 +        }
   14.95 +    }
   14.96 +
   14.97 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java	Mon Jun 20 23:28:38 2011 +0200
    15.3 @@ -0,0 +1,72 @@
    15.4 +/*
    15.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    15.6 + *
    15.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    15.8 + *
    15.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   15.10 + * Other names may be trademarks of their respective owners.
   15.11 + *
   15.12 + * The contents of this file are subject to the terms of either the GNU
   15.13 + * General Public License Version 2 only ("GPL") or the Common
   15.14 + * Development and Distribution License("CDDL") (collectively, the
   15.15 + * "License"). You may not use this file except in compliance with the
   15.16 + * License. You can obtain a copy of the License at
   15.17 + * http://www.netbeans.org/cddl-gplv2.html
   15.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   15.19 + * specific language governing permissions and limitations under the
   15.20 + * License.  When distributing the software, include this License Header
   15.21 + * Notice in each file and include the License file at
   15.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   15.23 + * particular file as subject to the "Classpath" exception as provided
   15.24 + * by Oracle in the GPL Version 2 section of the License file that
   15.25 + * accompanied this code. If applicable, add the following below the
   15.26 + * License Header, with the fields enclosed by brackets [] replaced by
   15.27 + * your own identifying information:
   15.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   15.29 + *
   15.30 + * If you wish your version of this file to be governed by only the CDDL
   15.31 + * or only the GPL Version 2, indicate your decision by adding
   15.32 + * "[Contributor] elects to include this software in this distribution
   15.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   15.34 + * single choice of license, a recipient has the option to distribute
   15.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   15.36 + * to extend the choice of license to its licensees as provided above.
   15.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   15.38 + * Version 2 license, then the option applies only if the new code is
   15.39 + * made subject to such option by the copyright holder.
   15.40 + *
   15.41 + * Contributor(s):
   15.42 + *
   15.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   15.44 + */
   15.45 +package org.netbeans.modules.jackpot30.backend.base;
   15.46 +
   15.47 +import java.io.IOException;
   15.48 +import java.net.URL;
   15.49 +import java.net.URLConnection;
   15.50 +import java.net.URLStreamHandler;
   15.51 +import java.net.URLStreamHandlerFactory;
   15.52 +import org.openide.util.lookup.ServiceProvider;
   15.53 +
   15.54 +/**
   15.55 + *
   15.56 + * @author lahvac
   15.57 + */
   15.58 +@ServiceProvider(service=URLStreamHandlerFactory.class)
   15.59 +public class RelStreamHandlerFactory implements URLStreamHandlerFactory {
   15.60 +
   15.61 +    @Override
   15.62 +    public URLStreamHandler createURLStreamHandler(String protocol) {
   15.63 +        if ("rel".equals(protocol)) return new RelStreamHandler();
   15.64 +        return null;
   15.65 +    }
   15.66 +
   15.67 +    private static final class RelStreamHandler extends URLStreamHandler {
   15.68 +
   15.69 +        @Override protected URLConnection openConnection(URL u) throws IOException {
   15.70 +            throw new IOException("Cannot open");
   15.71 +        }
   15.72 +
   15.73 +    }
   15.74 +
   15.75 +}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java	Mon Jun 20 23:28:38 2011 +0200
    16.3 @@ -0,0 +1,137 @@
    16.4 +/*
    16.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    16.6 + *
    16.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    16.8 + *
    16.9 + * The contents of this file are subject to the terms of either the GNU
   16.10 + * General Public License Version 2 only ("GPL") or the Common
   16.11 + * Development and Distribution License("CDDL") (collectively, the
   16.12 + * "License"). You may not use this file except in compliance with the
   16.13 + * License. You can obtain a copy of the License at
   16.14 + * http://www.netbeans.org/cddl-gplv2.html
   16.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   16.16 + * specific language governing permissions and limitations under the
   16.17 + * License.  When distributing the software, include this License Header
   16.18 + * Notice in each file and include the License file at
   16.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   16.20 + * particular file as subject to the "Classpath" exception as provided
   16.21 + * by Sun in the GPL Version 2 section of the License file that
   16.22 + * accompanied this code. If applicable, add the following below the
   16.23 + * License Header, with the fields enclosed by brackets [] replaced by
   16.24 + * your own identifying information:
   16.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   16.26 + *
   16.27 + * If you wish your version of this file to be governed by only the CDDL
   16.28 + * or only the GPL Version 2, indicate your decision by adding
   16.29 + * "[Contributor] elects to include this software in this distribution
   16.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   16.31 + * single choice of license, a recipient has the option to distribute
   16.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   16.33 + * to extend the choice of license to its licensees as provided above.
   16.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   16.35 + * Version 2 license, then the option applies only if the new code is
   16.36 + * made subject to such option by the copyright holder.
   16.37 + *
   16.38 + * Contributor(s):
   16.39 + *
   16.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   16.41 + */
   16.42 +
   16.43 +package org.netbeans.modules.jackpot30.backend.base;
   16.44 +
   16.45 +import java.io.BufferedReader;
   16.46 +import java.io.IOException;
   16.47 +import java.io.InputStream;
   16.48 +import java.io.InputStreamReader;
   16.49 +import java.net.URI;
   16.50 +import java.net.URISyntaxException;
   16.51 +import java.net.URL;
   16.52 +import java.net.URLConnection;
   16.53 +import java.util.Collection;
   16.54 +import java.util.LinkedList;
   16.55 +import java.util.List;
   16.56 +import java.util.regex.Matcher;
   16.57 +import java.util.regex.Pattern;
   16.58 +
   16.59 +/**
   16.60 + *
   16.61 + */
   16.62 +public class WebUtilities {
   16.63 +
   16.64 +    private WebUtilities() {
   16.65 +    }
   16.66 +
   16.67 +    public static String requestStringResponse (URI uri) {
   16.68 +        final StringBuffer sb = new StringBuffer ();
   16.69 +        final URL url;
   16.70 +        try {
   16.71 +            url = uri.toURL();
   16.72 +            final URLConnection urlConnection = url.openConnection ();
   16.73 +            urlConnection.connect ();
   16.74 +            final Object content = urlConnection.getContent ();
   16.75 +//            System.out.println (content);
   16.76 +//            System.out.println (content.getClass ());
   16.77 +            final InputStream inputStream = (InputStream) content;
   16.78 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
   16.79 +            try {
   16.80 +                for (;;) {
   16.81 +                    String line = reader.readLine ();
   16.82 +                    if (line == null)
   16.83 +                        break;
   16.84 +                    sb.append (line).append ('\n');
   16.85 +                }
   16.86 +            } finally {
   16.87 +                reader.close ();
   16.88 +            }
   16.89 +        } catch (IOException e) {
   16.90 +            e.printStackTrace ();  // TODO
   16.91 +            return null;
   16.92 +        }
   16.93 +        return sb.toString ();
   16.94 +    }
   16.95 +    
   16.96 +    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
   16.97 +        final List<String> result = new LinkedList<String> ();
   16.98 +        final URL url;
   16.99 +        try {
  16.100 +            url = uri.toURL();
  16.101 +            final URLConnection urlConnection = url.openConnection ();
  16.102 +            urlConnection.connect ();
  16.103 +            final Object content = urlConnection.getContent ();
  16.104 +//            System.out.println (content);
  16.105 +//            System.out.println (content.getClass ());
  16.106 +            final InputStream inputStream = (InputStream) content;
  16.107 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
  16.108 +            try {
  16.109 +                for (;;) {
  16.110 +                    String line = reader.readLine ();
  16.111 +                    if (line == null)
  16.112 +                        break;
  16.113 +                    result.add (line);
  16.114 +                }
  16.115 +            } finally {
  16.116 +                reader.close ();
  16.117 +            }
  16.118 +        } catch (IOException e) {
  16.119 +            e.printStackTrace ();  // TODO
  16.120 +        }
  16.121 +        return result;
  16.122 +    }
  16.123 +
  16.124 +    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
  16.125 +    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
  16.126 +
  16.127 +    public static String escapeForHTMLElement(String input) {
  16.128 +        for (int cntr = 0; cntr < c.length; cntr++) {
  16.129 +            input = input.replaceAll(c[cntr], tags[cntr]);
  16.130 +        }
  16.131 +
  16.132 +        return input;
  16.133 +    }
  16.134 +
  16.135 +    public static String escapeForQuery(String pattern) throws URISyntaxException {
  16.136 +        if (pattern == null) return null;
  16.137 +        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
  16.138 +    }
  16.139 +
  16.140 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java	Mon Jun 20 23:28:38 2011 +0200
    17.3 @@ -0,0 +1,122 @@
    17.4 +/*
    17.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    17.6 + *
    17.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
    17.8 + *
    17.9 + * The contents of this file are subject to the terms of either the GNU
   17.10 + * General Public License Version 2 only ("GPL") or the Common
   17.11 + * Development and Distribution License("CDDL") (collectively, the
   17.12 + * "License"). You may not use this file except in compliance with the
   17.13 + * License. You can obtain a copy of the License at
   17.14 + * http://www.netbeans.org/cddl-gplv2.html
   17.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   17.16 + * specific language governing permissions and limitations under the
   17.17 + * License.  When distributing the software, include this License Header
   17.18 + * Notice in each file and include the License file at
   17.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   17.20 + * particular file as subject to the "Classpath" exception as provided
   17.21 + * by Sun in the GPL Version 2 section of the License file that
   17.22 + * accompanied this code. If applicable, add the following below the
   17.23 + * License Header, with the fields enclosed by brackets [] replaced by
   17.24 + * your own identifying information:
   17.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   17.26 + *
   17.27 + * If you wish your version of this file to be governed by only the CDDL
   17.28 + * or only the GPL Version 2, indicate your decision by adding
   17.29 + * "[Contributor] elects to include this software in this distribution
   17.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   17.31 + * single choice of license, a recipient has the option to distribute
   17.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   17.33 + * to extend the choice of license to its licensees as provided above.
   17.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   17.35 + * Version 2 license, then the option applies only if the new code is
   17.36 + * made subject to such option by the copyright holder.
   17.37 + *
   17.38 + * Contributor(s):
   17.39 + *
   17.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   17.41 + */
   17.42 +
   17.43 +package org.netbeans.modules.jackpot30.backend.base.api;
   17.44 +
   17.45 +import java.io.IOException;
   17.46 +import java.lang.reflect.Field;
   17.47 +import java.lang.reflect.InvocationTargetException;
   17.48 +import java.lang.reflect.Method;
   17.49 +import java.util.Arrays;
   17.50 +import java.util.Map;
   17.51 +import java.util.logging.Level;
   17.52 +import java.util.logging.Logger;
   17.53 +import javax.ws.rs.GET;
   17.54 +import javax.ws.rs.Path;
   17.55 +import javax.ws.rs.Produces;
   17.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   17.57 +import org.netbeans.modules.java.source.usages.ClassIndexImpl;
   17.58 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
   17.59 +
   17.60 +/**
   17.61 + *
   17.62 + * @author lahvac
   17.63 + */
   17.64 +@Path("/index")
   17.65 +public class API {
   17.66 +
   17.67 +    @GET
   17.68 +    @Path("/list")
   17.69 +    @Produces("text/plain")
   17.70 +    public String list() throws IOException {
   17.71 +        StringBuilder sb = new StringBuilder();
   17.72 +
   17.73 +        for (CategoryStorage c : CategoryStorage.listCategories()) {
   17.74 +            sb.append(c.getId());
   17.75 +            sb.append(":");
   17.76 +            sb.append(c.getDisplayName());
   17.77 +            sb.append("\n");
   17.78 +        }
   17.79 +
   17.80 +        return sb.toString();
   17.81 +    }
   17.82 +
   17.83 +    @GET
   17.84 +    @Path("/internal/indexUpdated")
   17.85 +    @Produces("test/plain")
   17.86 +    public String indexUpdated() throws IOException {
   17.87 +        //XXX: should allow individual providers to do their own cleanup:
   17.88 +        //XXX: synchronize with the queries!
   17.89 +        //XXX: well, still does not work!
   17.90 +
   17.91 +        try {
   17.92 +            for (String name : Arrays.asList("instances", "transientInstances")) {
   17.93 +                Field instances = ClassIndexManager.class.getDeclaredField(name);
   17.94 +
   17.95 +                instances.setAccessible(true);
   17.96 +
   17.97 +                Map<?, ClassIndexImpl> toClear = (Map<?, ClassIndexImpl>) instances.get(ClassIndexManager.getDefault());
   17.98 +
   17.99 +                for (ClassIndexImpl impl : toClear.values()) {
  17.100 +                    Method close = ClassIndexImpl.class.getDeclaredMethod("close");
  17.101 +
  17.102 +                    close.setAccessible(true);
  17.103 +                    close.invoke(impl);
  17.104 +                }
  17.105 +
  17.106 +                toClear.clear();
  17.107 +            }
  17.108 +        } catch (InvocationTargetException ex) {
  17.109 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.110 +        } catch (NoSuchMethodException ex) {
  17.111 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.112 +        } catch (IllegalArgumentException ex) {
  17.113 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.114 +        } catch (IllegalAccessException ex) {
  17.115 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.116 +        } catch (NoSuchFieldException ex) {
  17.117 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.118 +        } catch (SecurityException ex) {
  17.119 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  17.120 +        }
  17.121 +        
  17.122 +        return "Done";
  17.123 +    }
  17.124 +
  17.125 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/server/backend/build-indexing-backend	Mon Jun 20 23:28:38 2011 +0200
    18.3 @@ -0,0 +1,13 @@
    18.4 +#!/bin/bash -x
    18.5 +ant clean || exit 1
    18.6 +mkdir -p build/indexing-backend
    18.7 +ant build-zip && unzip -d build/indexing-backend dist/backend.zip && mv build/indexing-backend/backend build/indexing-backend/indexer || exit 1
    18.8 +mkdir -p build/indexing-backend/web
    18.9 +(cd web.main; ant clean && ant jar && cp -r dist/* ../build/indexing-backend/web) || exit 1
   18.10 +
   18.11 +cp scripts/* build/indexing-backend
   18.12 +
   18.13 +chmod u+x build/temp-indexing-backend/index
   18.14 +chmod u+x build/temp-indexing-backend/web
   18.15 +
   18.16 +(cd build; zip -r indexing-backend.zip indexing-backend)
    19.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/MainPage.java	Fri Jun 10 11:20:36 2011 -0400
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,59 +0,0 @@
    19.4 -/*
    19.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    19.6 - *
    19.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    19.8 - *
    19.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   19.10 - * Other names may be trademarks of their respective owners.
   19.11 - *
   19.12 - * The contents of this file are subject to the terms of either the GNU
   19.13 - * General Public License Version 2 only ("GPL") or the Common
   19.14 - * Development and Distribution License("CDDL") (collectively, the
   19.15 - * "License"). You may not use this file except in compliance with the
   19.16 - * License. You can obtain a copy of the License at
   19.17 - * http://www.netbeans.org/cddl-gplv2.html
   19.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   19.19 - * specific language governing permissions and limitations under the
   19.20 - * License.  When distributing the software, include this License Header
   19.21 - * Notice in each file and include the License file at
   19.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   19.23 - * particular file as subject to the "Classpath" exception as provided
   19.24 - * by Oracle in the GPL Version 2 section of the License file that
   19.25 - * accompanied this code. If applicable, add the following below the
   19.26 - * License Header, with the fields enclosed by brackets [] replaced by
   19.27 - * your own identifying information:
   19.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   19.29 - *
   19.30 - * If you wish your version of this file to be governed by only the CDDL
   19.31 - * or only the GPL Version 2, indicate your decision by adding
   19.32 - * "[Contributor] elects to include this software in this distribution
   19.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   19.34 - * single choice of license, a recipient has the option to distribute
   19.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   19.36 - * to extend the choice of license to its licensees as provided above.
   19.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   19.38 - * Version 2 license, then the option applies only if the new code is
   19.39 - * made subject to such option by the copyright holder.
   19.40 - *
   19.41 - * Contributor(s):
   19.42 - *
   19.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
   19.44 - */
   19.45 -
   19.46 -package org.netbeans.modules.jackpot30.backend.impl;
   19.47 -
   19.48 -import javax.ws.rs.GET;
   19.49 -import javax.ws.rs.Path;
   19.50 -
   19.51 -/**
   19.52 - *
   19.53 - * @author lahvac
   19.54 - */
   19.55 -@Path("/")
   19.56 -public class MainPage {
   19.57 -
   19.58 -    @GET
   19.59 -    public String main() {
   19.60 -        return "<html><body><ul><li><a href='index/ui/search'>Search Pattern</a></li><li><a href='index/ui/apply'>Apply Pattern</a></li></ul></body></html>";
   19.61 -    }
   19.62 -}
    20.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Fri Jun 10 11:20:36 2011 -0400
    20.2 +++ b/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Mon Jun 20 23:28:38 2011 +0200
    20.3 @@ -42,16 +42,18 @@
    20.4  
    20.5  package org.netbeans.modules.jackpot30.backend.impl;
    20.6  
    20.7 -import com.sun.jersey.api.container.httpserver.HttpServerFactory;
    20.8 -import com.sun.jersey.api.core.ClassNamesResourceConfig;
    20.9 -import com.sun.net.httpserver.HttpServer;
   20.10  import java.io.File;
   20.11 +import java.io.FileOutputStream;
   20.12  import java.io.IOException;
   20.13 +import java.io.InputStream;
   20.14  import java.util.Arrays;
   20.15  import java.util.HashSet;
   20.16  import java.util.Map;
   20.17 +import java.util.Properties;
   20.18  import java.util.Set;
   20.19  import java.util.concurrent.atomic.AtomicBoolean;
   20.20 +import java.util.jar.JarOutputStream;
   20.21 +import java.util.zip.ZipEntry;
   20.22  import org.netbeans.api.java.classpath.ClassPath;
   20.23  import org.netbeans.api.java.classpath.GlobalPathRegistry;
   20.24  import org.netbeans.api.java.source.SourceUtils;
   20.25 @@ -59,11 +61,11 @@
   20.26  import org.netbeans.api.project.ProjectManager;
   20.27  import org.netbeans.api.project.ProjectUtils;
   20.28  import org.netbeans.api.project.SourceGroup;
   20.29 +import org.netbeans.api.project.ui.OpenProjects;
   20.30  import org.netbeans.api.sendopts.CommandException;
   20.31 -import org.netbeans.modules.jackpot30.backend.impl.api.API;
   20.32 -import org.netbeans.modules.jackpot30.backend.impl.ui.UI;
   20.33  import org.netbeans.modules.jackpot30.impl.duplicates.indexing.DuplicatesCustomIndexerImpl;
   20.34  import org.netbeans.modules.jackpot30.impl.indexing.CustomIndexerImpl;
   20.35 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
   20.36  import org.netbeans.spi.java.classpath.support.ClassPathSupport;
   20.37  import org.netbeans.spi.project.support.ant.PropertyUtils;
   20.38  import org.netbeans.spi.sendopts.Env;
   20.39 @@ -82,14 +84,12 @@
   20.40  @ServiceProvider(service=OptionProcessor.class)
   20.41  public class OptionProcessorImpl extends OptionProcessor {
   20.42  
   20.43 -    private final Option SHUTDOWN = Option.withoutArgument(Option.NO_SHORT_NAME, "shutdown");
   20.44 -    private final Option RESTART = Option.withoutArgument(Option.NO_SHORT_NAME, "restart"); //XXX: does not currently work
   20.45 -    private final Option START_SERVER = Option.withoutArgument(Option.NO_SHORT_NAME, "start-server");
   20.46 -    private final Option INDEX = Option.withoutArgument(Option.NO_SHORT_NAME, "index");
   20.47      private final Option CATEGORY_ID = Option.requiredArgument(Option.NO_SHORT_NAME, "category-id");
   20.48      private final Option CATEGORY_NAME = Option.requiredArgument(Option.NO_SHORT_NAME, "category-name");
   20.49      private final Option CATEGORY_PROJECTS = Option.additionalArguments(Option.NO_SHORT_NAME, "category-projects");
   20.50 -    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(SHUTDOWN, RESTART, START_SERVER, INDEX, CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS));
   20.51 +    private final Option CATEGORY_ROOT_DIR = Option.requiredArgument(Option.NO_SHORT_NAME, "category-root-dir");
   20.52 +    private final Option CACHE_TARGET = Option.requiredArgument(Option.NO_SHORT_NAME, "cache-target");
   20.53 +    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS, CATEGORY_ROOT_DIR, CACHE_TARGET));
   20.54      
   20.55      @Override
   20.56      protected Set<Option> getOptions() {
   20.57 @@ -98,18 +98,6 @@
   20.58  
   20.59      @Override
   20.60      protected void process(Env env, Map<Option, String[]> optionValues) throws CommandException {
   20.61 -        if (optionValues.containsKey(RESTART)) {
   20.62 -            LifecycleManager.getDefault().markForRestart();
   20.63 -        }
   20.64 -
   20.65 -        if (optionValues.containsKey(SHUTDOWN) || optionValues.containsKey(RESTART)) {
   20.66 -            LifecycleManager.getDefault().exit();
   20.67 -        }
   20.68 -
   20.69 -        if (optionValues.containsKey(START_SERVER)) {
   20.70 -            startServer(env);
   20.71 -        }
   20.72 -
   20.73          String categoryId = null;
   20.74          String categoryName = null;
   20.75  
   20.76 @@ -139,20 +127,76 @@
   20.77              }
   20.78          }
   20.79  
   20.80 -        if (optionValues.containsKey(INDEX)) {
   20.81 -            if (categoryId == null) {
   20.82 -                env.getErrorStream().println("Error: no category-id specified!");
   20.83 -                return;
   20.84 +        String cacheTarget = optionValues.get(CACHE_TARGET)[0];
   20.85 +        File cache = FileUtil.normalizeFile(new File(cacheTarget));
   20.86 +
   20.87 +        cache.getParentFile().mkdirs();
   20.88 +
   20.89 +        if (categoryId == null) {
   20.90 +            env.getErrorStream().println("Error: no category-id specified!");
   20.91 +            return;
   20.92 +        }
   20.93 +
   20.94 +        try {
   20.95 +            indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
   20.96 +        } catch (InterruptedException ex) {
   20.97 +            throw (CommandException) new CommandException(0).initCause(ex);
   20.98 +        } catch (IOException ex) {
   20.99 +            throw (CommandException) new CommandException(0).initCause(ex);
  20.100 +        }
  20.101 +
  20.102 +        JarOutputStream out = null;
  20.103 +        InputStream segments = null;
  20.104 +
  20.105 +        try {
  20.106 +            FileObject cacheFolder = CacheFolder.getCacheFolder();
  20.107 +
  20.108 +            out = new JarOutputStream(new FileOutputStream(cache));
  20.109 +            pack(out, cacheFolder, categoryId, new StringBuilder());
  20.110 +
  20.111 +            segments = cacheFolder.getFileObject("segments").getInputStream();
  20.112 +            Properties in = new Properties();
  20.113 +
  20.114 +            in.load(segments);
  20.115 +
  20.116 +            segments.close();//XXX: should be in finally!
  20.117 +
  20.118 +            File baseDirFile = new File(optionValues.get(CATEGORY_ROOT_DIR)[0]);
  20.119 +            String baseDir = baseDirFile.toURI().toString();
  20.120 +
  20.121 +            Properties outSegments = new Properties();
  20.122 +
  20.123 +            for (String segment : in.stringPropertyNames()) {
  20.124 +                String url = in.getProperty(segment);
  20.125 +                String rel = url.startsWith(baseDir) ? "rel:/" + url.substring(baseDir.length()) : url;
  20.126 +
  20.127 +                outSegments.setProperty(segment, rel);
  20.128              }
  20.129 -            
  20.130 -            try {
  20.131 -                indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
  20.132 -            } catch (InterruptedException ex) {
  20.133 -                throw (CommandException) new CommandException(0).initCause(ex);
  20.134 -            } catch (IOException ex) {
  20.135 -                throw (CommandException) new CommandException(0).initCause(ex);
  20.136 +
  20.137 +            out.putNextEntry(new ZipEntry(categoryId + "/segments"));
  20.138 +
  20.139 +            outSegments.store(out, "");
  20.140 +        } catch (IOException ex) {
  20.141 +            throw (CommandException) new CommandException(0).initCause(ex);
  20.142 +        } finally {
  20.143 +            if (out != null) {
  20.144 +                try {
  20.145 +                    out.close();
  20.146 +                } catch (IOException ex) {
  20.147 +                    throw (CommandException) new CommandException(0).initCause(ex);
  20.148 +                }
  20.149 +            }
  20.150 +
  20.151 +            if (segments != null) {
  20.152 +                try {
  20.153 +                    segments.close();
  20.154 +                } catch (IOException ex) {
  20.155 +                    throw (CommandException) new CommandException(0).initCause(ex);
  20.156 +                }
  20.157              }
  20.158          }
  20.159 +        
  20.160 +        LifecycleManager.getDefault().exit();
  20.161      }
  20.162  
  20.163      private Set<FileObject> getRoots(String[] projects, Env env) throws IllegalArgumentException, InterruptedException {
  20.164 @@ -205,6 +249,8 @@
  20.165          if (sourceRoots.isEmpty()) {
  20.166              env.getErrorStream().println("Error: There is nothing to index!");
  20.167          } else {
  20.168 +            //XXX: to start up the project systems and RepositoryUpdater:
  20.169 +            ((Runnable) OpenProjects.getDefault().openProjects()).run();
  20.170              System.setProperty(CustomIndexerImpl.class.getName() + "-attributed", "true");//force partially attributed Jackpot index
  20.171              org.netbeans.api.project.ui.OpenProjects.getDefault().getOpenProjects();
  20.172              ClassPath source = ClassPathSupport.createClassPath(sourceRoots.toArray(new FileObject[0]));
  20.173 @@ -219,16 +265,30 @@
  20.174          }
  20.175      }
  20.176  
  20.177 -    private void startServer(Env env) {
  20.178 -        try {
  20.179 -            HttpServer server = HttpServerFactory.create("http://localhost:9998/", new ClassNamesResourceConfig(API.class, UI.class, MainPage.class));
  20.180 +    private void pack(JarOutputStream target, FileObject index, String name, StringBuilder relPath) throws IOException {
  20.181 +        int len = relPath.length();
  20.182 +        boolean first = relPath.length() == 0;
  20.183  
  20.184 -            server.start();
  20.185 -        } catch (IOException ex) {
  20.186 -            Exceptions.printStackTrace(ex);
  20.187 -        } catch (IllegalArgumentException ex) {
  20.188 -            Exceptions.printStackTrace(ex);
  20.189 +        if (!first) relPath.append("/");
  20.190 +        relPath.append(name);
  20.191 +
  20.192 +        for (FileObject c : index.getChildren()) {
  20.193 +            if (first && c.getNameExt().equals("segments")) continue;
  20.194 +            pack(target, c, c.getNameExt(), relPath);
  20.195          }
  20.196 +
  20.197 +        if (index.isData()) {
  20.198 +            target.putNextEntry(new ZipEntry(relPath.toString()));
  20.199 +
  20.200 +            InputStream in = index.getInputStream();
  20.201 +
  20.202 +            try {
  20.203 +                FileUtil.copy(in, target);
  20.204 +            } finally {
  20.205 +                in.close();
  20.206 +            }
  20.207 +        }
  20.208 +
  20.209 +        relPath.delete(len, relPath.length());
  20.210      }
  20.211 -
  20.212  }
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/server/backend/scripts/index.sh	Mon Jun 20 23:28:38 2011 +0200
    21.3 @@ -0,0 +1,14 @@
    21.4 +DIR=`dirname $0`
    21.5 +USERDIR=`tempfile`;
    21.6 +rm $USERDIR
    21.7 +mkdir -p $USERDIR
    21.8 +trap "rm -rf -- '$USERDIR'" EXIT
    21.9 +
   21.10 +ID="$1"; shift
   21.11 +NAME="$1"; shift
   21.12 +TARGET="$1"; shift
   21.13 +ROOT_DIR="$1"; shift
   21.14 +
   21.15 +$DIR/indexer/bin/backend --userdir $USERDIR --nosplash --nogui -J-Xmx2048m --category-id "$ID" --category-name "$NAME" --cache-target "$TARGET" --category-root-dir "$ROOT_DIR" --category-projects "$@"
   21.16 +
   21.17 +exit
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/server/backend/scripts/web.sh	Mon Jun 20 23:28:38 2011 +0200
    22.3 @@ -0,0 +1,2 @@
    22.4 +DIR=`dirname $0`
    22.5 +java -Xbootclasspath/p:$DIR/web/lib/javac-api-nb-7.0-b07.jar:$DIR/web/lib/javac-impl-nb-7.0-b07.jar -jar $DIR/web/web.main.jar "$@"
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/server/backend/type.web.api/build.xml	Mon Jun 20 23:28:38 2011 +0200
    23.3 @@ -0,0 +1,74 @@
    23.4 +<?xml version="1.0" encoding="UTF-8"?>
    23.5 +<!-- You may freely edit this file. See commented blocks below for -->
    23.6 +<!-- some examples of how to customize the build. -->
    23.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
    23.8 +<!-- By default, only the Clean and Build commands use this build script. -->
    23.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
   23.10 +<!-- the Compile on Save feature is turned off for the project. -->
   23.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
   23.12 +<!-- in the project's Project Properties dialog box.-->
   23.13 +<project name="type.web.api" default="default" basedir=".">
   23.14 +    <description>Builds, tests, and runs the project type.web.api.</description>
   23.15 +    <import file="nbproject/build-impl.xml"/>
   23.16 +    <!--
   23.17 +
   23.18 +    There exist several targets which are by default empty and which can be 
   23.19 +    used for execution of your tasks. These targets are usually executed 
   23.20 +    before and after some main targets. They are: 
   23.21 +
   23.22 +      -pre-init:                 called before initialization of project properties
   23.23 +      -post-init:                called after initialization of project properties
   23.24 +      -pre-compile:              called before javac compilation
   23.25 +      -post-compile:             called after javac compilation
   23.26 +      -pre-compile-single:       called before javac compilation of single file
   23.27 +      -post-compile-single:      called after javac compilation of single file
   23.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
   23.29 +      -post-compile-test:        called after javac compilation of JUnit tests
   23.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
   23.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
   23.32 +      -pre-jar:                  called before JAR building
   23.33 +      -post-jar:                 called after JAR building
   23.34 +      -post-clean:               called after cleaning build products
   23.35 +
   23.36 +    (Targets beginning with '-' are not intended to be called on their own.)
   23.37 +
   23.38 +    Example of inserting an obfuscator after compilation could look like this:
   23.39 +
   23.40 +        <target name="-post-compile">
   23.41 +            <obfuscate>
   23.42 +                <fileset dir="${build.classes.dir}"/>
   23.43 +            </obfuscate>
   23.44 +        </target>
   23.45 +
   23.46 +    For list of available properties check the imported 
   23.47 +    nbproject/build-impl.xml file. 
   23.48 +
   23.49 +
   23.50 +    Another way to customize the build is by overriding existing main targets.
   23.51 +    The targets of interest are: 
   23.52 +
   23.53 +      -init-macrodef-javac:     defines macro for javac compilation
   23.54 +      -init-macrodef-junit:     defines macro for junit execution
   23.55 +      -init-macrodef-debug:     defines macro for class debugging
   23.56 +      -init-macrodef-java:      defines macro for class execution
   23.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
   23.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
   23.59 +      run:                      execution of project 
   23.60 +      -javadoc-build:           Javadoc generation
   23.61 +      test-report:              JUnit report generation
   23.62 +
   23.63 +    An example of overriding the target for project execution could look like this:
   23.64 +
   23.65 +        <target name="run" depends="type.web.api-impl.jar">
   23.66 +            <exec dir="bin" executable="launcher.exe">
   23.67 +                <arg file="${dist.jar}"/>
   23.68 +            </exec>
   23.69 +        </target>
   23.70 +
   23.71 +    Notice that the overridden target depends on the jar target and not only on 
   23.72 +    the compile target as the regular run target does. Again, for a list of available 
   23.73 +    properties which you can use, check the target you are overriding in the
   23.74 +    nbproject/build-impl.xml file. 
   23.75 +
   23.76 +    -->
   23.77 +</project>
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/server/backend/type.web.api/manifest.mf	Mon Jun 20 23:28:38 2011 +0200
    24.3 @@ -0,0 +1,3 @@
    24.4 +Manifest-Version: 1.0
    24.5 +X-COMMENT: Main-Class will be added automatically by build
    24.6 +
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/server/backend/type.web.api/nbproject/build-impl.xml	Mon Jun 20 23:28:38 2011 +0200
    25.3 @@ -0,0 +1,1082 @@
    25.4 +<?xml version="1.0" encoding="UTF-8"?>
    25.5 +<!--
    25.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    25.7 +***         EDIT ../build.xml INSTEAD         ***
    25.8 +
    25.9 +For the purpose of easier reading the script
   25.10 +is divided into following sections:
   25.11 +
   25.12 +  - initialization
   25.13 +  - compilation
   25.14 +  - jar
   25.15 +  - execution
   25.16 +  - debugging
   25.17 +  - javadoc
   25.18 +  - junit compilation
   25.19 +  - junit execution
   25.20 +  - junit debugging
   25.21 +  - applet
   25.22 +  - cleanup
   25.23 +
   25.24 +        -->
   25.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="type.web.api-impl">
   25.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
   25.27 +        <condition>
   25.28 +            <not>
   25.29 +                <antversion atleast="1.8.0"/>
   25.30 +            </not>
   25.31 +        </condition>
   25.32 +    </fail>
   25.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
   25.34 +    <!-- 
   25.35 +                ======================
   25.36 +                INITIALIZATION SECTION 
   25.37 +                ======================
   25.38 +            -->
   25.39 +    <target name="-pre-init">
   25.40 +        <!-- Empty placeholder for easier customization. -->
   25.41 +        <!-- You can override this target in the ../build.xml file. -->
   25.42 +    </target>
   25.43 +    <target depends="-pre-init" name="-init-private">
   25.44 +        <property file="nbproject/private/config.properties"/>
   25.45 +        <property file="nbproject/private/configs/${config}.properties"/>
   25.46 +        <property file="nbproject/private/private.properties"/>
   25.47 +    </target>
   25.48 +    <target name="-pre-init-libraries">
   25.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
   25.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
   25.51 +        <pathconvert dirsep="/" property="libraries.dir">
   25.52 +            <path path="${libraries.dir.nativedirsep}"/>
   25.53 +        </pathconvert>
   25.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
   25.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
   25.56 +    </target>
   25.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
   25.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
   25.59 +            <filterchain>
   25.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   25.61 +                <escapeunicode/>
   25.62 +            </filterchain>
   25.63 +        </loadproperties>
   25.64 +    </target>
   25.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
   25.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
   25.67 +            <filterchain>
   25.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   25.69 +                <escapeunicode/>
   25.70 +            </filterchain>
   25.71 +        </loadproperties>
   25.72 +    </target>
   25.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
   25.74 +        <property file="${user.properties.file}"/>
   25.75 +        <!-- The two properties below are usually overridden -->
   25.76 +        <!-- by the active platform. Just a fallback. -->
   25.77 +        <property name="default.javac.source" value="1.4"/>
   25.78 +        <property name="default.javac.target" value="1.4"/>
   25.79 +    </target>
   25.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
   25.81 +        <property file="nbproject/configs/${config}.properties"/>
   25.82 +        <property file="nbproject/project.properties"/>
   25.83 +    </target>
   25.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
   25.85 +        <available file="${manifest.file}" property="manifest.available"/>
   25.86 +        <condition property="splashscreen.available">
   25.87 +            <and>
   25.88 +                <not>
   25.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   25.90 +                </not>
   25.91 +                <available file="${application.splash}"/>
   25.92 +            </and>
   25.93 +        </condition>
   25.94 +        <condition property="main.class.available">
   25.95 +            <and>
   25.96 +                <isset property="main.class"/>
   25.97 +                <not>
   25.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
   25.99 +                </not>
  25.100 +            </and>
  25.101 +        </condition>
  25.102 +        <condition property="manifest.available+main.class">
  25.103 +            <and>
  25.104 +                <isset property="manifest.available"/>
  25.105 +                <isset property="main.class.available"/>
  25.106 +            </and>
  25.107 +        </condition>
  25.108 +        <condition property="do.archive">
  25.109 +            <not>
  25.110 +                <istrue value="${jar.archive.disabled}"/>
  25.111 +            </not>
  25.112 +        </condition>
  25.113 +        <condition property="do.mkdist">
  25.114 +            <and>
  25.115 +                <isset property="do.archive"/>
  25.116 +                <isset property="libs.CopyLibs.classpath"/>
  25.117 +                <not>
  25.118 +                    <istrue value="${mkdist.disabled}"/>
  25.119 +                </not>
  25.120 +            </and>
  25.121 +        </condition>
  25.122 +        <condition property="manifest.available+main.class+mkdist.available">
  25.123 +            <and>
  25.124 +                <istrue value="${manifest.available+main.class}"/>
  25.125 +                <isset property="do.mkdist"/>
  25.126 +            </and>
  25.127 +        </condition>
  25.128 +        <condition property="do.archive+manifest.available">
  25.129 +            <and>
  25.130 +                <isset property="manifest.available"/>
  25.131 +                <istrue value="${do.archive}"/>
  25.132 +            </and>
  25.133 +        </condition>
  25.134 +        <condition property="do.archive+main.class.available">
  25.135 +            <and>
  25.136 +                <isset property="main.class.available"/>
  25.137 +                <istrue value="${do.archive}"/>
  25.138 +            </and>
  25.139 +        </condition>
  25.140 +        <condition property="do.archive+splashscreen.available">
  25.141 +            <and>
  25.142 +                <isset property="splashscreen.available"/>
  25.143 +                <istrue value="${do.archive}"/>
  25.144 +            </and>
  25.145 +        </condition>
  25.146 +        <condition property="do.archive+manifest.available+main.class">
  25.147 +            <and>
  25.148 +                <istrue value="${manifest.available+main.class}"/>
  25.149 +                <istrue value="${do.archive}"/>
  25.150 +            </and>
  25.151 +        </condition>
  25.152 +        <condition property="manifest.available-mkdist.available">
  25.153 +            <or>
  25.154 +                <istrue value="${manifest.available}"/>
  25.155 +                <isset property="do.mkdist"/>
  25.156 +            </or>
  25.157 +        </condition>
  25.158 +        <condition property="manifest.available+main.class-mkdist.available">
  25.159 +            <or>
  25.160 +                <istrue value="${manifest.available+main.class}"/>
  25.161 +                <isset property="do.mkdist"/>
  25.162 +            </or>
  25.163 +        </condition>
  25.164 +        <condition property="have.tests">
  25.165 +            <or>
  25.166 +                <available file="${test.src.dir}"/>
  25.167 +            </or>
  25.168 +        </condition>
  25.169 +        <condition property="have.sources">
  25.170 +            <or>
  25.171 +                <available file="${src.dir}"/>
  25.172 +            </or>
  25.173 +        </condition>
  25.174 +        <condition property="netbeans.home+have.tests">
  25.175 +            <and>
  25.176 +                <isset property="netbeans.home"/>
  25.177 +                <isset property="have.tests"/>
  25.178 +            </and>
  25.179 +        </condition>
  25.180 +        <condition property="no.javadoc.preview">
  25.181 +            <and>
  25.182 +                <isset property="javadoc.preview"/>
  25.183 +                <isfalse value="${javadoc.preview}"/>
  25.184 +            </and>
  25.185 +        </condition>
  25.186 +        <property name="run.jvmargs" value=""/>
  25.187 +        <property name="javac.compilerargs" value=""/>
  25.188 +        <property name="work.dir" value="${basedir}"/>
  25.189 +        <condition property="no.deps">
  25.190 +            <and>
  25.191 +                <istrue value="${no.dependencies}"/>
  25.192 +            </and>
  25.193 +        </condition>
  25.194 +        <property name="javac.debug" value="true"/>
  25.195 +        <property name="javadoc.preview" value="true"/>
  25.196 +        <property name="application.args" value=""/>
  25.197 +        <property name="source.encoding" value="${file.encoding}"/>
  25.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
  25.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  25.200 +            <and>
  25.201 +                <isset property="javadoc.encoding"/>
  25.202 +                <not>
  25.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
  25.204 +                </not>
  25.205 +            </and>
  25.206 +        </condition>
  25.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
  25.208 +        <property name="includes" value="**"/>
  25.209 +        <property name="excludes" value=""/>
  25.210 +        <property name="do.depend" value="false"/>
  25.211 +        <condition property="do.depend.true">
  25.212 +            <istrue value="${do.depend}"/>
  25.213 +        </condition>
  25.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  25.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  25.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
  25.217 +        </condition>
  25.218 +        <condition else="false" property="jdkBug6558476">
  25.219 +            <and>
  25.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
  25.221 +                <not>
  25.222 +                    <os family="unix"/>
  25.223 +                </not>
  25.224 +            </and>
  25.225 +        </condition>
  25.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
  25.227 +        <property name="jar.index" value="false"/>
  25.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
  25.229 +        <property name="copylibs.rebase" value="true"/>
  25.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  25.231 +    </target>
  25.232 +    <target name="-post-init">
  25.233 +        <!-- Empty placeholder for easier customization. -->
  25.234 +        <!-- You can override this target in the ../build.xml file. -->
  25.235 +    </target>
  25.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
  25.237 +        <fail unless="src.dir">Must set src.dir</fail>
  25.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
  25.239 +        <fail unless="build.dir">Must set build.dir</fail>
  25.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
  25.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  25.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  25.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  25.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  25.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  25.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
  25.247 +    </target>
  25.248 +    <target name="-init-macrodef-property">
  25.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  25.250 +            <attribute name="name"/>
  25.251 +            <attribute name="value"/>
  25.252 +            <sequential>
  25.253 +                <property name="@{name}" value="${@{value}}"/>
  25.254 +            </sequential>
  25.255 +        </macrodef>
  25.256 +    </target>
  25.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  25.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.259 +            <attribute default="${src.dir}" name="srcdir"/>
  25.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
  25.261 +            <attribute default="${javac.classpath}" name="classpath"/>
  25.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  25.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  25.264 +            <attribute default="${includes}" name="includes"/>
  25.265 +            <attribute default="${excludes}" name="excludes"/>
  25.266 +            <attribute default="${javac.debug}" name="debug"/>
  25.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
  25.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  25.269 +            <element name="customize" optional="true"/>
  25.270 +            <sequential>
  25.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
  25.272 +                <mkdir dir="${empty.dir}"/>
  25.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  25.274 +                <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}">
  25.275 +                    <src>
  25.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  25.277 +                            <include name="*"/>
  25.278 +                        </dirset>
  25.279 +                    </src>
  25.280 +                    <classpath>
  25.281 +                        <path path="@{classpath}"/>
  25.282 +                    </classpath>
  25.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  25.284 +                    <compilerarg line="${javac.compilerargs}"/>
  25.285 +                    <compilerarg value="-processorpath"/>
  25.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
  25.287 +                    <compilerarg line="${ap.processors.internal}"/>
  25.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  25.289 +                    <compilerarg value="-s"/>
  25.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  25.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
  25.292 +                    <customize/>
  25.293 +                </javac>
  25.294 +            </sequential>
  25.295 +        </macrodef>
  25.296 +    </target>
  25.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  25.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.299 +            <attribute default="${src.dir}" name="srcdir"/>
  25.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
  25.301 +            <attribute default="${javac.classpath}" name="classpath"/>
  25.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  25.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  25.304 +            <attribute default="${includes}" name="includes"/>
  25.305 +            <attribute default="${excludes}" name="excludes"/>
  25.306 +            <attribute default="${javac.debug}" name="debug"/>
  25.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
  25.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  25.309 +            <element name="customize" optional="true"/>
  25.310 +            <sequential>
  25.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
  25.312 +                <mkdir dir="${empty.dir}"/>
  25.313 +                <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}">
  25.314 +                    <src>
  25.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  25.316 +                            <include name="*"/>
  25.317 +                        </dirset>
  25.318 +                    </src>
  25.319 +                    <classpath>
  25.320 +                        <path path="@{classpath}"/>
  25.321 +                    </classpath>
  25.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  25.323 +                    <compilerarg line="${javac.compilerargs}"/>
  25.324 +                    <customize/>
  25.325 +                </javac>
  25.326 +            </sequential>
  25.327 +        </macrodef>
  25.328 +    </target>
  25.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  25.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.331 +            <attribute default="${src.dir}" name="srcdir"/>
  25.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
  25.333 +            <attribute default="${javac.classpath}" name="classpath"/>
  25.334 +            <sequential>
  25.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  25.336 +                    <classpath>
  25.337 +                        <path path="@{classpath}"/>
  25.338 +                    </classpath>
  25.339 +                </depend>
  25.340 +            </sequential>
  25.341 +        </macrodef>
  25.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
  25.344 +            <sequential>
  25.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
  25.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  25.347 +                    <path>
  25.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
  25.349 +                    </path>
  25.350 +                    <globmapper from="*.java" to="*.class"/>
  25.351 +                </pathconvert>
  25.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  25.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  25.354 +                <delete>
  25.355 +                    <files includesfile="${javac.includesfile.binary}"/>
  25.356 +                </delete>
  25.357 +                <delete>
  25.358 +                    <fileset file="${javac.includesfile.binary}"/>
  25.359 +                </delete>
  25.360 +            </sequential>
  25.361 +        </macrodef>
  25.362 +    </target>
  25.363 +    <target name="-init-macrodef-junit">
  25.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.365 +            <attribute default="${includes}" name="includes"/>
  25.366 +            <attribute default="${excludes}" name="excludes"/>
  25.367 +            <attribute default="**" name="testincludes"/>
  25.368 +            <sequential>
  25.369 +                <property name="junit.forkmode" value="perTest"/>
  25.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  25.371 +                    <batchtest todir="${build.test.results.dir}">
  25.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  25.373 +                            <filename name="@{testincludes}"/>
  25.374 +                        </fileset>
  25.375 +                    </batchtest>
  25.376 +                    <classpath>
  25.377 +                        <path path="${run.test.classpath}"/>
  25.378 +                    </classpath>
  25.379 +                    <syspropertyset>
  25.380 +                        <propertyref prefix="test-sys-prop."/>
  25.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  25.382 +                    </syspropertyset>
  25.383 +                    <formatter type="brief" usefile="false"/>
  25.384 +                    <formatter type="xml"/>
  25.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  25.386 +                    <jvmarg value="-ea"/>
  25.387 +                    <jvmarg line="${run.jvmargs}"/>
  25.388 +                </junit>
  25.389 +            </sequential>
  25.390 +        </macrodef>
  25.391 +    </target>
  25.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
  25.393 +    <target name="-profile-pre-init">
  25.394 +        <!-- Empty placeholder for easier customization. -->
  25.395 +        <!-- You can override this target in the ../build.xml file. -->
  25.396 +    </target>
  25.397 +    <target name="-profile-post-init">
  25.398 +        <!-- Empty placeholder for easier customization. -->
  25.399 +        <!-- You can override this target in the ../build.xml file. -->
  25.400 +    </target>
  25.401 +    <target name="-profile-init-macrodef-profile">
  25.402 +        <macrodef name="resolve">
  25.403 +            <attribute name="name"/>
  25.404 +            <attribute name="value"/>
  25.405 +            <sequential>
  25.406 +                <property name="@{name}" value="${env.@{value}}"/>
  25.407 +            </sequential>
  25.408 +        </macrodef>
  25.409 +        <macrodef name="profile">
  25.410 +            <attribute default="${main.class}" name="classname"/>
  25.411 +            <element name="customize" optional="true"/>
  25.412 +            <sequential>
  25.413 +                <property environment="env"/>
  25.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  25.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
  25.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
  25.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
  25.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  25.419 +                    <arg line="${application.args}"/>
  25.420 +                    <classpath>
  25.421 +                        <path path="${run.classpath}"/>
  25.422 +                    </classpath>
  25.423 +                    <syspropertyset>
  25.424 +                        <propertyref prefix="run-sys-prop."/>
  25.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  25.426 +                    </syspropertyset>
  25.427 +                    <customize/>
  25.428 +                </java>
  25.429 +            </sequential>
  25.430 +        </macrodef>
  25.431 +    </target>
  25.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
  25.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  25.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  25.435 +    </target>
  25.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  25.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  25.438 +            <attribute default="${main.class}" name="name"/>
  25.439 +            <attribute default="${debug.classpath}" name="classpath"/>
  25.440 +            <attribute default="" name="stopclassname"/>
  25.441 +            <sequential>
  25.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  25.443 +                    <classpath>
  25.444 +                        <path path="@{classpath}"/>
  25.445 +                    </classpath>
  25.446 +                </nbjpdastart>
  25.447 +            </sequential>
  25.448 +        </macrodef>
  25.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  25.450 +            <attribute default="${build.classes.dir}" name="dir"/>
  25.451 +            <sequential>
  25.452 +                <nbjpdareload>
  25.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
  25.454 +                        <include name="${fix.includes}*.class"/>
  25.455 +                    </fileset>
  25.456 +                </nbjpdareload>
  25.457 +            </sequential>
  25.458 +        </macrodef>
  25.459 +    </target>
  25.460 +    <target name="-init-debug-args">
  25.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
  25.462 +        <condition property="have-jdk-older-than-1.4">
  25.463 +            <or>
  25.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
  25.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
  25.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
  25.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
  25.468 +            </or>
  25.469 +        </condition>
  25.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  25.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
  25.472 +        </condition>
  25.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  25.474 +            <os family="windows"/>
  25.475 +        </condition>
  25.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  25.477 +            <isset property="debug.transport"/>
  25.478 +        </condition>
  25.479 +    </target>
  25.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
  25.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.482 +            <attribute default="${main.class}" name="classname"/>
  25.483 +            <attribute default="${debug.classpath}" name="classpath"/>
  25.484 +            <element name="customize" optional="true"/>
  25.485 +            <sequential>
  25.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  25.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  25.488 +                    <jvmarg line="${debug-args-line}"/>
  25.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  25.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  25.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  25.492 +                    <jvmarg line="${run.jvmargs}"/>
  25.493 +                    <classpath>
  25.494 +                        <path path="@{classpath}"/>
  25.495 +                    </classpath>
  25.496 +                    <syspropertyset>
  25.497 +                        <propertyref prefix="run-sys-prop."/>
  25.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  25.499 +                    </syspropertyset>
  25.500 +                    <customize/>
  25.501 +                </java>
  25.502 +            </sequential>
  25.503 +        </macrodef>
  25.504 +    </target>
  25.505 +    <target name="-init-macrodef-java">
  25.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  25.507 +            <attribute default="${main.class}" name="classname"/>
  25.508 +            <attribute default="${run.classpath}" name="classpath"/>
  25.509 +            <element name="customize" optional="true"/>
  25.510 +            <sequential>
  25.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  25.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  25.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  25.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  25.515 +                    <jvmarg line="${run.jvmargs}"/>
  25.516 +                    <classpath>
  25.517 +                        <path path="@{classpath}"/>
  25.518 +                    </classpath>
  25.519 +                    <syspropertyset>
  25.520 +                        <propertyref prefix="run-sys-prop."/>
  25.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  25.522 +                    </syspropertyset>
  25.523 +                    <customize/>
  25.524 +                </java>
  25.525 +            </sequential>
  25.526 +        </macrodef>
  25.527 +    </target>
  25.528 +    <target name="-init-macrodef-copylibs">
  25.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  25.530 +            <attribute default="${manifest.file}" name="manifest"/>
  25.531 +            <element name="customize" optional="true"/>
  25.532 +            <sequential>
  25.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  25.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
  25.535 +                    <path path="${run.classpath}"/>
  25.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
  25.537 +                </pathconvert>
  25.538 +                <pathconvert pathsep=" " property="jar.classpath">
  25.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
  25.540 +                    <chainedmapper>
  25.541 +                        <flattenmapper/>
  25.542 +                        <globmapper from="*" to="lib/*"/>
  25.543 +                    </chainedmapper>
  25.544 +                </pathconvert>
  25.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  25.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  25.547 +                    <fileset dir="${build.classes.dir}"/>
  25.548 +                    <manifest>
  25.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
  25.550 +                        <customize/>
  25.551 +                    </manifest>
  25.552 +                </copylibs>
  25.553 +            </sequential>
  25.554 +        </macrodef>
  25.555 +    </target>
  25.556 +    <target name="-init-presetdef-jar">
  25.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  25.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  25.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
  25.560 +            </jar>
  25.561 +        </presetdef>
  25.562 +    </target>
  25.563 +    <target name="-init-ap-cmdline-properties">
  25.564 +        <property name="annotation.processing.enabled" value="true"/>
  25.565 +        <property name="annotation.processing.processors.list" value=""/>
  25.566 +        <property name="annotation.processing.processor.options" value=""/>
  25.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
  25.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
  25.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  25.570 +        <condition property="ap.supported.internal" value="true">
  25.571 +            <not>
  25.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  25.573 +            </not>
  25.574 +        </condition>
  25.575 +    </target>
  25.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  25.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  25.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
  25.579 +        </condition>
  25.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  25.581 +            <isfalse value="${annotation.processing.enabled}"/>
  25.582 +        </condition>
  25.583 +    </target>
  25.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  25.585 +        <property name="ap.cmd.line.internal" value=""/>
  25.586 +    </target>
  25.587 +    <target depends="-pre-init,-init-private,-init-libraries,-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"/>
  25.588 +    <!--
  25.589 +                ===================
  25.590 +                COMPILATION SECTION
  25.591 +                ===================
  25.592 +            -->
  25.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
  25.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  25.595 +        <delete file="${built-jar.properties}" quiet="true"/>
  25.596 +    </target>
  25.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  25.598 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
  25.599 +    </target>
  25.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  25.601 +        <mkdir dir="${build.dir}"/>
  25.602 +        <touch file="${built-jar.properties}" verbose="false"/>
  25.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  25.604 +        <antcall target="-warn-already-built-jar"/>
  25.605 +        <propertyfile file="${built-jar.properties}">
  25.606 +            <entry key="${basedir}" value=""/>
  25.607 +        </propertyfile>
  25.608 +        <antcall target="-maybe-call-dep">
  25.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  25.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
  25.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
  25.612 +            <param name="call.target" value="jar"/>
  25.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  25.614 +        </antcall>
  25.615 +    </target>
  25.616 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  25.617 +    <target depends="init" name="-check-automatic-build">
  25.618 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  25.619 +    </target>
  25.620 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  25.621 +        <antcall target="clean"/>
  25.622 +    </target>
  25.623 +    <target depends="init,deps-jar" name="-pre-pre-compile">
  25.624 +        <mkdir dir="${build.classes.dir}"/>
  25.625 +    </target>
  25.626 +    <target name="-pre-compile">
  25.627 +        <!-- Empty placeholder for easier customization. -->
  25.628 +        <!-- You can override this target in the ../build.xml file. -->
  25.629 +    </target>
  25.630 +    <target if="do.depend.true" name="-compile-depend">
  25.631 +        <pathconvert property="build.generated.subdirs">
  25.632 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  25.633 +                <include name="*"/>
  25.634 +            </dirset>
  25.635 +        </pathconvert>
  25.636 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  25.637 +    </target>
  25.638 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  25.639 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  25.640 +        <copy todir="${build.classes.dir}">
  25.641 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  25.642 +        </copy>
  25.643 +    </target>
  25.644 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
  25.645 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  25.646 +        <copy todir="${build.classes.dir}/META-INF">
  25.647 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
  25.648 +        </copy>
  25.649 +    </target>
  25.650 +    <target name="-post-compile">
  25.651 +        <!-- Empty placeholder for easier customization. -->
  25.652 +        <!-- You can override this target in the ../build.xml file. -->
  25.653 +    </target>
  25.654 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  25.655 +    <target name="-pre-compile-single">
  25.656 +        <!-- Empty placeholder for easier customization. -->
  25.657 +        <!-- You can override this target in the ../build.xml file. -->
  25.658 +    </target>
  25.659 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  25.660 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  25.661 +        <j2seproject3:force-recompile/>
  25.662 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  25.663 +    </target>
  25.664 +    <target name="-post-compile-single">
  25.665 +        <!-- Empty placeholder for easier customization. -->
  25.666 +        <!-- You can override this target in the ../build.xml file. -->
  25.667 +    </target>
  25.668 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  25.669 +    <!--
  25.670 +                ====================
  25.671 +                JAR BUILDING SECTION
  25.672 +                ====================
  25.673 +            -->
  25.674 +    <target depends="init" name="-pre-pre-jar">
  25.675 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  25.676 +        <mkdir dir="${dist.jar.dir}"/>
  25.677 +    </target>
  25.678 +    <target name="-pre-jar">
  25.679 +        <!-- Empty placeholder for easier customization. -->
  25.680 +        <!-- You can override this target in the ../build.xml file. -->
  25.681 +    </target>
  25.682 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  25.683 +        <j2seproject1:jar/>
  25.684 +    </target>
  25.685 +    <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">
  25.686 +        <j2seproject1:jar manifest="${manifest.file}"/>
  25.687 +    </target>
  25.688 +    <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">
  25.689 +        <j2seproject1:jar manifest="${manifest.file}">
  25.690 +            <j2seproject1:manifest>
  25.691 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  25.692 +            </j2seproject1:manifest>
  25.693 +        </j2seproject1:jar>
  25.694 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  25.695 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  25.696 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  25.697 +        <pathconvert property="run.classpath.with.dist.jar">
  25.698 +            <path path="${run.classpath}"/>
  25.699 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  25.700 +        </pathconvert>
  25.701 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  25.702 +    </target>
  25.703 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  25.704 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  25.705 +        <touch file="${tmp.manifest.file}" verbose="false"/>
  25.706 +    </target>
  25.707 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  25.708 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  25.709 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  25.710 +    </target>
  25.711 +    <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">
  25.712 +        <manifest file="${tmp.manifest.file}" mode="update">
  25.713 +            <attribute name="Main-Class" value="${main.class}"/>
  25.714 +        </manifest>
  25.715 +    </target>
  25.716 +    <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">
  25.717 +        <basename file="${application.splash}" property="splashscreen.basename"/>
  25.718 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  25.719 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  25.720 +        <manifest file="${tmp.manifest.file}" mode="update">
  25.721 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  25.722 +        </manifest>
  25.723 +    </target>
  25.724 +    <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">
  25.725 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  25.726 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  25.727 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  25.728 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  25.729 +    </target>
  25.730 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  25.731 +        <delete>
  25.732 +            <fileset file="${tmp.manifest.file}"/>
  25.733 +        </delete>
  25.734 +    </target>
  25.735 +    <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"/>
  25.736 +    <target name="-post-jar">
  25.737 +        <!-- Empty placeholder for easier customization. -->
  25.738 +        <!-- You can override this target in the ../build.xml file. -->
  25.739 +    </target>
  25.740 +    <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"/>
  25.741 +    <!--
  25.742 +                =================
  25.743 +                EXECUTION SECTION
  25.744 +                =================
  25.745 +            -->
  25.746 +    <target depends="init,compile" description="Run a main class." name="run">
  25.747 +        <j2seproject1:java>
  25.748 +            <customize>
  25.749 +                <arg line="${application.args}"/>
  25.750 +            </customize>
  25.751 +        </j2seproject1:java>
  25.752 +    </target>
  25.753 +    <target name="-do-not-recompile">
  25.754 +        <property name="javac.includes.binary" value=""/>
  25.755 +    </target>
  25.756 +    <target depends="init,compile-single" name="run-single">
  25.757 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  25.758 +        <j2seproject1:java classname="${run.class}"/>
  25.759 +    </target>
  25.760 +    <target depends="init,compile-test-single" name="run-test-with-main">
  25.761 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  25.762 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  25.763 +    </target>
  25.764 +    <!--
  25.765 +                =================
  25.766 +                DEBUGGING SECTION
  25.767 +                =================
  25.768 +            -->
  25.769 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  25.770 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
  25.771 +    </target>
  25.772 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  25.773 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  25.774 +    </target>
  25.775 +    <target depends="init,compile" name="-debug-start-debuggee">
  25.776 +        <j2seproject3:debug>
  25.777 +            <customize>
  25.778 +                <arg line="${application.args}"/>
  25.779 +            </customize>
  25.780 +        </j2seproject3:debug>
  25.781 +    </target>
  25.782 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  25.783 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  25.784 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  25.785 +    </target>
  25.786 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  25.787 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  25.788 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  25.789 +        <j2seproject3:debug classname="${debug.class}"/>
  25.790 +    </target>
  25.791 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  25.792 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  25.793 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  25.794 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  25.795 +    </target>
  25.796 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  25.797 +    <target depends="init" name="-pre-debug-fix">
  25.798 +        <fail unless="fix.includes">Must set fix.includes</fail>
  25.799 +        <property name="javac.includes" value="${fix.includes}.java"/>
  25.800 +    </target>
  25.801 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  25.802 +        <j2seproject1:nbjpdareload/>
  25.803 +    </target>
  25.804 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  25.805 +    <!--
  25.806 +                =================
  25.807 +                PROFILING SECTION
  25.808 +                =================
  25.809 +            -->
  25.810 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
  25.811 +        <nbprofiledirect>
  25.812 +            <classpath>
  25.813 +                <path path="${run.classpath}"/>
  25.814 +            </classpath>
  25.815 +        </nbprofiledirect>
  25.816 +        <profile/>
  25.817 +    </target>
  25.818 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
  25.819 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  25.820 +        <nbprofiledirect>
  25.821 +            <classpath>
  25.822 +                <path path="${run.classpath}"/>
  25.823 +            </classpath>
  25.824 +        </nbprofiledirect>
  25.825 +        <profile classname="${profile.class}"/>
  25.826 +    </target>
  25.827 +    <!--
  25.828 +                =========================
  25.829 +                APPLET PROFILING  SECTION
  25.830 +                =========================
  25.831 +            -->
  25.832 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
  25.833 +        <nbprofiledirect>
  25.834 +            <classpath>
  25.835 +                <path path="${run.classpath}"/>
  25.836 +            </classpath>
  25.837 +        </nbprofiledirect>
  25.838 +        <profile classname="sun.applet.AppletViewer">
  25.839 +            <customize>
  25.840 +                <arg value="${applet.url}"/>
  25.841 +            </customize>
  25.842 +        </profile>
  25.843 +    </target>
  25.844 +    <!--
  25.845 +                =========================
  25.846 +                TESTS PROFILING  SECTION
  25.847 +                =========================
  25.848 +            -->
  25.849 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
  25.850 +        <nbprofiledirect>
  25.851 +            <classpath>
  25.852 +                <path path="${run.test.classpath}"/>
  25.853 +            </classpath>
  25.854 +        </nbprofiledirect>
  25.855 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  25.856 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  25.857 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  25.858 +            <jvmarg line="${profiler.info.jvmargs}"/>
  25.859 +            <test name="${profile.class}"/>
  25.860 +            <classpath>
  25.861 +                <path path="${run.test.classpath}"/>
  25.862 +            </classpath>
  25.863 +            <syspropertyset>
  25.864 +                <propertyref prefix="test-sys-prop."/>
  25.865 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  25.866 +            </syspropertyset>
  25.867 +            <formatter type="brief" usefile="false"/>
  25.868 +            <formatter type="xml"/>
  25.869 +        </junit>
  25.870 +    </target>
  25.871 +    <!--
  25.872 +                ===============
  25.873 +                JAVADOC SECTION
  25.874 +                ===============
  25.875 +            -->
  25.876 +    <target depends="init" if="have.sources" name="-javadoc-build">
  25.877 +        <mkdir dir="${dist.javadoc.dir}"/>
  25.878 +        <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}">
  25.879 +            <classpath>
  25.880 +                <path path="${javac.classpath}"/>
  25.881 +            </classpath>
  25.882 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  25.883 +                <filename name="**/*.java"/>
  25.884 +            </fileset>
  25.885 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  25.886 +                <include name="**/*.java"/>
  25.887 +                <exclude name="*.java"/>
  25.888 +            </fileset>
  25.889 +        </javadoc>
  25.890 +        <copy todir="${dist.javadoc.dir}">
  25.891 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  25.892 +                <filename name="**/doc-files/**"/>
  25.893 +            </fileset>
  25.894 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  25.895 +                <include name="**/doc-files/**"/>
  25.896 +            </fileset>
  25.897 +        </copy>
  25.898 +    </target>
  25.899 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  25.900 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  25.901 +    </target>
  25.902 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  25.903 +    <!--
  25.904 +                =========================
  25.905 +                JUNIT COMPILATION SECTION
  25.906 +                =========================
  25.907 +            -->
  25.908 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  25.909 +        <mkdir dir="${build.test.classes.dir}"/>
  25.910 +    </target>
  25.911 +    <target name="-pre-compile-test">
  25.912 +        <!-- Empty placeholder for easier customization. -->
  25.913 +        <!-- You can override this target in the ../build.xml file. -->
  25.914 +    </target>
  25.915 +    <target if="do.depend.true" name="-compile-test-depend">
  25.916 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  25.917 +    </target>
  25.918 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  25.919 +        <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}"/>
  25.920 +        <copy todir="${build.test.classes.dir}">
  25.921 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  25.922 +        </copy>
  25.923 +    </target>
  25.924 +    <target name="-post-compile-test">
  25.925 +        <!-- Empty placeholder for easier customization. -->
  25.926 +        <!-- You can override this target in the ../build.xml file. -->
  25.927 +    </target>
  25.928 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  25.929 +    <target name="-pre-compile-test-single">
  25.930 +        <!-- Empty placeholder for easier customization. -->
  25.931 +        <!-- You can override this target in the ../build.xml file. -->
  25.932 +    </target>
  25.933 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  25.934 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  25.935 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  25.936 +        <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}"/>
  25.937 +        <copy todir="${build.test.classes.dir}">
  25.938 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  25.939 +        </copy>
  25.940 +    </target>
  25.941 +    <target name="-post-compile-test-single">
  25.942 +        <!-- Empty placeholder for easier customization. -->
  25.943 +        <!-- You can override this target in the ../build.xml file. -->
  25.944 +    </target>
  25.945 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  25.946 +    <!--
  25.947 +                =======================
  25.948 +                JUNIT EXECUTION SECTION
  25.949 +                =======================
  25.950 +            -->
  25.951 +    <target depends="init" if="have.tests" name="-pre-test-run">
  25.952 +        <mkdir dir="${build.test.results.dir}"/>
  25.953 +    </target>
  25.954 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  25.955 +        <j2seproject3:junit testincludes="**/*Test.java"/>
  25.956 +    </target>
  25.957 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  25.958 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  25.959 +    </target>
  25.960 +    <target depends="init" if="have.tests" name="test-report"/>
  25.961 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  25.962 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  25.963 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
  25.964 +        <mkdir dir="${build.test.results.dir}"/>
  25.965 +    </target>
  25.966 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  25.967 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  25.968 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  25.969 +    </target>
  25.970 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  25.971 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  25.972 +    </target>
  25.973 +    <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"/>
  25.974 +    <!--
  25.975 +                =======================
  25.976 +                JUNIT DEBUGGING SECTION
  25.977 +                =======================
  25.978 +            -->
  25.979 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  25.980 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  25.981 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  25.982 +        <delete file="${test.report.file}"/>
  25.983 +        <mkdir dir="${build.test.results.dir}"/>
  25.984 +        <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}">
  25.985 +            <customize>
  25.986 +                <syspropertyset>
  25.987 +                    <propertyref prefix="test-sys-prop."/>
  25.988 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  25.989 +                </syspropertyset>
  25.990 +                <arg value="${test.class}"/>
  25.991 +                <arg value="showoutput=true"/>
  25.992 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  25.993 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  25.994 +            </customize>
  25.995 +        </j2seproject3:debug>
  25.996 +    </target>
  25.997 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  25.998 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  25.999 +    </target>
 25.1000 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 25.1001 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 25.1002 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 25.1003 +    </target>
 25.1004 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 25.1005 +    <!--
 25.1006 +                =========================
 25.1007 +                APPLET EXECUTION SECTION
 25.1008 +                =========================
 25.1009 +            -->
 25.1010 +    <target depends="init,compile-single" name="run-applet">
 25.1011 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 25.1012 +        <j2seproject1:java classname="sun.applet.AppletViewer">
 25.1013 +            <customize>
 25.1014 +                <arg value="${applet.url}"/>
 25.1015 +            </customize>
 25.1016 +        </j2seproject1:java>
 25.1017 +    </target>
 25.1018 +    <!--
 25.1019 +                =========================
 25.1020 +                APPLET DEBUGGING  SECTION
 25.1021 +                =========================
 25.1022 +            -->
 25.1023 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
 25.1024 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 25.1025 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
 25.1026 +            <customize>
 25.1027 +                <arg value="${applet.url}"/>
 25.1028 +            </customize>
 25.1029 +        </j2seproject3:debug>
 25.1030 +    </target>
 25.1031 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
 25.1032 +    <!--
 25.1033 +                ===============
 25.1034 +                CLEANUP SECTION
 25.1035 +                ===============
 25.1036 +            -->
 25.1037 +    <target name="-deps-clean-init" unless="built-clean.properties">
 25.1038 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
 25.1039 +        <delete file="${built-clean.properties}" quiet="true"/>
 25.1040 +    </target>
 25.1041 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
 25.1042 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
 25.1043 +    </target>
 25.1044 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
 25.1045 +        <mkdir dir="${build.dir}"/>
 25.1046 +        <touch file="${built-clean.properties}" verbose="false"/>
 25.1047 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
 25.1048 +        <antcall target="-warn-already-built-clean"/>
 25.1049 +        <propertyfile file="${built-clean.properties}">
 25.1050 +            <entry key="${basedir}" value=""/>
 25.1051 +        </propertyfile>
 25.1052 +        <antcall target="-maybe-call-dep">
 25.1053 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 25.1054 +            <param location="${project.base_web_api}" name="call.subproject"/>
 25.1055 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 25.1056 +            <param name="call.target" value="clean"/>
 25.1057 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 25.1058 +        </antcall>
 25.1059 +    </target>
 25.1060 +    <target depends="init" name="-do-clean">
 25.1061 +        <delete dir="${build.dir}"/>
 25.1062 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
 25.1063 +    </target>
 25.1064 +    <target name="-post-clean">
 25.1065 +        <!-- Empty placeholder for easier customization. -->
 25.1066 +        <!-- You can override this target in the ../build.xml file. -->
 25.1067 +    </target>
 25.1068 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
 25.1069 +    <target name="-check-call-dep">
 25.1070 +        <property file="${call.built.properties}" prefix="already.built."/>
 25.1071 +        <condition property="should.call.dep">
 25.1072 +            <not>
 25.1073 +                <isset property="already.built.${call.subproject}"/>
 25.1074 +            </not>
 25.1075 +        </condition>
 25.1076 +    </target>
 25.1077 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
 25.1078 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
 25.1079 +            <propertyset>
 25.1080 +                <propertyref prefix="transfer."/>
 25.1081 +                <mapper from="transfer.*" to="*" type="glob"/>
 25.1082 +            </propertyset>
 25.1083 +        </ant>
 25.1084 +    </target>
 25.1085 +</project>
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/server/backend/type.web.api/nbproject/genfiles.properties	Mon Jun 20 23:28:38 2011 +0200
    26.3 @@ -0,0 +1,8 @@
    26.4 +build.xml.data.CRC32=1bd1d79c
    26.5 +build.xml.script.CRC32=583d72ad
    26.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
    26.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    26.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    26.9 +nbproject/build-impl.xml.data.CRC32=1bd1d79c
   26.10 +nbproject/build-impl.xml.script.CRC32=5a5278a8
   26.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/server/backend/type.web.api/nbproject/project.properties	Mon Jun 20 23:28:38 2011 +0200
    27.3 @@ -0,0 +1,96 @@
    27.4 +annotation.processing.enabled=true
    27.5 +annotation.processing.enabled.in.editor=false
    27.6 +annotation.processing.run.all.processors=true
    27.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
    27.8 +application.title=type.web.api
    27.9 +application.vendor=lahvac
   27.10 +build.classes.dir=${build.dir}/classes
   27.11 +build.classes.excludes=**/*.java,**/*.form
   27.12 +# This directory is removed when the project is cleaned:
   27.13 +build.dir=build
   27.14 +build.generated.dir=${build.dir}/generated
   27.15 +build.generated.sources.dir=${build.dir}/generated-sources
   27.16 +# Only compile against the classpath explicitly listed here:
   27.17 +build.sysclasspath=ignore
   27.18 +build.test.classes.dir=${build.dir}/test/classes
   27.19 +build.test.results.dir=${build.dir}/test/results
   27.20 +# Uncomment to specify the preferred debugger connection transport:
   27.21 +#debug.transport=dt_socket
   27.22 +debug.classpath=\
   27.23 +    ${run.classpath}
   27.24 +debug.test.classpath=\
   27.25 +    ${run.test.classpath}
   27.26 +# This directory is removed when the project is cleaned:
   27.27 +dist.dir=dist
   27.28 +dist.jar=${dist.dir}/type.web.api.jar
   27.29 +dist.javadoc.dir=${dist.dir}/javadoc
   27.30 +endorsed.classpath=
   27.31 +excludes=
   27.32 +file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
   27.33 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
   27.34 +file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
   27.35 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
   27.36 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
   27.37 +file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
   27.38 +file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
   27.39 +file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
   27.40 +file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
   27.41 +includes=**
   27.42 +jar.compress=false
   27.43 +javac.classpath=\
   27.44 +    ${libs.lucene.classpath}:\
   27.45 +    ${libs.jersey.classpath}:\
   27.46 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
   27.47 +    ${libs.freemarker.classpath}:\
   27.48 +    ${file.reference.util-commons.jar}:\
   27.49 +    ${file.reference.util-lutz.jar}:\
   27.50 +    ${file.reference.util-pojson.jar}:\
   27.51 +    ${file.reference.util-strast.jar}:\
   27.52 +    ${reference.base_web_api.jar}:\
   27.53 +    ${file.reference.org-openide-filesystems.jar}:\
   27.54 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
   27.55 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
   27.56 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}
   27.57 +# Space-separated list of extra javac options
   27.58 +javac.compilerargs=
   27.59 +javac.deprecation=false
   27.60 +javac.processorpath=\
   27.61 +    ${javac.classpath}
   27.62 +javac.source=1.6
   27.63 +javac.target=1.6
   27.64 +javac.test.classpath=\
   27.65 +    ${javac.classpath}:\
   27.66 +    ${build.classes.dir}
   27.67 +javac.test.processorpath=\
   27.68 +    ${javac.test.classpath}
   27.69 +javadoc.additionalparam=
   27.70 +javadoc.author=false
   27.71 +javadoc.encoding=${source.encoding}
   27.72 +javadoc.noindex=false
   27.73 +javadoc.nonavbar=false
   27.74 +javadoc.notree=false
   27.75 +javadoc.private=false
   27.76 +javadoc.splitindex=true
   27.77 +javadoc.use=true
   27.78 +javadoc.version=false
   27.79 +javadoc.windowtitle=
   27.80 +main.class=type.web.api.TypeWebApi
   27.81 +manifest.file=manifest.mf
   27.82 +meta.inf.dir=${src.dir}/META-INF
   27.83 +mkdist.disabled=false
   27.84 +platform.active=default_platform
   27.85 +project.base_web_api=../base.web.api
   27.86 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
   27.87 +run.classpath=\
   27.88 +    ${javac.classpath}:\
   27.89 +    ${build.classes.dir}
   27.90 +# Space-separated list of JVM arguments used when running the project
   27.91 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
   27.92 +# or test-sys-prop.name=value to set system properties for unit tests):
   27.93 +run.jvmargs=
   27.94 +run.test.classpath=\
   27.95 +    ${javac.test.classpath}:\
   27.96 +    ${build.test.classes.dir}
   27.97 +source.encoding=UTF-8
   27.98 +src.dir=src
   27.99 +test.src.dir=test
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/server/backend/type.web.api/nbproject/project.xml	Mon Jun 20 23:28:38 2011 +0200
    28.3 @@ -0,0 +1,28 @@
    28.4 +<?xml version="1.0" encoding="UTF-8"?>
    28.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    28.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    28.7 +    <configuration>
    28.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    28.9 +            <name>type.web.api</name>
   28.10 +            <source-roots>
   28.11 +                <root id="src.dir"/>
   28.12 +            </source-roots>
   28.13 +            <test-roots>
   28.14 +                <root id="test.src.dir"/>
   28.15 +            </test-roots>
   28.16 +        </data>
   28.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
   28.18 +            <definitions>../../lib/nblibraries.properties</definitions>
   28.19 +        </libraries>
   28.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
   28.21 +            <reference>
   28.22 +                <foreign-project>base_web_api</foreign-project>
   28.23 +                <artifact-type>jar</artifact-type>
   28.24 +                <script>build.xml</script>
   28.25 +                <target>jar</target>
   28.26 +                <clean-target>clean</clean-target>
   28.27 +                <id>jar</id>
   28.28 +            </reference>
   28.29 +        </references>
   28.30 +    </configuration>
   28.31 +</project>
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java	Mon Jun 20 23:28:38 2011 +0200
    29.3 @@ -0,0 +1,133 @@
    29.4 +/*
    29.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    29.6 + *
    29.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
    29.8 + *
    29.9 + * The contents of this file are subject to the terms of either the GNU
   29.10 + * General Public License Version 2 only ("GPL") or the Common
   29.11 + * Development and Distribution License("CDDL") (collectively, the
   29.12 + * "License"). You may not use this file except in compliance with the
   29.13 + * License. You can obtain a copy of the License at
   29.14 + * http://www.netbeans.org/cddl-gplv2.html
   29.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   29.16 + * specific language governing permissions and limitations under the
   29.17 + * License.  When distributing the software, include this License Header
   29.18 + * Notice in each file and include the License file at
   29.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   29.20 + * particular file as subject to the "Classpath" exception as provided
   29.21 + * by Sun in the GPL Version 2 section of the License file that
   29.22 + * accompanied this code. If applicable, add the following below the
   29.23 + * License Header, with the fields enclosed by brackets [] replaced by
   29.24 + * your own identifying information:
   29.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   29.26 + *
   29.27 + * If you wish your version of this file to be governed by only the CDDL
   29.28 + * or only the GPL Version 2, indicate your decision by adding
   29.29 + * "[Contributor] elects to include this software in this distribution
   29.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   29.31 + * single choice of license, a recipient has the option to distribute
   29.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   29.33 + * to extend the choice of license to its licensees as provided above.
   29.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   29.35 + * Version 2 license, then the option applies only if the new code is
   29.36 + * made subject to such option by the copyright holder.
   29.37 + *
   29.38 + * Contributor(s):
   29.39 + *
   29.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   29.41 + */
   29.42 +
   29.43 +package org.netbeans.modules.jackpot30.backend.type.api;
   29.44 +
   29.45 +import java.io.IOException;
   29.46 +import java.net.URL;
   29.47 +import java.util.ArrayList;
   29.48 +import java.util.EnumSet;
   29.49 +import java.util.HashSet;
   29.50 +import java.util.LinkedHashMap;
   29.51 +import java.util.List;
   29.52 +import java.util.Map;
   29.53 +import java.util.Set;
   29.54 +import javax.lang.model.element.TypeElement;
   29.55 +import javax.ws.rs.DefaultValue;
   29.56 +import javax.ws.rs.GET;
   29.57 +import javax.ws.rs.Path;
   29.58 +import javax.ws.rs.Produces;
   29.59 +import javax.ws.rs.QueryParam;
   29.60 +import org.codeviation.pojson.Pojson;
   29.61 +import org.netbeans.api.java.classpath.ClassPath;
   29.62 +import org.netbeans.api.java.source.ClassIndex.NameKind;
   29.63 +import org.netbeans.api.java.source.ClassIndex.SearchScope;
   29.64 +import org.netbeans.api.java.source.ClasspathInfo;
   29.65 +import org.netbeans.api.java.source.ElementHandle;
   29.66 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   29.67 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
   29.68 +import org.netbeans.modules.jumpto.type.GoToTypeAction;
   29.69 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
   29.70 +
   29.71 +/**
   29.72 + *
   29.73 + * @author lahvac
   29.74 + */
   29.75 +@Path("/index/type")
   29.76 +public class API {
   29.77 +
   29.78 +    @GET
   29.79 +    @Path("/search")
   29.80 +    @Produces("text/plain")
   29.81 +    public String findType(@QueryParam("path") String segment, @QueryParam("prefix") String prefix, @QueryParam("casesensitive") @DefaultValue("false") boolean casesensitive, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
   29.82 +        assert !asynchronous;
   29.83 +
   29.84 +        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
   29.85 +        boolean exact = prefix.endsWith(" "); // NOI18N
   29.86 +
   29.87 +        prefix = prefix.trim();
   29.88 +
   29.89 +        if ( prefix.length() == 0) {
   29.90 +            return "";
   29.91 +        }
   29.92 +
   29.93 +        NameKind nameKind;
   29.94 +        int wildcard = GoToTypeAction.containsWildCard(prefix);
   29.95 +
   29.96 +        if (exact) {
   29.97 +            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
   29.98 +            nameKind = NameKind.SIMPLE_NAME;
   29.99 +        }
  29.100 +        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
  29.101 +            nameKind = NameKind.CAMEL_CASE;
  29.102 +        }
  29.103 +        else if (wildcard != -1) {
  29.104 +            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
  29.105 +        }
  29.106 +        else {
  29.107 +            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
  29.108 +        }
  29.109 +
  29.110 +        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
  29.111 +        CategoryStorage srcRoots = CategoryStorage.forId(segment);
  29.112 +
  29.113 +        for (URL srcRoot : srcRoots.getCategoryIndexFolders()) {
  29.114 +            if (!"rel".equals(srcRoot.getProtocol())) continue;
  29.115 +            String rootId = srcRoot.getPath().substring(1);
  29.116 +            List<String> currentResult = new ArrayList<String>();
  29.117 +
  29.118 +            result.put(rootId, currentResult);
  29.119 +
  29.120 +            ClassIndexManager.getDefault().createUsagesQuery(srcRoot, true).isValid();
  29.121 +            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
  29.122 +            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
  29.123 +
  29.124 +            if (nameKind == NameKind.CAMEL_CASE) {
  29.125 +                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
  29.126 +            }
  29.127 +
  29.128 +            for (ElementHandle<TypeElement> d : names) {
  29.129 +                currentResult.add(d.getBinaryName());
  29.130 +            }
  29.131 +        }
  29.132 +
  29.133 +        return Pojson.save(result);
  29.134 +    }
  29.135 +
  29.136 +}
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java	Mon Jun 20 23:28:38 2011 +0200
    30.3 @@ -0,0 +1,141 @@
    30.4 +/*
    30.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    30.6 + *
    30.7 + * Copyright 2009-2011 Oracle and/or its affiliates. All rights reserved.
    30.8 + *
    30.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   30.10 + * Other names may be trademarks of their respective owners.
   30.11 + *
   30.12 + * The contents of this file are subject to the terms of either the GNU
   30.13 + * General Public License Version 2 only ("GPL") or the Common
   30.14 + * Development and Distribution License("CDDL") (collectively, the
   30.15 + * "License"). You may not use this file except in compliance with the
   30.16 + * License. You can obtain a copy of the License at
   30.17 + * http://www.netbeans.org/cddl-gplv2.html
   30.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   30.19 + * specific language governing permissions and limitations under the
   30.20 + * License.  When distributing the software, include this License Header
   30.21 + * Notice in each file and include the License file at
   30.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   30.23 + * particular file as subject to the "Classpath" exception as provided
   30.24 + * by Oracle in the GPL Version 2 section of the License file that
   30.25 + * accompanied this code. If applicable, add the following below the
   30.26 + * License Header, with the fields enclosed by brackets [] replaced by
   30.27 + * your own identifying information:
   30.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   30.29 + *
   30.30 + * If you wish your version of this file to be governed by only the CDDL
   30.31 + * or only the GPL Version 2, indicate your decision by adding
   30.32 + * "[Contributor] elects to include this software in this distribution
   30.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   30.34 + * single choice of license, a recipient has the option to distribute
   30.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   30.36 + * to extend the choice of license to its licensees as provided above.
   30.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   30.38 + * Version 2 license, then the option applies only if the new code is
   30.39 + * made subject to such option by the copyright holder.
   30.40 + *
   30.41 + * Contributor(s):
   30.42 + *
   30.43 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   30.44 + */
   30.45 +
   30.46 +package org.netbeans.modules.jackpot30.backend.type.ui;
   30.47 +
   30.48 +import java.util.Comparator;
   30.49 +import java.util.LinkedHashMap;
   30.50 +import java.util.Map.Entry;
   30.51 +import freemarker.template.TemplateException;
   30.52 +import java.io.IOException;
   30.53 +import java.net.URI;
   30.54 +import java.net.URISyntaxException;
   30.55 +import java.util.Collections;
   30.56 +import java.util.HashMap;
   30.57 +import java.util.LinkedList;
   30.58 +import java.util.List;
   30.59 +import java.util.Map;
   30.60 +import javax.ws.rs.GET;
   30.61 +import javax.ws.rs.Path;
   30.62 +import javax.ws.rs.Produces;
   30.63 +import javax.ws.rs.QueryParam;
   30.64 +import org.codeviation.pojson.Pojson;
   30.65 +import org.netbeans.modules.jackpot30.backend.base.FreemarkerUtilities;
   30.66 +import org.netbeans.modules.jackpot30.backend.base.WebUtilities;
   30.67 +import static org.netbeans.modules.jackpot30.backend.base.WebUtilities.escapeForQuery;
   30.68 +
   30.69 +/**
   30.70 + *
   30.71 + * @author lahvac
   30.72 + */
   30.73 +@Path("/index/type/ui")
   30.74 +public class UI {
   30.75 +
   30.76 +    @GET
   30.77 +    @Path("/search")
   30.78 +    @Produces("text/html")
   30.79 +    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
   30.80 +        Map<String, Object> configurationData = new HashMap<String, Object>();
   30.81 +
   30.82 +        configurationData.put("paths", list());
   30.83 +        configurationData.put("selectedPath", path);
   30.84 +        configurationData.put("prefix", prefix);
   30.85 +
   30.86 +        if (prefix != null && path != null) {
   30.87 +            URI u = new URI("http://localhost:9998/index/type/search?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
   30.88 +            long queryTime = System.currentTimeMillis();
   30.89 +            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
   30.90 +            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
   30.91 +            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
   30.92 +
   30.93 +            queryTime = System.currentTimeMillis() - queryTime;
   30.94 +
   30.95 +            for (Entry<String, List<String>> e : types.entrySet()) {
   30.96 +                for (String fqn : e.getValue()) {
   30.97 +                    Map<String, Object> found = new HashMap<String, Object>(3);
   30.98 +
   30.99 +                    found.put("fqn", fqn);
  30.100 +
  30.101 +                    if (fqn.contains("$")) {
  30.102 +                        fqn = fqn.substring(0, fqn.indexOf("$"));
  30.103 +                    }
  30.104 +
  30.105 +                    found.put("relativePath", e.getKey() + /*"/" + */fqn.replace('.', '/') + ".java");
  30.106 +
  30.107 +                    results.add(found);
  30.108 +                }
  30.109 +            }
  30.110 +
  30.111 +            Collections.sort(results, new Comparator<Map<String, Object>>() {
  30.112 +                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  30.113 +                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
  30.114 +                }
  30.115 +            });
  30.116 +            
  30.117 +            configurationData.put("results", results);
  30.118 +
  30.119 +            Map<String, Object> statistics = new HashMap<String, Object>();
  30.120 +
  30.121 +            statistics.put("queryTime", queryTime);
  30.122 +
  30.123 +            configurationData.put("statistics", statistics);
  30.124 +        }
  30.125 +
  30.126 +        return FreemarkerUtilities.processTemplate("org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html", configurationData);
  30.127 +    }
  30.128 +
  30.129 +    private static List<Map<String, String>> list() throws URISyntaxException {
  30.130 +        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
  30.131 +
  30.132 +        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
  30.133 +            Map<String, String> rootDesc = new HashMap<String, String>();
  30.134 +            String[] col = enc.split(":", 2);
  30.135 +
  30.136 +            rootDesc.put("segment", col[0]);
  30.137 +            rootDesc.put("displayName", col[1]);
  30.138 +            result.add(rootDesc);
  30.139 +        }
  30.140 +
  30.141 +        return result;
  30.142 +    }
  30.143 +    
  30.144 +}
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html	Mon Jun 20 23:28:38 2011 +0200
    31.3 @@ -0,0 +1,28 @@
    31.4 +<html>
    31.5 +<head>
    31.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    31.7 +</head>
    31.8 +<body>
    31.9 +<form method="get">
   31.10 +<label for="path">Project:</label>
   31.11 +<select size="1" name="path">");
   31.12 +    <#list paths as path>
   31.13 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
   31.14 +            ${path.displayName}
   31.15 +        </option>
   31.16 +    </#list>
   31.17 +</select>
   31.18 +<br>
   31.19 +<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
   31.20 +<input type="submit" name="Find Candidates"/>
   31.21 +</form>
   31.22 +
   31.23 +<#if results??>
   31.24 +    Found types:<br>
   31.25 +    <#list results as result>
   31.26 +        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
   31.27 +    </#list>
   31.28 +</#if>
   31.29 +
   31.30 +</body>
   31.31 +</html>
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/server/backend/web.main/build.xml	Mon Jun 20 23:28:38 2011 +0200
    32.3 @@ -0,0 +1,74 @@
    32.4 +<?xml version="1.0" encoding="UTF-8"?>
    32.5 +<!-- You may freely edit this file. See commented blocks below for -->
    32.6 +<!-- some examples of how to customize the build. -->
    32.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
    32.8 +<!-- By default, only the Clean and Build commands use this build script. -->
    32.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
   32.10 +<!-- the Compile on Save feature is turned off for the project. -->
   32.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
   32.12 +<!-- in the project's Project Properties dialog box.-->
   32.13 +<project name="web.main" default="default" basedir=".">
   32.14 +    <description>Builds, tests, and runs the project web.main.</description>
   32.15 +    <import file="nbproject/build-impl.xml"/>
   32.16 +    <!--
   32.17 +
   32.18 +    There exist several targets which are by default empty and which can be 
   32.19 +    used for execution of your tasks. These targets are usually executed 
   32.20 +    before and after some main targets. They are: 
   32.21 +
   32.22 +      -pre-init:                 called before initialization of project properties
   32.23 +      -post-init:                called after initialization of project properties
   32.24 +      -pre-compile:              called before javac compilation
   32.25 +      -post-compile:             called after javac compilation
   32.26 +      -pre-compile-single:       called before javac compilation of single file
   32.27 +      -post-compile-single:      called after javac compilation of single file
   32.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
   32.29 +      -post-compile-test:        called after javac compilation of JUnit tests
   32.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
   32.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
   32.32 +      -pre-jar:                  called before JAR building
   32.33 +      -post-jar:                 called after JAR building
   32.34 +      -post-clean:               called after cleaning build products
   32.35 +
   32.36 +    (Targets beginning with '-' are not intended to be called on their own.)
   32.37 +
   32.38 +    Example of inserting an obfuscator after compilation could look like this:
   32.39 +
   32.40 +        <target name="-post-compile">
   32.41 +            <obfuscate>
   32.42 +                <fileset dir="${build.classes.dir}"/>
   32.43 +            </obfuscate>
   32.44 +        </target>
   32.45 +
   32.46 +    For list of available properties check the imported 
   32.47 +    nbproject/build-impl.xml file. 
   32.48 +
   32.49 +
   32.50 +    Another way to customize the build is by overriding existing main targets.
   32.51 +    The targets of interest are: 
   32.52 +
   32.53 +      -init-macrodef-javac:     defines macro for javac compilation
   32.54 +      -init-macrodef-junit:     defines macro for junit execution
   32.55 +      -init-macrodef-debug:     defines macro for class debugging
   32.56 +      -init-macrodef-java:      defines macro for class execution
   32.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
   32.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
   32.59 +      run:                      execution of project 
   32.60 +      -javadoc-build:           Javadoc generation
   32.61 +      test-report:              JUnit report generation
   32.62 +
   32.63 +    An example of overriding the target for project execution could look like this:
   32.64 +
   32.65 +        <target name="run" depends="web.main-impl.jar">
   32.66 +            <exec dir="bin" executable="launcher.exe">
   32.67 +                <arg file="${dist.jar}"/>
   32.68 +            </exec>
   32.69 +        </target>
   32.70 +
   32.71 +    Notice that the overridden target depends on the jar target and not only on 
   32.72 +    the compile target as the regular run target does. Again, for a list of available 
   32.73 +    properties which you can use, check the target you are overriding in the
   32.74 +    nbproject/build-impl.xml file. 
   32.75 +
   32.76 +    -->
   32.77 +</project>
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/server/backend/web.main/manifest.mf	Mon Jun 20 23:28:38 2011 +0200
    33.3 @@ -0,0 +1,3 @@
    33.4 +Manifest-Version: 1.0
    33.5 +X-COMMENT: Main-Class will be added automatically by build
    33.6 +
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/server/backend/web.main/nbproject/build-impl.xml	Mon Jun 20 23:28:38 2011 +0200
    34.3 @@ -0,0 +1,1096 @@
    34.4 +<?xml version="1.0" encoding="UTF-8"?>
    34.5 +<!--
    34.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    34.7 +***         EDIT ../build.xml INSTEAD         ***
    34.8 +
    34.9 +For the purpose of easier reading the script
   34.10 +is divided into following sections:
   34.11 +
   34.12 +  - initialization
   34.13 +  - compilation
   34.14 +  - jar
   34.15 +  - execution
   34.16 +  - debugging
   34.17 +  - javadoc
   34.18 +  - junit compilation
   34.19 +  - junit execution
   34.20 +  - junit debugging
   34.21 +  - applet
   34.22 +  - cleanup
   34.23 +
   34.24 +        -->
   34.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="web.main-impl">
   34.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
   34.27 +        <condition>
   34.28 +            <not>
   34.29 +                <antversion atleast="1.8.0"/>
   34.30 +            </not>
   34.31 +        </condition>
   34.32 +    </fail>
   34.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
   34.34 +    <!-- 
   34.35 +                ======================
   34.36 +                INITIALIZATION SECTION 
   34.37 +                ======================
   34.38 +            -->
   34.39 +    <target name="-pre-init">
   34.40 +        <!-- Empty placeholder for easier customization. -->
   34.41 +        <!-- You can override this target in the ../build.xml file. -->
   34.42 +    </target>
   34.43 +    <target depends="-pre-init" name="-init-private">
   34.44 +        <property file="nbproject/private/config.properties"/>
   34.45 +        <property file="nbproject/private/configs/${config}.properties"/>
   34.46 +        <property file="nbproject/private/private.properties"/>
   34.47 +    </target>
   34.48 +    <target name="-pre-init-libraries">
   34.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
   34.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
   34.51 +        <pathconvert dirsep="/" property="libraries.dir">
   34.52 +            <path path="${libraries.dir.nativedirsep}"/>
   34.53 +        </pathconvert>
   34.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
   34.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
   34.56 +    </target>
   34.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
   34.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
   34.59 +            <filterchain>
   34.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   34.61 +                <escapeunicode/>
   34.62 +            </filterchain>
   34.63 +        </loadproperties>
   34.64 +    </target>
   34.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
   34.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
   34.67 +            <filterchain>
   34.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   34.69 +                <escapeunicode/>
   34.70 +            </filterchain>
   34.71 +        </loadproperties>
   34.72 +    </target>
   34.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
   34.74 +        <property file="${user.properties.file}"/>
   34.75 +        <!-- The two properties below are usually overridden -->
   34.76 +        <!-- by the active platform. Just a fallback. -->
   34.77 +        <property name="default.javac.source" value="1.4"/>
   34.78 +        <property name="default.javac.target" value="1.4"/>
   34.79 +    </target>
   34.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
   34.81 +        <property file="nbproject/configs/${config}.properties"/>
   34.82 +        <property file="nbproject/project.properties"/>
   34.83 +    </target>
   34.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
   34.85 +        <available file="${manifest.file}" property="manifest.available"/>
   34.86 +        <condition property="splashscreen.available">
   34.87 +            <and>
   34.88 +                <not>
   34.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   34.90 +                </not>
   34.91 +                <available file="${application.splash}"/>
   34.92 +            </and>
   34.93 +        </condition>
   34.94 +        <condition property="main.class.available">
   34.95 +            <and>
   34.96 +                <isset property="main.class"/>
   34.97 +                <not>
   34.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
   34.99 +                </not>
  34.100 +            </and>
  34.101 +        </condition>
  34.102 +        <condition property="manifest.available+main.class">
  34.103 +            <and>
  34.104 +                <isset property="manifest.available"/>
  34.105 +                <isset property="main.class.available"/>
  34.106 +            </and>
  34.107 +        </condition>
  34.108 +        <condition property="do.archive">
  34.109 +            <not>
  34.110 +                <istrue value="${jar.archive.disabled}"/>
  34.111 +            </not>
  34.112 +        </condition>
  34.113 +        <condition property="do.mkdist">
  34.114 +            <and>
  34.115 +                <isset property="do.archive"/>
  34.116 +                <isset property="libs.CopyLibs.classpath"/>
  34.117 +                <not>
  34.118 +                    <istrue value="${mkdist.disabled}"/>
  34.119 +                </not>
  34.120 +            </and>
  34.121 +        </condition>
  34.122 +        <condition property="manifest.available+main.class+mkdist.available">
  34.123 +            <and>
  34.124 +                <istrue value="${manifest.available+main.class}"/>
  34.125 +                <isset property="do.mkdist"/>
  34.126 +            </and>
  34.127 +        </condition>
  34.128 +        <condition property="do.archive+manifest.available">
  34.129 +            <and>
  34.130 +                <isset property="manifest.available"/>
  34.131 +                <istrue value="${do.archive}"/>
  34.132 +            </and>
  34.133 +        </condition>
  34.134 +        <condition property="do.archive+main.class.available">
  34.135 +            <and>
  34.136 +                <isset property="main.class.available"/>
  34.137 +                <istrue value="${do.archive}"/>
  34.138 +            </and>
  34.139 +        </condition>
  34.140 +        <condition property="do.archive+splashscreen.available">
  34.141 +            <and>
  34.142 +                <isset property="splashscreen.available"/>
  34.143 +                <istrue value="${do.archive}"/>
  34.144 +            </and>
  34.145 +        </condition>
  34.146 +        <condition property="do.archive+manifest.available+main.class">
  34.147 +            <and>
  34.148 +                <istrue value="${manifest.available+main.class}"/>
  34.149 +                <istrue value="${do.archive}"/>
  34.150 +            </and>
  34.151 +        </condition>
  34.152 +        <condition property="manifest.available-mkdist.available">
  34.153 +            <or>
  34.154 +                <istrue value="${manifest.available}"/>
  34.155 +                <isset property="do.mkdist"/>
  34.156 +            </or>
  34.157 +        </condition>
  34.158 +        <condition property="manifest.available+main.class-mkdist.available">
  34.159 +            <or>
  34.160 +                <istrue value="${manifest.available+main.class}"/>
  34.161 +                <isset property="do.mkdist"/>
  34.162 +            </or>
  34.163 +        </condition>
  34.164 +        <condition property="have.tests">
  34.165 +            <or>
  34.166 +                <available file="${test.src.dir}"/>
  34.167 +            </or>
  34.168 +        </condition>
  34.169 +        <condition property="have.sources">
  34.170 +            <or>
  34.171 +                <available file="${src.dir}"/>
  34.172 +            </or>
  34.173 +        </condition>
  34.174 +        <condition property="netbeans.home+have.tests">
  34.175 +            <and>
  34.176 +                <isset property="netbeans.home"/>
  34.177 +                <isset property="have.tests"/>
  34.178 +            </and>
  34.179 +        </condition>
  34.180 +        <condition property="no.javadoc.preview">
  34.181 +            <and>
  34.182 +                <isset property="javadoc.preview"/>
  34.183 +                <isfalse value="${javadoc.preview}"/>
  34.184 +            </and>
  34.185 +        </condition>
  34.186 +        <property name="run.jvmargs" value=""/>
  34.187 +        <property name="javac.compilerargs" value=""/>
  34.188 +        <property name="work.dir" value="${basedir}"/>
  34.189 +        <condition property="no.deps">
  34.190 +            <and>
  34.191 +                <istrue value="${no.dependencies}"/>
  34.192 +            </and>
  34.193 +        </condition>
  34.194 +        <property name="javac.debug" value="true"/>
  34.195 +        <property name="javadoc.preview" value="true"/>
  34.196 +        <property name="application.args" value=""/>
  34.197 +        <property name="source.encoding" value="${file.encoding}"/>
  34.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
  34.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  34.200 +            <and>
  34.201 +                <isset property="javadoc.encoding"/>
  34.202 +                <not>
  34.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
  34.204 +                </not>
  34.205 +            </and>
  34.206 +        </condition>
  34.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
  34.208 +        <property name="includes" value="**"/>
  34.209 +        <property name="excludes" value=""/>
  34.210 +        <property name="do.depend" value="false"/>
  34.211 +        <condition property="do.depend.true">
  34.212 +            <istrue value="${do.depend}"/>
  34.213 +        </condition>
  34.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  34.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  34.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
  34.217 +        </condition>
  34.218 +        <condition else="false" property="jdkBug6558476">
  34.219 +            <and>
  34.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
  34.221 +                <not>
  34.222 +                    <os family="unix"/>
  34.223 +                </not>
  34.224 +            </and>
  34.225 +        </condition>
  34.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
  34.227 +        <property name="jar.index" value="false"/>
  34.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
  34.229 +        <property name="copylibs.rebase" value="true"/>
  34.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  34.231 +    </target>
  34.232 +    <target name="-post-init">
  34.233 +        <!-- Empty placeholder for easier customization. -->
  34.234 +        <!-- You can override this target in the ../build.xml file. -->
  34.235 +    </target>
  34.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
  34.237 +        <fail unless="src.dir">Must set src.dir</fail>
  34.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
  34.239 +        <fail unless="build.dir">Must set build.dir</fail>
  34.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
  34.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  34.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  34.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  34.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  34.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  34.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
  34.247 +    </target>
  34.248 +    <target name="-init-macrodef-property">
  34.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  34.250 +            <attribute name="name"/>
  34.251 +            <attribute name="value"/>
  34.252 +            <sequential>
  34.253 +                <property name="@{name}" value="${@{value}}"/>
  34.254 +            </sequential>
  34.255 +        </macrodef>
  34.256 +    </target>
  34.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  34.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.259 +            <attribute default="${src.dir}" name="srcdir"/>
  34.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
  34.261 +            <attribute default="${javac.classpath}" name="classpath"/>
  34.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  34.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  34.264 +            <attribute default="${includes}" name="includes"/>
  34.265 +            <attribute default="${excludes}" name="excludes"/>
  34.266 +            <attribute default="${javac.debug}" name="debug"/>
  34.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
  34.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  34.269 +            <element name="customize" optional="true"/>
  34.270 +            <sequential>
  34.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
  34.272 +                <mkdir dir="${empty.dir}"/>
  34.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  34.274 +                <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}">
  34.275 +                    <src>
  34.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  34.277 +                            <include name="*"/>
  34.278 +                        </dirset>
  34.279 +                    </src>
  34.280 +                    <classpath>
  34.281 +                        <path path="@{classpath}"/>
  34.282 +                    </classpath>
  34.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  34.284 +                    <compilerarg line="${javac.compilerargs}"/>
  34.285 +                    <compilerarg value="-processorpath"/>
  34.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
  34.287 +                    <compilerarg line="${ap.processors.internal}"/>
  34.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  34.289 +                    <compilerarg value="-s"/>
  34.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  34.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
  34.292 +                    <customize/>
  34.293 +                </javac>
  34.294 +            </sequential>
  34.295 +        </macrodef>
  34.296 +    </target>
  34.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  34.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.299 +            <attribute default="${src.dir}" name="srcdir"/>
  34.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
  34.301 +            <attribute default="${javac.classpath}" name="classpath"/>
  34.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  34.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  34.304 +            <attribute default="${includes}" name="includes"/>
  34.305 +            <attribute default="${excludes}" name="excludes"/>
  34.306 +            <attribute default="${javac.debug}" name="debug"/>
  34.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
  34.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  34.309 +            <element name="customize" optional="true"/>
  34.310 +            <sequential>
  34.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
  34.312 +                <mkdir dir="${empty.dir}"/>
  34.313 +                <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}">
  34.314 +                    <src>
  34.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  34.316 +                            <include name="*"/>
  34.317 +                        </dirset>
  34.318 +                    </src>
  34.319 +                    <classpath>
  34.320 +                        <path path="@{classpath}"/>
  34.321 +                    </classpath>
  34.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  34.323 +                    <compilerarg line="${javac.compilerargs}"/>
  34.324 +                    <customize/>
  34.325 +                </javac>
  34.326 +            </sequential>
  34.327 +        </macrodef>
  34.328 +    </target>
  34.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  34.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.331 +            <attribute default="${src.dir}" name="srcdir"/>
  34.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
  34.333 +            <attribute default="${javac.classpath}" name="classpath"/>
  34.334 +            <sequential>
  34.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  34.336 +                    <classpath>
  34.337 +                        <path path="@{classpath}"/>
  34.338 +                    </classpath>
  34.339 +                </depend>
  34.340 +            </sequential>
  34.341 +        </macrodef>
  34.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
  34.344 +            <sequential>
  34.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
  34.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  34.347 +                    <path>
  34.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
  34.349 +                    </path>
  34.350 +                    <globmapper from="*.java" to="*.class"/>
  34.351 +                </pathconvert>
  34.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  34.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  34.354 +                <delete>
  34.355 +                    <files includesfile="${javac.includesfile.binary}"/>
  34.356 +                </delete>
  34.357 +                <delete>
  34.358 +                    <fileset file="${javac.includesfile.binary}"/>
  34.359 +                </delete>
  34.360 +            </sequential>
  34.361 +        </macrodef>
  34.362 +    </target>
  34.363 +    <target name="-init-macrodef-junit">
  34.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.365 +            <attribute default="${includes}" name="includes"/>
  34.366 +            <attribute default="${excludes}" name="excludes"/>
  34.367 +            <attribute default="**" name="testincludes"/>
  34.368 +            <sequential>
  34.369 +                <property name="junit.forkmode" value="perTest"/>
  34.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  34.371 +                    <batchtest todir="${build.test.results.dir}">
  34.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  34.373 +                            <filename name="@{testincludes}"/>
  34.374 +                        </fileset>
  34.375 +                    </batchtest>
  34.376 +                    <classpath>
  34.377 +                        <path path="${run.test.classpath}"/>
  34.378 +                    </classpath>
  34.379 +                    <syspropertyset>
  34.380 +                        <propertyref prefix="test-sys-prop."/>
  34.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  34.382 +                    </syspropertyset>
  34.383 +                    <formatter type="brief" usefile="false"/>
  34.384 +                    <formatter type="xml"/>
  34.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  34.386 +                    <jvmarg value="-ea"/>
  34.387 +                    <jvmarg line="${run.jvmargs}"/>
  34.388 +                </junit>
  34.389 +            </sequential>
  34.390 +        </macrodef>
  34.391 +    </target>
  34.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
  34.393 +    <target name="-profile-pre-init">
  34.394 +        <!-- Empty placeholder for easier customization. -->
  34.395 +        <!-- You can override this target in the ../build.xml file. -->
  34.396 +    </target>
  34.397 +    <target name="-profile-post-init">
  34.398 +        <!-- Empty placeholder for easier customization. -->
  34.399 +        <!-- You can override this target in the ../build.xml file. -->
  34.400 +    </target>
  34.401 +    <target name="-profile-init-macrodef-profile">
  34.402 +        <macrodef name="resolve">
  34.403 +            <attribute name="name"/>
  34.404 +            <attribute name="value"/>
  34.405 +            <sequential>
  34.406 +                <property name="@{name}" value="${env.@{value}}"/>
  34.407 +            </sequential>
  34.408 +        </macrodef>
  34.409 +        <macrodef name="profile">
  34.410 +            <attribute default="${main.class}" name="classname"/>
  34.411 +            <element name="customize" optional="true"/>
  34.412 +            <sequential>
  34.413 +                <property environment="env"/>
  34.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  34.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
  34.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
  34.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
  34.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  34.419 +                    <arg line="${application.args}"/>
  34.420 +                    <classpath>
  34.421 +                        <path path="${run.classpath}"/>
  34.422 +                    </classpath>
  34.423 +                    <syspropertyset>
  34.424 +                        <propertyref prefix="run-sys-prop."/>
  34.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  34.426 +                    </syspropertyset>
  34.427 +                    <customize/>
  34.428 +                </java>
  34.429 +            </sequential>
  34.430 +        </macrodef>
  34.431 +    </target>
  34.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
  34.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  34.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  34.435 +    </target>
  34.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  34.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  34.438 +            <attribute default="${main.class}" name="name"/>
  34.439 +            <attribute default="${debug.classpath}" name="classpath"/>
  34.440 +            <attribute default="" name="stopclassname"/>
  34.441 +            <sequential>
  34.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  34.443 +                    <classpath>
  34.444 +                        <path path="@{classpath}"/>
  34.445 +                    </classpath>
  34.446 +                </nbjpdastart>
  34.447 +            </sequential>
  34.448 +        </macrodef>
  34.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  34.450 +            <attribute default="${build.classes.dir}" name="dir"/>
  34.451 +            <sequential>
  34.452 +                <nbjpdareload>
  34.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
  34.454 +                        <include name="${fix.includes}*.class"/>
  34.455 +                    </fileset>
  34.456 +                </nbjpdareload>
  34.457 +            </sequential>
  34.458 +        </macrodef>
  34.459 +    </target>
  34.460 +    <target name="-init-debug-args">
  34.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
  34.462 +        <condition property="have-jdk-older-than-1.4">
  34.463 +            <or>
  34.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
  34.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
  34.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
  34.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
  34.468 +            </or>
  34.469 +        </condition>
  34.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  34.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
  34.472 +        </condition>
  34.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  34.474 +            <os family="windows"/>
  34.475 +        </condition>
  34.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  34.477 +            <isset property="debug.transport"/>
  34.478 +        </condition>
  34.479 +    </target>
  34.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
  34.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.482 +            <attribute default="${main.class}" name="classname"/>
  34.483 +            <attribute default="${debug.classpath}" name="classpath"/>
  34.484 +            <element name="customize" optional="true"/>
  34.485 +            <sequential>
  34.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  34.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  34.488 +                    <jvmarg line="${debug-args-line}"/>
  34.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  34.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  34.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  34.492 +                    <jvmarg line="${run.jvmargs}"/>
  34.493 +                    <classpath>
  34.494 +                        <path path="@{classpath}"/>
  34.495 +                    </classpath>
  34.496 +                    <syspropertyset>
  34.497 +                        <propertyref prefix="run-sys-prop."/>
  34.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  34.499 +                    </syspropertyset>
  34.500 +                    <customize/>
  34.501 +                </java>
  34.502 +            </sequential>
  34.503 +        </macrodef>
  34.504 +    </target>
  34.505 +    <target name="-init-macrodef-java">
  34.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  34.507 +            <attribute default="${main.class}" name="classname"/>
  34.508 +            <attribute default="${run.classpath}" name="classpath"/>
  34.509 +            <element name="customize" optional="true"/>
  34.510 +            <sequential>
  34.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  34.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  34.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  34.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  34.515 +                    <jvmarg line="${run.jvmargs}"/>
  34.516 +                    <classpath>
  34.517 +                        <path path="@{classpath}"/>
  34.518 +                    </classpath>
  34.519 +                    <syspropertyset>
  34.520 +                        <propertyref prefix="run-sys-prop."/>
  34.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  34.522 +                    </syspropertyset>
  34.523 +                    <customize/>
  34.524 +                </java>
  34.525 +            </sequential>
  34.526 +        </macrodef>
  34.527 +    </target>
  34.528 +    <target name="-init-macrodef-copylibs">
  34.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  34.530 +            <attribute default="${manifest.file}" name="manifest"/>
  34.531 +            <element name="customize" optional="true"/>
  34.532 +            <sequential>
  34.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  34.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
  34.535 +                    <path path="${run.classpath}"/>
  34.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
  34.537 +                </pathconvert>
  34.538 +                <pathconvert pathsep=" " property="jar.classpath">
  34.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
  34.540 +                    <chainedmapper>
  34.541 +                        <flattenmapper/>
  34.542 +                        <globmapper from="*" to="lib/*"/>
  34.543 +                    </chainedmapper>
  34.544 +                </pathconvert>
  34.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  34.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  34.547 +                    <fileset dir="${build.classes.dir}"/>
  34.548 +                    <manifest>
  34.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
  34.550 +                        <customize/>
  34.551 +                    </manifest>
  34.552 +                </copylibs>
  34.553 +            </sequential>
  34.554 +        </macrodef>
  34.555 +    </target>
  34.556 +    <target name="-init-presetdef-jar">
  34.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  34.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  34.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
  34.560 +            </jar>
  34.561 +        </presetdef>
  34.562 +    </target>
  34.563 +    <target name="-init-ap-cmdline-properties">
  34.564 +        <property name="annotation.processing.enabled" value="true"/>
  34.565 +        <property name="annotation.processing.processors.list" value=""/>
  34.566 +        <property name="annotation.processing.processor.options" value=""/>
  34.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
  34.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
  34.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  34.570 +        <condition property="ap.supported.internal" value="true">
  34.571 +            <not>
  34.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  34.573 +            </not>
  34.574 +        </condition>
  34.575 +    </target>
  34.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  34.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  34.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
  34.579 +        </condition>
  34.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  34.581 +            <isfalse value="${annotation.processing.enabled}"/>
  34.582 +        </condition>
  34.583 +    </target>
  34.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  34.585 +        <property name="ap.cmd.line.internal" value=""/>
  34.586 +    </target>
  34.587 +    <target depends="-pre-init,-init-private,-init-libraries,-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"/>
  34.588 +    <!--
  34.589 +                ===================
  34.590 +                COMPILATION SECTION
  34.591 +                ===================
  34.592 +            -->
  34.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
  34.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  34.595 +        <delete file="${built-jar.properties}" quiet="true"/>
  34.596 +    </target>
  34.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  34.598 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
  34.599 +    </target>
  34.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  34.601 +        <mkdir dir="${build.dir}"/>
  34.602 +        <touch file="${built-jar.properties}" verbose="false"/>
  34.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  34.604 +        <antcall target="-warn-already-built-jar"/>
  34.605 +        <propertyfile file="${built-jar.properties}">
  34.606 +            <entry key="${basedir}" value=""/>
  34.607 +        </propertyfile>
  34.608 +        <antcall target="-maybe-call-dep">
  34.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  34.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
  34.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
  34.612 +            <param name="call.target" value="jar"/>
  34.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  34.614 +        </antcall>
  34.615 +        <antcall target="-maybe-call-dep">
  34.616 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  34.617 +            <param location="${project.type_web_api}" name="call.subproject"/>
  34.618 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
  34.619 +            <param name="call.target" value="jar"/>
  34.620 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  34.621 +        </antcall>
  34.622 +    </target>
  34.623 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  34.624 +    <target depends="init" name="-check-automatic-build">
  34.625 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  34.626 +    </target>
  34.627 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  34.628 +        <antcall target="clean"/>
  34.629 +    </target>
  34.630 +    <target depends="init,deps-jar" name="-pre-pre-compile">
  34.631 +        <mkdir dir="${build.classes.dir}"/>
  34.632 +    </target>
  34.633 +    <target name="-pre-compile">
  34.634 +        <!-- Empty placeholder for easier customization. -->
  34.635 +        <!-- You can override this target in the ../build.xml file. -->
  34.636 +    </target>
  34.637 +    <target if="do.depend.true" name="-compile-depend">
  34.638 +        <pathconvert property="build.generated.subdirs">
  34.639 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  34.640 +                <include name="*"/>
  34.641 +            </dirset>
  34.642 +        </pathconvert>
  34.643 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  34.644 +    </target>
  34.645 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  34.646 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  34.647 +        <copy todir="${build.classes.dir}">
  34.648 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  34.649 +        </copy>
  34.650 +    </target>
  34.651 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
  34.652 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  34.653 +        <copy todir="${build.classes.dir}/META-INF">
  34.654 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
  34.655 +        </copy>
  34.656 +    </target>
  34.657 +    <target name="-post-compile">
  34.658 +        <!-- Empty placeholder for easier customization. -->
  34.659 +        <!-- You can override this target in the ../build.xml file. -->
  34.660 +    </target>
  34.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  34.662 +    <target name="-pre-compile-single">
  34.663 +        <!-- Empty placeholder for easier customization. -->
  34.664 +        <!-- You can override this target in the ../build.xml file. -->
  34.665 +    </target>
  34.666 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  34.667 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  34.668 +        <j2seproject3:force-recompile/>
  34.669 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  34.670 +    </target>
  34.671 +    <target name="-post-compile-single">
  34.672 +        <!-- Empty placeholder for easier customization. -->
  34.673 +        <!-- You can override this target in the ../build.xml file. -->
  34.674 +    </target>
  34.675 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  34.676 +    <!--
  34.677 +                ====================
  34.678 +                JAR BUILDING SECTION
  34.679 +                ====================
  34.680 +            -->
  34.681 +    <target depends="init" name="-pre-pre-jar">
  34.682 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  34.683 +        <mkdir dir="${dist.jar.dir}"/>
  34.684 +    </target>
  34.685 +    <target name="-pre-jar">
  34.686 +        <!-- Empty placeholder for easier customization. -->
  34.687 +        <!-- You can override this target in the ../build.xml file. -->
  34.688 +    </target>
  34.689 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  34.690 +        <j2seproject1:jar/>
  34.691 +    </target>
  34.692 +    <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">
  34.693 +        <j2seproject1:jar manifest="${manifest.file}"/>
  34.694 +    </target>
  34.695 +    <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">
  34.696 +        <j2seproject1:jar manifest="${manifest.file}">
  34.697 +            <j2seproject1:manifest>
  34.698 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  34.699 +            </j2seproject1:manifest>
  34.700 +        </j2seproject1:jar>
  34.701 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  34.702 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  34.703 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  34.704 +        <pathconvert property="run.classpath.with.dist.jar">
  34.705 +            <path path="${run.classpath}"/>
  34.706 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  34.707 +        </pathconvert>
  34.708 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  34.709 +    </target>
  34.710 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  34.711 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  34.712 +        <touch file="${tmp.manifest.file}" verbose="false"/>
  34.713 +    </target>
  34.714 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  34.715 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  34.716 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  34.717 +    </target>
  34.718 +    <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">
  34.719 +        <manifest file="${tmp.manifest.file}" mode="update">
  34.720 +            <attribute name="Main-Class" value="${main.class}"/>
  34.721 +        </manifest>
  34.722 +    </target>
  34.723 +    <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">
  34.724 +        <basename file="${application.splash}" property="splashscreen.basename"/>
  34.725 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  34.726 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  34.727 +        <manifest file="${tmp.manifest.file}" mode="update">
  34.728 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  34.729 +        </manifest>
  34.730 +    </target>
  34.731 +    <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">
  34.732 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  34.733 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  34.734 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  34.735 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  34.736 +    </target>
  34.737 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  34.738 +        <delete>
  34.739 +            <fileset file="${tmp.manifest.file}"/>
  34.740 +        </delete>
  34.741 +    </target>
  34.742 +    <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"/>
  34.743 +    <target name="-post-jar">
  34.744 +        <!-- Empty placeholder for easier customization. -->
  34.745 +        <!-- You can override this target in the ../build.xml file. -->
  34.746 +    </target>
  34.747 +    <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"/>
  34.748 +    <!--
  34.749 +                =================
  34.750 +                EXECUTION SECTION
  34.751 +                =================
  34.752 +            -->
  34.753 +    <target depends="init,compile" description="Run a main class." name="run">
  34.754 +        <j2seproject1:java>
  34.755 +            <customize>
  34.756 +                <arg line="${application.args}"/>
  34.757 +            </customize>
  34.758 +        </j2seproject1:java>
  34.759 +    </target>
  34.760 +    <target name="-do-not-recompile">
  34.761 +        <property name="javac.includes.binary" value=""/>
  34.762 +    </target>
  34.763 +    <target depends="init,compile-single" name="run-single">
  34.764 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  34.765 +        <j2seproject1:java classname="${run.class}"/>
  34.766 +    </target>
  34.767 +    <target depends="init,compile-test-single" name="run-test-with-main">
  34.768 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  34.769 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  34.770 +    </target>
  34.771 +    <!--
  34.772 +                =================
  34.773 +                DEBUGGING SECTION
  34.774 +                =================
  34.775 +            -->
  34.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  34.777 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
  34.778 +    </target>
  34.779 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  34.780 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  34.781 +    </target>
  34.782 +    <target depends="init,compile" name="-debug-start-debuggee">
  34.783 +        <j2seproject3:debug>
  34.784 +            <customize>
  34.785 +                <arg line="${application.args}"/>
  34.786 +            </customize>
  34.787 +        </j2seproject3:debug>
  34.788 +    </target>
  34.789 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  34.790 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  34.791 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  34.792 +    </target>
  34.793 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  34.794 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  34.795 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  34.796 +        <j2seproject3:debug classname="${debug.class}"/>
  34.797 +    </target>
  34.798 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  34.799 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  34.800 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  34.801 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  34.802 +    </target>
  34.803 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  34.804 +    <target depends="init" name="-pre-debug-fix">
  34.805 +        <fail unless="fix.includes">Must set fix.includes</fail>
  34.806 +        <property name="javac.includes" value="${fix.includes}.java"/>
  34.807 +    </target>
  34.808 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  34.809 +        <j2seproject1:nbjpdareload/>
  34.810 +    </target>
  34.811 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  34.812 +    <!--
  34.813 +                =================
  34.814 +                PROFILING SECTION
  34.815 +                =================
  34.816 +            -->
  34.817 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
  34.818 +        <nbprofiledirect>
  34.819 +            <classpath>
  34.820 +                <path path="${run.classpath}"/>
  34.821 +            </classpath>
  34.822 +        </nbprofiledirect>
  34.823 +        <profile/>
  34.824 +    </target>
  34.825 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
  34.826 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  34.827 +        <nbprofiledirect>
  34.828 +            <classpath>
  34.829 +                <path path="${run.classpath}"/>
  34.830 +            </classpath>
  34.831 +        </nbprofiledirect>
  34.832 +        <profile classname="${profile.class}"/>
  34.833 +    </target>
  34.834 +    <!--
  34.835 +                =========================
  34.836 +                APPLET PROFILING  SECTION
  34.837 +                =========================
  34.838 +            -->
  34.839 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
  34.840 +        <nbprofiledirect>
  34.841 +            <classpath>
  34.842 +                <path path="${run.classpath}"/>
  34.843 +            </classpath>
  34.844 +        </nbprofiledirect>
  34.845 +        <profile classname="sun.applet.AppletViewer">
  34.846 +            <customize>
  34.847 +                <arg value="${applet.url}"/>
  34.848 +            </customize>
  34.849 +        </profile>
  34.850 +    </target>
  34.851 +    <!--
  34.852 +                =========================
  34.853 +                TESTS PROFILING  SECTION
  34.854 +                =========================
  34.855 +            -->
  34.856 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
  34.857 +        <nbprofiledirect>
  34.858 +            <classpath>
  34.859 +                <path path="${run.test.classpath}"/>
  34.860 +            </classpath>
  34.861 +        </nbprofiledirect>
  34.862 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  34.863 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  34.864 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  34.865 +            <jvmarg line="${profiler.info.jvmargs}"/>
  34.866 +            <test name="${profile.class}"/>
  34.867 +            <classpath>
  34.868 +                <path path="${run.test.classpath}"/>
  34.869 +            </classpath>
  34.870 +            <syspropertyset>
  34.871 +                <propertyref prefix="test-sys-prop."/>
  34.872 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  34.873 +            </syspropertyset>
  34.874 +            <formatter type="brief" usefile="false"/>
  34.875 +            <formatter type="xml"/>
  34.876 +        </junit>
  34.877 +    </target>
  34.878 +    <!--
  34.879 +                ===============
  34.880 +                JAVADOC SECTION
  34.881 +                ===============
  34.882 +            -->
  34.883 +    <target depends="init" if="have.sources" name="-javadoc-build">
  34.884 +        <mkdir dir="${dist.javadoc.dir}"/>
  34.885 +        <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}">
  34.886 +            <classpath>
  34.887 +                <path path="${javac.classpath}"/>
  34.888 +            </classpath>
  34.889 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  34.890 +                <filename name="**/*.java"/>
  34.891 +            </fileset>
  34.892 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  34.893 +                <include name="**/*.java"/>
  34.894 +                <exclude name="*.java"/>
  34.895 +            </fileset>
  34.896 +        </javadoc>
  34.897 +        <copy todir="${dist.javadoc.dir}">
  34.898 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  34.899 +                <filename name="**/doc-files/**"/>
  34.900 +            </fileset>
  34.901 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  34.902 +                <include name="**/doc-files/**"/>
  34.903 +            </fileset>
  34.904 +        </copy>
  34.905 +    </target>
  34.906 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  34.907 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  34.908 +    </target>
  34.909 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  34.910 +    <!--
  34.911 +                =========================
  34.912 +                JUNIT COMPILATION SECTION
  34.913 +                =========================
  34.914 +            -->
  34.915 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  34.916 +        <mkdir dir="${build.test.classes.dir}"/>
  34.917 +    </target>
  34.918 +    <target name="-pre-compile-test">
  34.919 +        <!-- Empty placeholder for easier customization. -->
  34.920 +        <!-- You can override this target in the ../build.xml file. -->
  34.921 +    </target>
  34.922 +    <target if="do.depend.true" name="-compile-test-depend">
  34.923 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  34.924 +    </target>
  34.925 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  34.926 +        <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}"/>
  34.927 +        <copy todir="${build.test.classes.dir}">
  34.928 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  34.929 +        </copy>
  34.930 +    </target>
  34.931 +    <target name="-post-compile-test">
  34.932 +        <!-- Empty placeholder for easier customization. -->
  34.933 +        <!-- You can override this target in the ../build.xml file. -->
  34.934 +    </target>
  34.935 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  34.936 +    <target name="-pre-compile-test-single">
  34.937 +        <!-- Empty placeholder for easier customization. -->
  34.938 +        <!-- You can override this target in the ../build.xml file. -->
  34.939 +    </target>
  34.940 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  34.941 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  34.942 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  34.943 +        <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}"/>
  34.944 +        <copy todir="${build.test.classes.dir}">
  34.945 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  34.946 +        </copy>
  34.947 +    </target>
  34.948 +    <target name="-post-compile-test-single">
  34.949 +        <!-- Empty placeholder for easier customization. -->
  34.950 +        <!-- You can override this target in the ../build.xml file. -->
  34.951 +    </target>
  34.952 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  34.953 +    <!--
  34.954 +                =======================
  34.955 +                JUNIT EXECUTION SECTION
  34.956 +                =======================
  34.957 +            -->
  34.958 +    <target depends="init" if="have.tests" name="-pre-test-run">
  34.959 +        <mkdir dir="${build.test.results.dir}"/>
  34.960 +    </target>
  34.961 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  34.962 +        <j2seproject3:junit testincludes="**/*Test.java"/>
  34.963 +    </target>
  34.964 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  34.965 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  34.966 +    </target>
  34.967 +    <target depends="init" if="have.tests" name="test-report"/>
  34.968 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  34.969 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  34.970 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
  34.971 +        <mkdir dir="${build.test.results.dir}"/>
  34.972 +    </target>
  34.973 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  34.974 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  34.975 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  34.976 +    </target>
  34.977 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  34.978 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  34.979 +    </target>
  34.980 +    <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"/>
  34.981 +    <!--
  34.982 +                =======================
  34.983 +                JUNIT DEBUGGING SECTION
  34.984 +                =======================
  34.985 +            -->
  34.986 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  34.987 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  34.988 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  34.989 +        <delete file="${test.report.file}"/>
  34.990 +        <mkdir dir="${build.test.results.dir}"/>
  34.991 +        <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}">
  34.992 +            <customize>
  34.993 +                <syspropertyset>
  34.994 +                    <propertyref prefix="test-sys-prop."/>
  34.995 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  34.996 +                </syspropertyset>
  34.997 +                <arg value="${test.class}"/>
  34.998 +                <arg value="showoutput=true"/>
  34.999 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 34.1000 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 34.1001 +            </customize>
 34.1002 +        </j2seproject3:debug>
 34.1003 +    </target>
 34.1004 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 34.1005 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 34.1006 +    </target>
 34.1007 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 34.1008 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 34.1009 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 34.1010 +    </target>
 34.1011 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 34.1012 +    <!--
 34.1013 +                =========================
 34.1014 +                APPLET EXECUTION SECTION
 34.1015 +                =========================
 34.1016 +            -->
 34.1017 +    <target depends="init,compile-single" name="run-applet">
 34.1018 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 34.1019 +        <j2seproject1:java classname="sun.applet.AppletViewer">
 34.1020 +            <customize>
 34.1021 +                <arg value="${applet.url}"/>
 34.1022 +            </customize>
 34.1023 +        </j2seproject1:java>
 34.1024 +    </target>
 34.1025 +    <!--
 34.1026 +                =========================
 34.1027 +                APPLET DEBUGGING  SECTION
 34.1028 +                =========================
 34.1029 +            -->
 34.1030 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
 34.1031 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 34.1032 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
 34.1033 +            <customize>
 34.1034 +                <arg value="${applet.url}"/>
 34.1035 +            </customize>
 34.1036 +        </j2seproject3:debug>
 34.1037 +    </target>
 34.1038 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
 34.1039 +    <!--
 34.1040 +                ===============
 34.1041 +                CLEANUP SECTION
 34.1042 +                ===============
 34.1043 +            -->
 34.1044 +    <target name="-deps-clean-init" unless="built-clean.properties">
 34.1045 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
 34.1046 +        <delete file="${built-clean.properties}" quiet="true"/>
 34.1047 +    </target>
 34.1048 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
 34.1049 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
 34.1050 +    </target>
 34.1051 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
 34.1052 +        <mkdir dir="${build.dir}"/>
 34.1053 +        <touch file="${built-clean.properties}" verbose="false"/>
 34.1054 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
 34.1055 +        <antcall target="-warn-already-built-clean"/>
 34.1056 +        <propertyfile file="${built-clean.properties}">
 34.1057 +            <entry key="${basedir}" value=""/>
 34.1058 +        </propertyfile>
 34.1059 +        <antcall target="-maybe-call-dep">
 34.1060 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 34.1061 +            <param location="${project.base_web_api}" name="call.subproject"/>
 34.1062 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 34.1063 +            <param name="call.target" value="clean"/>
 34.1064 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 34.1065 +        </antcall>
 34.1066 +        <antcall target="-maybe-call-dep">
 34.1067 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 34.1068 +            <param location="${project.type_web_api}" name="call.subproject"/>
 34.1069 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
 34.1070 +            <param name="call.target" value="clean"/>
 34.1071 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 34.1072 +        </antcall>
 34.1073 +    </target>
 34.1074 +    <target depends="init" name="-do-clean">
 34.1075 +        <delete dir="${build.dir}"/>
 34.1076 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
 34.1077 +    </target>
 34.1078 +    <target name="-post-clean">
 34.1079 +        <!-- Empty placeholder for easier customization. -->
 34.1080 +        <!-- You can override this target in the ../build.xml file. -->
 34.1081 +    </target>
 34.1082 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
 34.1083 +    <target name="-check-call-dep">
 34.1084 +        <property file="${call.built.properties}" prefix="already.built."/>
 34.1085 +        <condition property="should.call.dep">
 34.1086 +            <not>
 34.1087 +                <isset property="already.built.${call.subproject}"/>
 34.1088 +            </not>
 34.1089 +        </condition>
 34.1090 +    </target>
 34.1091 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
 34.1092 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
 34.1093 +            <propertyset>
 34.1094 +                <propertyref prefix="transfer."/>
 34.1095 +                <mapper from="transfer.*" to="*" type="glob"/>
 34.1096 +            </propertyset>
 34.1097 +        </ant>
 34.1098 +    </target>
 34.1099 +</project>
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/server/backend/web.main/nbproject/genfiles.properties	Mon Jun 20 23:28:38 2011 +0200
    35.3 @@ -0,0 +1,8 @@
    35.4 +build.xml.data.CRC32=3059ce8d
    35.5 +build.xml.script.CRC32=5ddf268c
    35.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
    35.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    35.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    35.9 +nbproject/build-impl.xml.data.CRC32=3059ce8d
   35.10 +nbproject/build-impl.xml.script.CRC32=81ed8c6f
   35.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/server/backend/web.main/nbproject/project.properties	Mon Jun 20 23:28:38 2011 +0200
    36.3 @@ -0,0 +1,123 @@
    36.4 +annotation.processing.enabled=true
    36.5 +annotation.processing.enabled.in.editor=false
    36.6 +annotation.processing.run.all.processors=true
    36.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
    36.8 +application.title=web.main
    36.9 +application.vendor=lahvac
   36.10 +build.classes.dir=${build.dir}/classes
   36.11 +build.classes.excludes=**/*.java,**/*.form
   36.12 +# This directory is removed when the project is cleaned:
   36.13 +build.dir=build
   36.14 +build.generated.dir=${build.dir}/generated
   36.15 +build.generated.sources.dir=${build.dir}/generated-sources
   36.16 +# Only compile against the classpath explicitly listed here:
   36.17 +build.sysclasspath=ignore
   36.18 +build.test.classes.dir=${build.dir}/test/classes
   36.19 +build.test.results.dir=${build.dir}/test/results
   36.20 +# Uncomment to specify the preferred debugger connection transport:
   36.21 +#debug.transport=dt_socket
   36.22 +debug.classpath=\
   36.23 +    ${run.classpath}
   36.24 +debug.test.classpath=\
   36.25 +    ${run.test.classpath}
   36.26 +# This directory is removed when the project is cleaned:
   36.27 +dist.dir=dist
   36.28 +dist.jar=${dist.dir}/web.main.jar
   36.29 +dist.javadoc.dir=${dist.dir}/javadoc
   36.30 +endorsed.classpath=
   36.31 +excludes=
   36.32 +file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
   36.33 +file.reference.org-netbeans-modules-java-hints.jar=../../lib/org-netbeans-modules-java-hints.jar
   36.34 +file.reference.org-netbeans-modules-java-project.jar=../../lib/org-netbeans-modules-java-project.jar
   36.35 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
   36.36 +file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
   36.37 +file.reference.org-netbeans-modules-masterfs.jar=../../lib/org-netbeans-modules-masterfs.jar
   36.38 +file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
   36.39 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
   36.40 +file.reference.org-netbeans-modules-projectapi.jar=../../lib/org-netbeans-modules-projectapi.jar
   36.41 +file.reference.org-netbeans-modules-sendopts.jar=../../lib/org-netbeans-modules-sendopts.jar
   36.42 +file.reference.org-netbeans-spi-editor-hints.jar=../../lib/org-netbeans-spi-editor-hints.jar
   36.43 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
   36.44 +file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
   36.45 +file.reference.org-openide-util.jar=../../lib/org-openide-util.jar
   36.46 +file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
   36.47 +file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
   36.48 +file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
   36.49 +file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
   36.50 +includes=**
   36.51 +jar.compress=false
   36.52 +javac.classpath=\
   36.53 +    ${reference.type_web_api.jar}:\
   36.54 +    ${reference.base_web_api.jar}:\
   36.55 +    ${libs.jersey.classpath}:\
   36.56 +    ${libs.javac.classpath}:\
   36.57 +    ${libs.freemarker.classpath}:\
   36.58 +    ${libs.lucene.classpath}:\
   36.59 +    ${file.reference.org-netbeans-modules-versioning-system-cvss.jar}:\
   36.60 +    ${file.reference.org-netbeans-modules-versioning-util.jar}:\
   36.61 +    ${file.reference.org-netbeans-modules-versioning-indexingbridge.jar}:\
   36.62 +    ${file.reference.org-netbeans-modules-versioning.jar}:\
   36.63 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
   36.64 +    ${file.reference.org-netbeans-modules-masterfs.jar}:\
   36.65 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
   36.66 +    ${file.reference.org-openide-util.jar}:\
   36.67 +    ${file.reference.org-openide-util-lookup.jar}:\
   36.68 +    ${file.reference.org-netbeans-spi-editor-hints.jar}:\
   36.69 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
   36.70 +    ${file.reference.org-netbeans-modules-java-hints.jar}:\
   36.71 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
   36.72 +    ${file.reference.org-netbeans-modules-projectapi.jar}:\
   36.73 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
   36.74 +    ${file.reference.org-openide-filesystems.jar}:\
   36.75 +    ${file.reference.org-netbeans-modules-java-project.jar}:\
   36.76 +    ${file.reference.org-netbeans-modules-sendopts.jar}:\
   36.77 +    ${file.reference.util-commons.jar}:\
   36.78 +    ${file.reference.util-lutz.jar}:\
   36.79 +    ${file.reference.util-pojson.jar}:\
   36.80 +    ${file.reference.util-strast.jar}
   36.81 +# Space-separated list of extra javac options
   36.82 +javac.compilerargs=
   36.83 +javac.deprecation=false
   36.84 +javac.processorpath=\
   36.85 +    ${javac.classpath}
   36.86 +javac.source=1.6
   36.87 +javac.target=1.6
   36.88 +javac.test.classpath=\
   36.89 +    ${javac.classpath}:\
   36.90 +    ${build.classes.dir}:\
   36.91 +    ${libs.junit.classpath}
   36.92 +javac.test.processorpath=\
   36.93 +    ${javac.test.classpath}
   36.94 +javadoc.additionalparam=
   36.95 +javadoc.author=false
   36.96 +javadoc.encoding=${source.encoding}
   36.97 +javadoc.noindex=false
   36.98 +javadoc.nonavbar=false
   36.99 +javadoc.notree=false
  36.100 +javadoc.private=false
  36.101 +javadoc.splitindex=true
  36.102 +javadoc.use=true
  36.103 +javadoc.version=false
  36.104 +javadoc.windowtitle=
  36.105 +main.class=web.main.WebMain
  36.106 +manifest.file=manifest.mf
  36.107 +meta.inf.dir=${src.dir}/META-INF
  36.108 +mkdist.disabled=false
  36.109 +platform.active=default_platform
  36.110 +project.base_web_api=../base.web.api
  36.111 +project.type_web_api=../type.web.api
  36.112 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
  36.113 +reference.type_web_api.jar=${project.type_web_api}/dist/type.web.api.jar
  36.114 +run.classpath=\
  36.115 +    ${javac.classpath}:\
  36.116 +    ${build.classes.dir}
  36.117 +# Space-separated list of JVM arguments used when running the project
  36.118 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  36.119 +# or test-sys-prop.name=value to set system properties for unit tests):
  36.120 +run.jvmargs=
  36.121 +run.test.classpath=\
  36.122 +    ${javac.test.classpath}:\
  36.123 +    ${build.test.classes.dir}
  36.124 +source.encoding=UTF-8
  36.125 +src.dir=src
  36.126 +test.src.dir=test
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/server/backend/web.main/nbproject/project.xml	Mon Jun 20 23:28:38 2011 +0200
    37.3 @@ -0,0 +1,36 @@
    37.4 +<?xml version="1.0" encoding="UTF-8"?>
    37.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    37.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    37.7 +    <configuration>
    37.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    37.9 +            <name>web.main</name>
   37.10 +            <source-roots>
   37.11 +                <root id="src.dir"/>
   37.12 +            </source-roots>
   37.13 +            <test-roots>
   37.14 +                <root id="test.src.dir"/>
   37.15 +            </test-roots>
   37.16 +        </data>
   37.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
   37.18 +            <definitions>../../lib/nblibraries.properties</definitions>
   37.19 +        </libraries>
   37.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
   37.21 +            <reference>
   37.22 +                <foreign-project>base_web_api</foreign-project>
   37.23 +                <artifact-type>jar</artifact-type>
   37.24 +                <script>build.xml</script>
   37.25 +                <target>jar</target>
   37.26 +                <clean-target>clean</clean-target>
   37.27 +                <id>jar</id>
   37.28 +            </reference>
   37.29 +            <reference>
   37.30 +                <foreign-project>type_web_api</foreign-project>
   37.31 +                <artifact-type>jar</artifact-type>
   37.32 +                <script>build.xml</script>
   37.33 +                <target>jar</target>
   37.34 +                <clean-target>clean</clean-target>
   37.35 +                <id>jar</id>
   37.36 +            </reference>
   37.37 +        </references>
   37.38 +    </configuration>
   37.39 +</project>
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/server/backend/web.main/src/web/main/MainPage.java	Mon Jun 20 23:28:38 2011 +0200
    38.3 @@ -0,0 +1,60 @@
    38.4 +/*
    38.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    38.6 + *
    38.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    38.8 + *
    38.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   38.10 + * Other names may be trademarks of their respective owners.
   38.11 + *
   38.12 + * The contents of this file are subject to the terms of either the GNU
   38.13 + * General Public License Version 2 only ("GPL") or the Common
   38.14 + * Development and Distribution License("CDDL") (collectively, the
   38.15 + * "License"). You may not use this file except in compliance with the
   38.16 + * License. You can obtain a copy of the License at
   38.17 + * http://www.netbeans.org/cddl-gplv2.html
   38.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   38.19 + * specific language governing permissions and limitations under the
   38.20 + * License.  When distributing the software, include this License Header
   38.21 + * Notice in each file and include the License file at
   38.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   38.23 + * particular file as subject to the "Classpath" exception as provided
   38.24 + * by Oracle in the GPL Version 2 section of the License file that
   38.25 + * accompanied this code. If applicable, add the following below the
   38.26 + * License Header, with the fields enclosed by brackets [] replaced by
   38.27 + * your own identifying information:
   38.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   38.29 + *
   38.30 + * If you wish your version of this file to be governed by only the CDDL
   38.31 + * or only the GPL Version 2, indicate your decision by adding
   38.32 + * "[Contributor] elects to include this software in this distribution
   38.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   38.34 + * single choice of license, a recipient has the option to distribute
   38.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   38.36 + * to extend the choice of license to its licensees as provided above.
   38.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   38.38 + * Version 2 license, then the option applies only if the new code is
   38.39 + * made subject to such option by the copyright holder.
   38.40 + *
   38.41 + * Contributor(s):
   38.42 + *
   38.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   38.44 + */
   38.45 +
   38.46 +package web.main;
   38.47 +
   38.48 +import javax.ws.rs.GET;
   38.49 +import javax.ws.rs.Path;
   38.50 +
   38.51 +/**
   38.52 + *
   38.53 + * @author lahvac
   38.54 + */
   38.55 +@Path("/")
   38.56 +public class MainPage {
   38.57 +
   38.58 +    @GET
   38.59 +    public String main() {
   38.60 +        //XXX: should be constructed automatically from installed plugins
   38.61 +        return "<html><body><ul><li><a href='index/type/ui/search'>Search Type</a></li></ul></body></html>";
   38.62 +    }
   38.63 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/server/backend/web.main/src/web/main/WebMain.java	Mon Jun 20 23:28:38 2011 +0200
    39.3 @@ -0,0 +1,100 @@
    39.4 +/*
    39.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    39.6 + *
    39.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    39.8 + *
    39.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   39.10 + * Other names may be trademarks of their respective owners.
   39.11 + *
   39.12 + * The contents of this file are subject to the terms of either the GNU
   39.13 + * General Public License Version 2 only ("GPL") or the Common
   39.14 + * Development and Distribution License("CDDL") (collectively, the
   39.15 + * "License"). You may not use this file except in compliance with the
   39.16 + * License. You can obtain a copy of the License at
   39.17 + * http://www.netbeans.org/cddl-gplv2.html
   39.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   39.19 + * specific language governing permissions and limitations under the
   39.20 + * License.  When distributing the software, include this License Header
   39.21 + * Notice in each file and include the License file at
   39.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   39.23 + * particular file as subject to the "Classpath" exception as provided
   39.24 + * by Oracle in the GPL Version 2 section of the License file that
   39.25 + * accompanied this code. If applicable, add the following below the
   39.26 + * License Header, with the fields enclosed by brackets [] replaced by
   39.27 + * your own identifying information:
   39.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   39.29 + *
   39.30 + * If you wish your version of this file to be governed by only the CDDL
   39.31 + * or only the GPL Version 2, indicate your decision by adding
   39.32 + * "[Contributor] elects to include this software in this distribution
   39.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   39.34 + * single choice of license, a recipient has the option to distribute
   39.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   39.36 + * to extend the choice of license to its licensees as provided above.
   39.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   39.38 + * Version 2 license, then the option applies only if the new code is
   39.39 + * made subject to such option by the copyright holder.
   39.40 + *
   39.41 + * Contributor(s):
   39.42 + *
   39.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   39.44 + */
   39.45 +package web.main;
   39.46 +
   39.47 +import com.sun.grizzly.http.embed.GrizzlyWebServer;
   39.48 +import com.sun.grizzly.http.servlet.ServletAdapter;
   39.49 +import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
   39.50 +import com.sun.grizzly.tcp.http11.GrizzlyRequest;
   39.51 +import com.sun.grizzly.tcp.http11.GrizzlyResponse;
   39.52 +import com.sun.jersey.spi.container.servlet.ServletContainer;
   39.53 +import java.io.File;
   39.54 +import java.io.IOException;
   39.55 +import java.net.URL;
   39.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   39.57 +import org.netbeans.modules.jackpot30.backend.base.RelStreamHandlerFactory;
   39.58 +
   39.59 +/**
   39.60 + *
   39.61 + * @author lahvac
   39.62 + */
   39.63 +public class WebMain {
   39.64 +
   39.65 +    /**
   39.66 +     * @param args the command line arguments
   39.67 +     */
   39.68 +    public static void main(String... args) throws IOException {
   39.69 +        if (args.length != 1 && args.length != 2) {
   39.70 +            System.err.println("Usage: java -jar " + WebMain.class.getProtectionDomain().getCodeSource().getLocation().getPath() + " <cache> [<static-content>]");
   39.71 +            return ;
   39.72 +        }
   39.73 +
   39.74 +        CategoryStorage.setCacheRoot(new File(args[0]));
   39.75 +        
   39.76 +//        org.netbeans.ProxyURLStreamHandlerFactory.register();
   39.77 +        URL.setURLStreamHandlerFactory(new RelStreamHandlerFactory());
   39.78 +        
   39.79 +        GrizzlyWebServer gws;
   39.80 +
   39.81 +        if (args.length == 2) {
   39.82 +            gws = new GrizzlyWebServer(9998, args[1]);
   39.83 +        } else {
   39.84 +            gws = new GrizzlyWebServer(9998);
   39.85 +        }
   39.86 +
   39.87 +        // Jersey web resources
   39.88 +        ServletAdapter jerseyAdapter = new ServletAdapter();
   39.89 +        jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages", "org.netbeans.modules.jackpot30");
   39.90 +//        jerseyAdapter.setContextPath("/");
   39.91 +        jerseyAdapter.setServletInstance(new ServletContainer());
   39.92 +
   39.93 +        // register all above defined adapters
   39.94 +        gws.addGrizzlyAdapter(jerseyAdapter);
   39.95 +        gws.addGrizzlyAdapter(new GrizzlyAdapter(){
   39.96 +            public void service(GrizzlyRequest request, GrizzlyResponse response){}
   39.97 +        });
   39.98 +
   39.99 +        // let Grizzly run
  39.100 +        gws.start();
  39.101 +    }
  39.102 +
  39.103 +}
    40.1 --- a/server/download.xml	Fri Jun 10 11:20:36 2011 -0400
    40.2 +++ b/server/download.xml	Mon Jun 20 23:28:38 2011 +0200
    40.3 @@ -43,7 +43,7 @@
    40.4          <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-javadoc.jar" target="junit/junit-3.8.2-javadoc.jar" />
    40.5          <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-sources.jar" target="junit/junit-3.8.2-sources.jar" />
    40.6  
    40.7 -        <download url="http://bits.netbeans.org/netbeans/6.5/extra_ant_tasks/org-netbeans-modules-java-j2seproject-copylibstask.jar" target="CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar" />
    40.8 +        <download url="http://cdn.bitbucket.org/jlahoda/jackpot30/downloads/org-netbeans-modules-java-j2seproject-copylibstask.jar" target="CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar" />
    40.9          
   40.10          <download url="http://mirrors.ibiblio.org/pub/mirrors/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar" target="freemarker/freemarker-2.3.16.jar" />
   40.11  
    41.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Fri Jun 10 11:20:36 2011 -0400
    41.2 +++ b/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Mon Jun 20 23:28:38 2011 +0200
    41.3 @@ -40,6 +40,7 @@
    41.4  package org.netbeans.modules.jackpot30.hudson;
    41.5  
    41.6  import hudson.Extension;
    41.7 +import hudson.FilePath;
    41.8  import hudson.Launcher;
    41.9  import hudson.Proc;
   41.10  import hudson.model.AbstractBuild;
   41.11 @@ -47,6 +48,7 @@
   41.12  import hudson.model.Descriptor;
   41.13  import hudson.model.Descriptor.FormException;
   41.14  import hudson.model.Hudson;
   41.15 +import hudson.remoting.VirtualChannel;
   41.16  import hudson.scm.ChangeLogSet.AffectedFile;
   41.17  import hudson.scm.ChangeLogSet.Entry;
   41.18  import hudson.scm.EditType;
   41.19 @@ -62,7 +64,10 @@
   41.20  import java.io.OutputStreamWriter;
   41.21  import java.io.Reader;
   41.22  import java.io.Writer;
   41.23 +import java.net.URI;
   41.24 +import java.net.URL;
   41.25  import java.util.Arrays;
   41.26 +import java.util.Collection;
   41.27  import java.util.HashSet;
   41.28  import java.util.List;
   41.29  import java.util.Set;
   41.30 @@ -123,21 +128,21 @@
   41.31  
   41.32          boolean success = doIndex(getDescriptor().getCacheDir(), build, launcher, listener, addedFiles, removedFiles);
   41.33  
   41.34 -        //XXX:
   41.35 -        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
   41.36 -        String jsonContent = readFully(info);
   41.37 -        JSONObject json = JSONObject.fromObject(jsonContent);
   41.38 -
   41.39 -        String prjName = projectName;
   41.40 -
   41.41 -        if (prjName == null || prjName.isEmpty()) {
   41.42 -            prjName = build.getParent().getDisplayName();
   41.43 -        }
   41.44 -
   41.45 -        if (!prjName.equals(json.get("displayName"))) {
   41.46 -            json.put("displayName", prjName);
   41.47 -            write(info, JSONSerializer.toJSON(json).toString());
   41.48 -        }
   41.49 +//        //XXX:
   41.50 +//        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
   41.51 +//        String jsonContent = readFully(info);
   41.52 +//        JSONObject json = JSONObject.fromObject(jsonContent);
   41.53 +//
   41.54 +//        String prjName = projectName;
   41.55 +//
   41.56 +//        if (prjName == null || prjName.isEmpty()) {
   41.57 +//            prjName = build.getParent().getDisplayName();
   41.58 +//        }
   41.59 +//
   41.60 +//        if (!prjName.equals(json.get("displayName"))) {
   41.61 +//            json.put("displayName", prjName);
   41.62 +//            write(info, JSONSerializer.toJSON(json).toString());
   41.63 +//        }
   41.64  
   41.65          return success;
   41.66      }
   41.67 @@ -202,22 +207,29 @@
   41.68  
   41.69          t = t.forNode(build.getBuiltOn(), listener);
   41.70  
   41.71 -        listener.getLogger().println("Running: " + toolName);
   41.72 +        RemoteResult res = build.getWorkspace().act(new FilePath.FileCallable<RemoteResult>() {
   41.73 +            public RemoteResult invoke(File file, VirtualChannel vc) throws IOException, InterruptedException {
   41.74 +                Set<String> projects = new HashSet<String>();
   41.75  
   41.76 -        File a = File.createTempFile("jck30", "");
   41.77 -        File r = File.createTempFile("jck30", "");
   41.78 +                findProjects(file, projects, new StringBuilder());
   41.79  
   41.80 -        dumpToFile(a, addedOrModified);
   41.81 -        dumpToFile(r, removed);
   41.82 +                return new RemoteResult(projects, file.getCanonicalPath()/*XXX: will resolve symlinks!!!*/);
   41.83 +            }
   41.84 +        });
   41.85  
   41.86 +        listener.getLogger().println("Running: " + toolName + " on projects: " + res);
   41.87 +
   41.88 +        String codeName = build.getParent().getName();
   41.89          ArgumentListBuilder args = new ArgumentListBuilder();
   41.90 +        FilePath targetZip = build.getWorkspace().createTempFile(codeName, "zip");
   41.91  
   41.92          //XXX: there should be a way to specify Java runtime!
   41.93 -        args.add(new File(t.getHome(), "index")); //XXX
   41.94 -        args.add(".");
   41.95 -        args.add(cacheDir);
   41.96 -        args.add(a.getAbsolutePath());
   41.97 -        args.add(r.getAbsolutePath());
   41.98 +        args.add(new File(t.getHome(), "index.sh")); //XXX
   41.99 +        args.add(codeName);
  41.100 +        args.add(projectName); //XXX
  41.101 +        args.add(targetZip);
  41.102 +        args.add(res.root);
  41.103 +        args.add(res.foundProjects.toArray(new String[0]));
  41.104  
  41.105          Proc indexer = launcher.launch().pwd(build.getWorkspace())
  41.106                                                  .cmds(args)
  41.107 @@ -226,8 +238,20 @@
  41.108  
  41.109          indexer.join();
  41.110  
  41.111 -        a.delete();
  41.112 -        r.delete();
  41.113 +        File oldCacheDir = new File(cacheDir, codeName + ".old");
  41.114 +        File segCacheDir = new File(cacheDir, codeName);
  41.115 +        File newCacheDir = new File(cacheDir, codeName + ".new");
  41.116 +
  41.117 +        targetZip.unzip(new FilePath(newCacheDir));
  41.118 +
  41.119 +        segCacheDir.renameTo(oldCacheDir);
  41.120 +
  41.121 +        new File(newCacheDir, codeName).renameTo(segCacheDir);
  41.122 +
  41.123 +        new URL("http://localhost:9998/index/internal/indexUpdated").openStream().close();
  41.124 +
  41.125 +        new FilePath(newCacheDir).deleteRecursive();
  41.126 +        new FilePath(oldCacheDir).deleteRecursive();
  41.127  
  41.128          return true;
  41.129      }
  41.130 @@ -253,6 +277,34 @@
  41.131          return null;
  41.132      }
  41.133  
  41.134 +    private static void findProjects(File root, Collection<String> result, StringBuilder relPath) {
  41.135 +        int len = relPath.length();
  41.136 +        boolean first = relPath.length() == 0;
  41.137 +
  41.138 +        if (new File(root, "nbproject").isDirectory()) result.add(relPath.toString());
  41.139 +
  41.140 +        File[] children = root.listFiles();
  41.141 +
  41.142 +        if (children != null) {
  41.143 +            for (File c : children) {
  41.144 +                if (!first)
  41.145 +                    relPath.append("/");
  41.146 +                relPath.append(c.getName());
  41.147 +                findProjects(c, result, relPath);
  41.148 +                relPath.delete(len, relPath.length());
  41.149 +            }
  41.150 +        }
  41.151 +    }
  41.152 +
  41.153 +    private static final class RemoteResult {
  41.154 +        private final Collection<String> foundProjects;
  41.155 +        private final String root;
  41.156 +        public RemoteResult(Collection<String> foundProjects, String root) {
  41.157 +            this.foundProjects = foundProjects;
  41.158 +            this.root = root;
  41.159 +        }
  41.160 +    }
  41.161 +    
  41.162      @Extension // this marker indicates Hudson that this is an implementation of an extension point.
  41.163      public static final class DescriptorImpl extends Descriptor<Builder> {
  41.164  
    42.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Fri Jun 10 11:20:36 2011 -0400
    42.2 +++ b/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Mon Jun 20 23:28:38 2011 +0200
    42.3 @@ -73,7 +73,6 @@
    42.4  
    42.5              if (!cacheDir.exists()) {
    42.6                  cacheDir.mkdirs();
    42.7 -                new FileOutputStream(new File(cacheDir, "segments")).close();
    42.8              }
    42.9              
   42.10              LogTaskListener listener = new LogTaskListener(Logger.global, Level.INFO);
   42.11 @@ -81,7 +80,7 @@
   42.12  
   42.13              ArgumentListBuilder args = new ArgumentListBuilder();
   42.14              Launcher launcher = new Launcher.LocalLauncher(listener);
   42.15 -            args.add(new File(tool.getHome(), "web")); //XXX
   42.16 +            args.add(new File(tool.getHome(), "web.sh")); //XXX
   42.17              args.add(cacheDir);
   42.18  
   42.19              frontend = launcher.launch().cmds(args)
    43.1 --- a/server/temp-build-indexing-backend	Fri Jun 10 11:20:36 2011 -0400
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,22 +0,0 @@
    43.4 -#!/bin/bash
    43.5 -(cd indexer; ant clean && ant jar)
    43.6 -(cd web.api; ant clean && ant jar)
    43.7 -mkdir -p ../build/temp-indexing-backend/indexer
    43.8 -mkdir -p ../build/temp-indexing-backend/web.api
    43.9 -cp -r indexer/dist/* ../build/temp-indexing-backend/indexer
   43.10 -cp -r web.api/dist/* ../build/temp-indexing-backend/web.api
   43.11 -
   43.12 -cat >../build/temp-indexing-backend/index <<EOF
   43.13 -DIR=\`dirname \$0\`
   43.14 -java -Xbootclasspath/p:\$DIR/indexer/lib/javac-api-nb-7.0-b07.jar:\$DIR/indexer/lib/javac-impl-nb-7.0-b07.jar -jar \$DIR/indexer/indexer.jar -store-sources "\$@"
   43.15 -EOF
   43.16 -
   43.17 -cat >../build/temp-indexing-backend/web <<EOF
   43.18 -DIR=\`dirname \$0\`
   43.19 -java -Xbootclasspath/p:\$DIR/web.api/lib/javac-api-nb-7.0-b07.jar:\$DIR/web.api/lib/javac-impl-nb-7.0-b07.jar -jar \$DIR/web.api/web.api.jar "\$@"
   43.20 -EOF
   43.21 -
   43.22 -chmod u+x ../build/temp-indexing-backend/index
   43.23 -chmod u+x ../build/temp-indexing-backend/web
   43.24 -
   43.25 -(cd ../build; zip -r temp-indexing-backend.zip temp-indexing-backend)