You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2004/09/23 18:39:03 UTC

svn commit: rev 47110 - in incubator/derby/code/trunk: . java/drda/org/apache/derby/impl/drda java/engine/org/apache/derby/iapi/services/diag java/engine/org/apache/derby/iapi/services/info java/engine/org/apache/derby/impl/services/uuid java/engine/org/apache/derby/impl/sql/execute java/engine/org/apache/derby/impl/store/raw/log java/tools/org/apache/derby/impl/tools/sysinfo java/tools/org/apache/derby/tools

Author: djd
Date: Thu Sep 23 09:39:02 2004
New Revision: 47110

Modified:
   incubator/derby/code/trunk/BUILDING.txt   (contents, props changed)
   incubator/derby/code/trunk/build.xml   (contents, props changed)
   incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/diag/Performance.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/info/ProductVersionHolder.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
   incubator/derby/code/trunk/java/tools/org/apache/derby/tools/sysinfo.java
Log:
Test to set the eol-style to native for BUILDING.txt


Modified: incubator/derby/code/trunk/BUILDING.txt
==============================================================================
--- incubator/derby/code/trunk/BUILDING.txt	(original)
+++ incubator/derby/code/trunk/BUILDING.txt	Thu Sep 23 09:39:02 2004
@@ -1,586 +1,586 @@
-
-                     Building Derby
-================================================================
-
-Contents
-
-1     About this document
-1.1   Who should read this document
-1.2   Notes
-
-2     Downloads
-2.1   Download source code
-2.2   Download required software
-2.2.1 Download and install Apache Ant 1.6.x
-2.2.2 Download and install Java Development Kit release 1.4.x
-2.2.3 Download and install Java Development Kit release 1.3.x
-2.2.4 Download extensions for Java Development Kit release 1.3.x
-2.2.5 Download Java Compiler Compiler (JavaCC) version 3.1
-2.2.6 Download jakarta-servlet API 4 (Servlet 2.4)
-2.2.7 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
-2.2.8 Download Jikes 1.14 (Optional)
-
-3     Build instructions
-3.1   Set required environmental variables
-3.2   Create property file
-3.3   Run Derby build
-3.4   Verify Derby build
-
-4     Derby build miscellaneous information
-4.1   Derby build targets
-4.2   Derby source code upgrade
-4.3   Derby build flow
-
-
----------------------------------------------------------------
-1     About this document
-
-This document contains the instructions to build a binary
-distribution version of the derby database from a source 
-distribution. 
-
-
-
-1.1   Who should read this document
-
-This document is intended for any one interested in 
-downloading and building a binary distribution of
-derby source distribution. 
-
-
-
-1.2   Notes
-
-The following conventions are followed in the document:
-
-(1) The directories are referred in unix convention.
-    For Windows, / should be replaced with \.
-
-(2) All examples or commands are given in unix conventions.
-    For Windows, modify the examples or commands as per
-    windows conventions.
- 
-(3) This document contains urls to download required
-    software for derby builds. Urls may change anytime.
-    If there is any problem with any url, notify it
-    via derby mailing list.
-
-
-
----------------------------------------------------------------
-2     Downloads
-
-Prior to building derby source code, download derby source
-code and required software as following:
-
-
-
-2.1   Download source code
-
-Create a new directory and download derby source code in 
-this directory. This directory will be referred to as the 
-${derby.source} directory in the rest of this document. 
-
-After downloading source code to directory ${derby.source},
-there should be the following files and directories:
-
-${derby.source}/build.xml 
-${debry.source}/java 
-${derby.source}/tools 
-
-
-
-2.2   Download required software
-
-This section lists all the required software for Derby
-build environment.
-
-Notes:
------ 
-(1) Derby build environment requires you to install two levels of 
-    Java Development Kit (JDK) - 1.3.x and 1.4.x as Derby is designed 
-    to work in JDK1.3.x (JDBC 2.0) and JDK 1.4.x (JDBC 3.0) 
-    environments. The Derby build is set up such that that most of 
-    the code is compiled against JDK 1.3.x libraries so that no 
-    dependencies on JDK 1.4.x classes exist, except for the code 
-    that only runs in JDK1.4.x. In addition Derby's JDBC 2.0 
-    implementation must compile against JDBC 2.0 class definitions 
-    and the JDBC 3.0 implementation against JDBC 3.0 class 
-    definitions.
-
-(2) The Derby build environment is tested with JDK 131 (Sun), 
-    JDK 141(Sun), and Ant 161. The Derby build environment should
-    work with other versions and other sources of JDK 13 (1.3.x) 
-    and JDK 14 (1.4.x), and other versions of Ant 1.6 (1.6.x).
-
-
-
-2.2.1 Download and install Apache Ant 1.6.x
-
-(1) Download a binary distribution of Ant 1.6.x from:
-         http://ant.apache.org/bindownload.cgi
-
-(2) Install Ant 1.6.x in any directory. This 
-    directory will be referred to as ${ant.dir} 
-    directory in the rest of this document. 
-
-
-
-2.2.2 Download and install Java Development Kit (JDK) release 1.4.x
-
-Skip steps 1-2 of this section if you already have JDK 1.4.x 
-installed on your system.  
-
-(1) Download JDK 1.4.x. 
-    The reference implementation is available at:
-       http://java.sun.com/j2se
-
-(2) Install JDK 1.4.x according to the instructions included 
-    with the release in any directory. 
-
-(3) The directory where you have installed JDK 1.4.x will be 
-    referred to as ${jdk14.dir} in the rest of this document.
-
-
-
-2.2.3 Download and install Java Development Kit (JDK) release 1.3.x
-
-Skip steps 1-2 of this section if you already have JDK 1.3.x 
-installed on your system.  
-
-(1) Download JDK 1.3.x. 
-    The reference implementation is available at:
-       http://java.sun.com/j2se
-
-(2) Install JDK 1.3.x according to the instructions included 
-    with the release in any directory. 
-
-(3) The directory where you have installed JDK 1.3.x will be 
-    referred to as ${jdk13.dir} in the rest of this document.
-
-
-
-2.2.4 Download extensions for Java Development Kit release 1.3.x
-
-(1) JDBC 2.0
-
-    Download JDBC 2.0 (jdbc2_0-stdext.jar) from:
-      http://java.sun.com/products/jdbc/download.html
-    by selecting "JDBC 2.0 Optional Package Binary".
-
-    Save jdbc2_0-stdext.jar file in directory
-      ${derby.source}/tools/java 
-
-
-(2) Java Transaction API (JTA) 1.0.1B
-
-    Download JTA 1.0.1B (jta-1_0_1B-classes.zip) from:
-      http://java.sun.com/products/jta/ 
-    by selecting "Class files".
-
-    Save jta-1_0_1B-classes.zip file in directory
-      ${derby.source}/tools/java 
-
-
-(3) Java Cryptography Extension (JCE) version 1.2.2
-
-    Download JCE 1.2.2 (jce-1_2_2.zip) from:
-      http://java.sun.com/products/jce/index-122.html
-
-    Note: You will need to register to download JCE 1.2.2.
-
-    The downloaded file (jce-1_2_2.zip)  for JCE contains 
-    documentation files and multiple jar files. After 
-    downloading the zip file, unzip the file and copy only 
-    jce1.2.2/lib/jce1_2_2.jar file to directory 
-      ${derby.source}/tools/java
-
-
-
-2.2.5 Download Java Compiler Compiler (JavaCC) version 3.1
-
-JavaCC 3.1 (javacc-3.1.zip or javacc-3.1.tar.gz) can be 
-downloaded from:
-    https://javacc.dev.java.net/
-
-Note: The latest available version of JavaCC is 3.2.
-However, JavaCC 3.1 is the requirement for Derby build
-environment.
-
-The downloaded file (javacc-3.1.zip or javacc-3.1.tar.gz) 
-contains documentation and other files. After downloading 
-the zip or tar file, unzip or untar the file and copy only 
-javacc-3.1/bin/lib/javacc.jar file to directory 
-   ${derby.source}/tools/java 
-
-
-
-2.2.6 Download jakarta-servlet API 4 (Servlet 2.4)
-
-jakarta-servlet API 4 (jakarta-servletapi-4-yyyymmdd.zip or
-jakarta-servletapi-4-yyyymmdd.tar.gz) can be downloaded from:
-   http://cvs.apache.org/builds/jakarta-servletapi-4/nightly/
-
-Note: There is zip and tar file for nightly build for every day.
-Download the zip or tar file for latest day.
- 
-The downloaded file (jakarta-servletapi-4-yyyymmdd.zip or
-jakarta-servletapi-4-yyyymmdd.tar.gz) contains documentation and 
-other files. After downloading the zip or tar file, unzip or 
-untar the file and copy only jakarta-servletapi-4/lib/servlet.jar 
-file to directory 
-   ${derby.source}/tools/java 
-
-
-
-2.2.7 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
-
-This is an optional section.
-The reason is that osgi.jar is required to only build the 
-class org.apache.derby.osgi.EmbeddedActivator. This class 
-and jar file manifest entries created in derby.jar allow 
-that jar file to be an OSGi bundle. If osgi.jar is not 
-present EmbeddedActivator will not be build and derby.jar 
-will not contain the manifest entries to be an OSGi bundle.
-
-OSGi Service Platform release 3 (osgi.jar) can be downloaded from: 
-   http://osgi.org
-
-Note: You will need to register to download OSGi Service Platform 
-      release 3.
-
-The downloaded file should be copied to directory
-   ${derby.source}/tools/java 
-
-
-
-Note: After following the steps in sections 2.2.4-2.2.7 of this
-document, you should have the following:
-
-${derby.source}/tools/java/javacc.jar
-${derby.source}/tools/java/jce1_2_2.jar 
-${derby.source}/tools/java/jdbc2_0-stdext.jar
-${derby.source}/tools/java/jta-1_0_1B-classes.zip 
-${derby.source}/tools/java/servlet.jar
-${derby.source}/tools/java/osgi.jar
-
-
-
-2.2.8 Download and Install Jikes 1.14 (Optional)
-
-This is an optional section.
-
-Jikes is an open source java compiler that improves compile 
-speed over standard java compiler. If you would like to have 
-improved compile speed, you can proceed to install Jikes. 
-Jikes 1.14 is the required version for derby builds.
-
-Jikes 1.14 can be downloaded from:
-    http://www.ibm.com/developerworks/oss/jikes/
-     
-Install Jikes 1.14 in any directory. This directory will be 
-referred to as the ${jikes.dir} directory in the rest of this 
-document. 
-
-
-
----------------------------------------------------------------
-3     Build instructions
-
-
-3.1   Set Required Environmental Variables
-
-(1) Create environment variable ANT_HOME  to point to the 
-    directory where you have installed Ant. For example:
-
-     setenv ANT_HOME ${ant.dir} -- On unix(csh)
-     export ANT_HOME=${ant.dir} -- On unix(ksh)
-     set ANT_HOME=${ant.dir}    -- On Windows
-
-(2) Modify the PATH environment variable to include the 
-    directory ${ant.dir}/bin in its list. This makes the "ant" 
-    command line script available, which will be used to 
-    actually perform the build. Also, if you opted to install
-    jikes in section 2.2.8 of this document, add ${jikes.dir} 
-    to the PATH as well. For example:
-
-     setenv PATH ${ant.dir}/bin:${jikes.dir}:$PATH -- On unix(csh)
-     export PATH=${ant.dir}/bin:${jikes.dir}:$PATH -- On unix(ksh)
-     set PATH=${ant.dir}\bin;${jikes.dir};%PATH%   -- On Windows
-
-(3) Create environment variable JAVA_HOME  to point to the 
-    directory where you have installed JDK 1.4.x. For example:
-
-     setenv JAVA_HOME ${jdk14.dir} -- On unix(csh).
-     export JAVA_HOME=${jdk14.dir} -- On unix(ksh)
-     set JAVA_HOME=${jdk14.dir}    -- On Windows
-
-
-
-3.2   Create property file
-
-You will need to create a property file to specify
-your environment and some of your options. Do the following
-to specify your environment and options:
-
-(1) Find out user home directory on your system. You can find  
-    user home directory by doing echo on variable %HOME% 
-    on windows and $home or $HOME on unix.
-
-(2) Create a file called "ant.properties" in user home 
-    directory and define the following variables in 
-    "ant.properties":
-   
-    - j14lib
-
-      This is a required variable which defines the location of
-      JDK 1.4.x. Define the variable as following:
-
-          j14lib=${jdk14.dir}/jre/lib
-      
-      where ${jdk14.dir} is the directory name where you have 
-      installed JDK 1.4.x. Check out section 2.2.2 of this document. 
-
-    - j13lib
-
-      This is a required variable which defines the location of
-      JDK 1.4.x. Define the variable as following:
-
-          j13lib=${jdk13.dir}/jre/lib
-
-      where ${jdk13.dir} is the directory name where you have 
-      installed JDK 1.3.x. Check out section 2.2.3 of this document.
-      
-    - build.compiler
-
-      This variable defines if standard java compiler or jikes is 
-      used for build. The default value of this variable is set to 
-      use standard java compiler for build. If you opted to install
-      jikes in section 2.2.8 of this document, you can give your 
-      option to use jikes for build by overwriting default value of 
-      this variable by setting it as following: 
-   
-          build.compiler=jikes
-
-    - proceed
-
-      This variable directs Ant to proceed past any build errors and  
-      complete rest of the build (when set to true) or stop build any 
-      time an error is found (when set to false). The default value 
-      for this variable is false. You can overwrite default value 
-      by setting it to true by defining the variable as following: 
-
-           proceed=true
-
-    - sane
-
-      By default this variable is set to true and builds
-      extra asserts and debugging information in the class
-      files. When set to false no extra asserts or debugging 
-      information is included in the class files, making Derby
-      run faster as it generates smaller class files.
-      You can overwrite default value by setting it to false by
-      defining the variable as following: 
-
-          sane=false
-
-      Typically applications embedding Derby would use jar files 
-      built with sane=false.
-
-3.3   Run Derby build
-
-(1) Go to directory ${derby.source}.
-
-(2) Run the following command to start build:
-     
-    >ant
-
-    The above command will build all classes into
-    ${derby.source}/classes. If you add this directory
-    in your classpath, you will have full functionality
-    of engine, tools, and network server. 
-
-(3) Run the following command to build all jars:
-    
-    >ant buildjars
-
-    The above command will build the following jar files:
-    - derby.jar (database engine), 
-    - derbytools.jar (utilities: sysinfo, dblook, ij) 
-    - derbynet.jar (network server).
-
-    You can run the ant command to build an individual jar
-    file as following:
-    - command "ant derbyjar" to build derby.jar
-    - command "ant derbytoolsjar" to build derbytools.jar
-    - command "ant derbynetjar" to build derbynet.jar
-
-Notes: 
-(1) The estimated total time for build completion is ~5-10 minutes.
-
-(2) Derby build environment is NOT dependency based build environment.
-    Make sure to check out explaination of "clobber" target in
-    section 4.1 of this document.
-
-
-
-3.4   Verify Derby build
-
-To verify if the Derby build was successful, do the
-following:
-
-(1) Run "ant" command again and nothing should happen. No 
-    files should get compiled, copied or generated. 
-
-(2) Check if the following directories were created:
-      - ${derby.source}/classes
-      - ${derby.source}/jars if you have built the 
-        jars in step 3 of section 3.3
-
-(3) Execute the following command:
-    
-    >java -cp ${derby.source}/classes org.apache.derby.tools.sysinfo
-
-    You can also execute one of the following commands if you 
-    have built the jars in step 3 of section 3.3:
-
-    For builds with sane=true
-    >java -cp ${derby.source}/jars/sane/derby.jar:${derby.source}/jars/sane/derbytools.jar org.apache.derby.tools.sysinfo
-
-    For builds with sane=false
-    >java -cp ${derby.source}/jars/insane/derby.jar:${derby.source}/jars/insane/derbytools.jar org.apache.derby.tools.sysinfo
-
-    The above commands should report the system info and output 
-    should look like the following:
-
-    ------------------ Java Information ------------------
-    Java Version:    1.4.1_07
-    Java Vendor:     Sun Microsystems Inc.
-    Java home:       C:\Program Files\Java\j2re1.4.1_07
-    Java classpath:  c:\derby\classes
-    OS name:         Windows 2000
-    OS architecture: x86
-    OS version:      5.0
-    Java user name:  derbyuser
-    Java user home:  C:\Documents and Settings\Administrator
-    Java user dir:   C:\derby
-    --------- Derby Information --------
-    [C:\derby\classes] 10.0.2.0 - (1)
-    ------------------------------------------------------
-    ----------------- Locale Information -----------------
-    ------------------------------------------------------
-
-
-(4) Execute the following command:
-    
-    >java -cp ${derby.source}/classes org.apache.derby.tools.ij 
-
-    You can also execute one of the following commands if you 
-    have built the jars in step 3 of section 3.3:
-
-    For builds with sane=true
-    >java -cp ${derby.source}/jars/sane/derby.jar:${derby.source}/jars/sane/derbytools.jar org.apache.derby.tools.ij 
-
-    For builds with sane=false
-    >java -cp ${derby.source}/jars/insane/derby.jar:${derby.source}/jars/insane/derbytools.jar org.apache.derby.tools.ij 
-                
-   
-(5) Execute the following statement: 
-
-    connect 'jdbc:derby:test;create=true'; 
-
-    The above statement should create and connect to a 
-    database with no errors.
-
-
-
----------------------------------------------------------------
-4     Derby build miscellaneous information
-
-This section provides miscellaneous information about
-Derby builds. 
-
-
-
-4.1   Derby build targets
-
-Some of the main targets that can be called as
-"ant targetname" are as the  following:
-
-  source: to build source code. This is default target.
-
-  javadoc: to create javadoc for all source code.
-
-  publishedapi: to create javadoc for application api classes.
-
-  buildjars: to create jar files
-
-  clobber: remove all built objects except jars. You should run
-           this target if you have source code upgrade or
-           you changed the source code and you are getting
-           some errors.
-
-  clean: remove output directory (${derby.source}/classes)
-
-  cleanjars: remove jars directory (${derby.source}/jars)
-
-  cleandocs: remove javadoc directory (${derby.source}/javadoc)
-
-
-
-4.2   Derby source code upgrade
-
-After upgrading derby source code, do the following before 
-building the code as per instructions given in section 3.3:
-
-(1) Go to directory ${derby.source}.
-
-(2) Run the following command to clean up:
-
-    >ant clobber
-
-
-
-4.3   Derby Build flow
-
-This section provides the information on Derby build flow.
-This section can be skipped unless you are really interested
-in learning about Derby build flow.
-    
-Initially, Ant generates state.properties. This file contains 
-a single property, sanity, with a boolean value that determines 
-the sanity state of the build. 'Sanity' was a concept introduced 
-early in Cloudscape as a way of having assert functionality 
-in the code before Java actually supported such functionality 
-syntactically. It was a way to keep development 'sane,' 
-thus the name. Assertions are contained in an if-block based 
-on the static final boolean values SanityState.DEBUG or 
-SanityState.ASSERT, which are true in a sane (debug) build, 
-and false in an insane (non-debug/optimized) build. 
-Therefore, in an insane build, a smart compiler will not 
-write the code in the if-block into the classfile, since 
-it would never be run. 
-
-The source file containing the static final boolean values of the
-sanity state, org.apache.derby.iapi.services.sanity.SanityState 
-is then generated from a template. The sanity state defaults to 
-true. This also directs the compiler to turn on all debugging 
-options on the compiler. The sanity state can be set to insane 
-by running 'ant insane' or passing in the value -Dsane=false or 
--Dsanity=false. Note that this file will be removed after 
-'ant clobber,' so if you are rebuilding from scratch and want 
-the build to be a non-debug build, run 'ant insane' before 
-building.
-
-Once the sanity state has been generated, Ant prints out for 
-reference the current properties that affect the build, 
-including base directory, output directory, compiler, 
-sanity state, and the value of the java property 'proceed.' 
- 
-Next, the parser files are generated with JavaCC. Once the parser 
-files have been generated, the compilation of the source files 
-begins. The source is compiled in a specific order, that order 
-being: reference, internal API, public API, implementation. 
-At the end of the build, the properties files containing the 
-message files are copied into the output directory and the 
-version information properties files are generated.
+
+                     Building Derby
+================================================================
+
+Contents
+
+1     About this document
+1.1   Who should read this document
+1.2   Notes
+
+2     Downloads
+2.1   Download source code
+2.2   Download required software
+2.2.1 Download and install Apache Ant 1.6.x
+2.2.2 Download and install Java Development Kit release 1.4.x
+2.2.3 Download and install Java Development Kit release 1.3.x
+2.2.4 Download extensions for Java Development Kit release 1.3.x
+2.2.5 Download Java Compiler Compiler (JavaCC) version 3.1
+2.2.6 Download jakarta-servlet API 4 (Servlet 2.4)
+2.2.7 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
+2.2.8 Download Jikes 1.14 (Optional)
+
+3     Build instructions
+3.1   Set required environmental variables
+3.2   Create property file
+3.3   Run Derby build
+3.4   Verify Derby build
+
+4     Derby build miscellaneous information
+4.1   Derby build targets
+4.2   Derby source code upgrade
+4.3   Derby build flow
+
+
+---------------------------------------------------------------
+1     About this document
+
+This document contains the instructions to build a binary
+distribution version of the derby database from a source 
+distribution. 
+
+
+
+1.1   Who should read this document
+
+This document is intended for any one interested in 
+downloading and building a binary distribution of
+derby source distribution. 
+
+
+
+1.2   Notes
+
+The following conventions are followed in the document:
+
+(1) The directories are referred in unix convention.
+    For Windows, / should be replaced with \.
+
+(2) All examples or commands are given in unix conventions.
+    For Windows, modify the examples or commands as per
+    windows conventions.
+ 
+(3) This document contains urls to download required
+    software for derby builds. Urls may change anytime.
+    If there is any problem with any url, notify it
+    via derby mailing list.
+
+
+
+---------------------------------------------------------------
+2     Downloads
+
+Prior to building derby source code, download derby source
+code and required software as following:
+
+
+
+2.1   Download source code
+
+Create a new directory and download derby source code in 
+this directory. This directory will be referred to as the 
+${derby.source} directory in the rest of this document. 
+
+After downloading source code to directory ${derby.source},
+there should be the following files and directories:
+
+${derby.source}/build.xml 
+${debry.source}/java 
+${derby.source}/tools 
+
+
+
+2.2   Download required software
+
+This section lists all the required software for Derby
+build environment.
+
+Notes:
+----- 
+(1) Derby build environment requires you to install two levels of 
+    Java Development Kit (JDK) - 1.3.x and 1.4.x as Derby is designed 
+    to work in JDK1.3.x (JDBC 2.0) and JDK 1.4.x (JDBC 3.0) 
+    environments. The Derby build is set up such that that most of 
+    the code is compiled against JDK 1.3.x libraries so that no 
+    dependencies on JDK 1.4.x classes exist, except for the code 
+    that only runs in JDK1.4.x. In addition Derby's JDBC 2.0 
+    implementation must compile against JDBC 2.0 class definitions 
+    and the JDBC 3.0 implementation against JDBC 3.0 class 
+    definitions.
+
+(2) The Derby build environment is tested with JDK 131 (Sun), 
+    JDK 141(Sun), and Ant 161. The Derby build environment should
+    work with other versions and other sources of JDK 13 (1.3.x) 
+    and JDK 14 (1.4.x), and other versions of Ant 1.6 (1.6.x).
+
+
+
+2.2.1 Download and install Apache Ant 1.6.x
+
+(1) Download a binary distribution of Ant 1.6.x from:
+         http://ant.apache.org/bindownload.cgi
+
+(2) Install Ant 1.6.x in any directory. This 
+    directory will be referred to as ${ant.dir} 
+    directory in the rest of this document. 
+
+
+
+2.2.2 Download and install Java Development Kit (JDK) release 1.4.x
+
+Skip steps 1-2 of this section if you already have JDK 1.4.x 
+installed on your system.  
+
+(1) Download JDK 1.4.x. 
+    The reference implementation is available at:
+       http://java.sun.com/j2se
+
+(2) Install JDK 1.4.x according to the instructions included 
+    with the release in any directory. 
+
+(3) The directory where you have installed JDK 1.4.x will be 
+    referred to as ${jdk14.dir} in the rest of this document.
+
+
+
+2.2.3 Download and install Java Development Kit (JDK) release 1.3.x
+
+Skip steps 1-2 of this section if you already have JDK 1.3.x 
+installed on your system.  
+
+(1) Download JDK 1.3.x. 
+    The reference implementation is available at:
+       http://java.sun.com/j2se
+
+(2) Install JDK 1.3.x according to the instructions included 
+    with the release in any directory. 
+
+(3) The directory where you have installed JDK 1.3.x will be 
+    referred to as ${jdk13.dir} in the rest of this document.
+
+
+
+2.2.4 Download extensions for Java Development Kit release 1.3.x
+
+(1) JDBC 2.0
+
+    Download JDBC 2.0 (jdbc2_0-stdext.jar) from:
+      http://java.sun.com/products/jdbc/download.html
+    by selecting "JDBC 2.0 Optional Package Binary".
+
+    Save jdbc2_0-stdext.jar file in directory
+      ${derby.source}/tools/java 
+
+
+(2) Java Transaction API (JTA) 1.0.1B
+
+    Download JTA 1.0.1B (jta-1_0_1B-classes.zip) from:
+      http://java.sun.com/products/jta/ 
+    by selecting "Class files".
+
+    Save jta-1_0_1B-classes.zip file in directory
+      ${derby.source}/tools/java 
+
+
+(3) Java Cryptography Extension (JCE) version 1.2.2
+
+    Download JCE 1.2.2 (jce-1_2_2.zip) from:
+      http://java.sun.com/products/jce/index-122.html
+
+    Note: You will need to register to download JCE 1.2.2.
+
+    The downloaded file (jce-1_2_2.zip)  for JCE contains 
+    documentation files and multiple jar files. After 
+    downloading the zip file, unzip the file and copy only 
+    jce1.2.2/lib/jce1_2_2.jar file to directory 
+      ${derby.source}/tools/java
+
+
+
+2.2.5 Download Java Compiler Compiler (JavaCC) version 3.1
+
+JavaCC 3.1 (javacc-3.1.zip or javacc-3.1.tar.gz) can be 
+downloaded from:
+    https://javacc.dev.java.net/
+
+Note: The latest available version of JavaCC is 3.2.
+However, JavaCC 3.1 is the requirement for Derby build
+environment.
+
+The downloaded file (javacc-3.1.zip or javacc-3.1.tar.gz) 
+contains documentation and other files. After downloading 
+the zip or tar file, unzip or untar the file and copy only 
+javacc-3.1/bin/lib/javacc.jar file to directory 
+   ${derby.source}/tools/java 
+
+
+
+2.2.6 Download jakarta-servlet API 4 (Servlet 2.4)
+
+jakarta-servlet API 4 (jakarta-servletapi-4-yyyymmdd.zip or
+jakarta-servletapi-4-yyyymmdd.tar.gz) can be downloaded from:
+   http://cvs.apache.org/builds/jakarta-servletapi-4/nightly/
+
+Note: There is zip and tar file for nightly build for every day.
+Download the zip or tar file for latest day.
+ 
+The downloaded file (jakarta-servletapi-4-yyyymmdd.zip or
+jakarta-servletapi-4-yyyymmdd.tar.gz) contains documentation and 
+other files. After downloading the zip or tar file, unzip or 
+untar the file and copy only jakarta-servletapi-4/lib/servlet.jar 
+file to directory 
+   ${derby.source}/tools/java 
+
+
+
+2.2.7 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
+
+This is an optional section.
+The reason is that osgi.jar is required to only build the 
+class org.apache.derby.osgi.EmbeddedActivator. This class 
+and jar file manifest entries created in derby.jar allow 
+that jar file to be an OSGi bundle. If osgi.jar is not 
+present EmbeddedActivator will not be build and derby.jar 
+will not contain the manifest entries to be an OSGi bundle.
+
+OSGi Service Platform release 3 (osgi.jar) can be downloaded from: 
+   http://osgi.org
+
+Note: You will need to register to download OSGi Service Platform 
+      release 3.
+
+The downloaded file should be copied to directory
+   ${derby.source}/tools/java 
+
+
+
+Note: After following the steps in sections 2.2.4-2.2.7 of this
+document, you should have the following:
+
+${derby.source}/tools/java/javacc.jar
+${derby.source}/tools/java/jce1_2_2.jar 
+${derby.source}/tools/java/jdbc2_0-stdext.jar
+${derby.source}/tools/java/jta-1_0_1B-classes.zip 
+${derby.source}/tools/java/servlet.jar
+${derby.source}/tools/java/osgi.jar
+
+
+
+2.2.8 Download and Install Jikes 1.14 (Optional)
+
+This is an optional section.
+
+Jikes is an open source java compiler that improves compile 
+speed over standard java compiler. If you would like to have 
+improved compile speed, you can proceed to install Jikes. 
+Jikes 1.14 is the required version for derby builds.
+
+Jikes 1.14 can be downloaded from:
+    http://www.ibm.com/developerworks/oss/jikes/
+     
+Install Jikes 1.14 in any directory. This directory will be 
+referred to as the ${jikes.dir} directory in the rest of this 
+document. 
+
+
+
+---------------------------------------------------------------
+3     Build instructions
+
+
+3.1   Set Required Environmental Variables
+
+(1) Create environment variable ANT_HOME  to point to the 
+    directory where you have installed Ant. For example:
+
+     setenv ANT_HOME ${ant.dir} -- On unix(csh)
+     export ANT_HOME=${ant.dir} -- On unix(ksh)
+     set ANT_HOME=${ant.dir}    -- On Windows
+
+(2) Modify the PATH environment variable to include the 
+    directory ${ant.dir}/bin in its list. This makes the "ant" 
+    command line script available, which will be used to 
+    actually perform the build. Also, if you opted to install
+    jikes in section 2.2.8 of this document, add ${jikes.dir} 
+    to the PATH as well. For example:
+
+     setenv PATH ${ant.dir}/bin:${jikes.dir}:$PATH -- On unix(csh)
+     export PATH=${ant.dir}/bin:${jikes.dir}:$PATH -- On unix(ksh)
+     set PATH=${ant.dir}\bin;${jikes.dir};%PATH%   -- On Windows
+
+(3) Create environment variable JAVA_HOME  to point to the 
+    directory where you have installed JDK 1.4.x. For example:
+
+     setenv JAVA_HOME ${jdk14.dir} -- On unix(csh).
+     export JAVA_HOME=${jdk14.dir} -- On unix(ksh)
+     set JAVA_HOME=${jdk14.dir}    -- On Windows
+
+
+
+3.2   Create property file
+
+You will need to create a property file to specify
+your environment and some of your options. Do the following
+to specify your environment and options:
+
+(1) Find out user home directory on your system. You can find  
+    user home directory by doing echo on variable %HOME% 
+    on windows and $home or $HOME on unix.
+
+(2) Create a file called "ant.properties" in user home 
+    directory and define the following variables in 
+    "ant.properties":
+   
+    - j14lib
+
+      This is a required variable which defines the location of
+      JDK 1.4.x. Define the variable as following:
+
+          j14lib=${jdk14.dir}/jre/lib
+      
+      where ${jdk14.dir} is the directory name where you have 
+      installed JDK 1.4.x. Check out section 2.2.2 of this document. 
+
+    - j13lib
+
+      This is a required variable which defines the location of
+      JDK 1.4.x. Define the variable as following:
+
+          j13lib=${jdk13.dir}/jre/lib
+
+      where ${jdk13.dir} is the directory name where you have 
+      installed JDK 1.3.x. Check out section 2.2.3 of this document.
+      
+    - build.compiler
+
+      This variable defines if standard java compiler or jikes is 
+      used for build. The default value of this variable is set to 
+      use standard java compiler for build. If you opted to install
+      jikes in section 2.2.8 of this document, you can give your 
+      option to use jikes for build by overwriting default value of 
+      this variable by setting it as following: 
+   
+          build.compiler=jikes
+
+    - proceed
+
+      This variable directs Ant to proceed past any build errors and  
+      complete rest of the build (when set to true) or stop build any 
+      time an error is found (when set to false). The default value 
+      for this variable is false. You can overwrite default value 
+      by setting it to true by defining the variable as following: 
+
+           proceed=true
+
+    - sane
+
+      By default this variable is set to true and builds
+      extra asserts and debugging information in the class
+      files. When set to false no extra asserts or debugging 
+      information is included in the class files, making Derby
+      run faster as it generates smaller class files.
+      You can overwrite default value by setting it to false by
+      defining the variable as following: 
+
+          sane=false
+
+      Typically applications embedding Derby would use jar files 
+      built with sane=false.
+
+3.3   Run Derby build
+
+(1) Go to directory ${derby.source}.
+
+(2) Run the following command to start build:
+     
+    >ant
+
+    The above command will build all classes into
+    ${derby.source}/classes. If you add this directory
+    in your classpath, you will have full functionality
+    of engine, tools, and network server. 
+
+(3) Run the following command to build all jars:
+    
+    >ant buildjars
+
+    The above command will build the following jar files:
+    - derby.jar (database engine), 
+    - derbytools.jar (utilities: sysinfo, dblook, ij) 
+    - derbynet.jar (network server).
+
+    You can run the ant command to build an individual jar
+    file as following:
+    - command "ant derbyjar" to build derby.jar
+    - command "ant derbytoolsjar" to build derbytools.jar
+    - command "ant derbynetjar" to build derbynet.jar
+
+Notes: 
+(1) The estimated total time for build completion is ~5-10 minutes.
+
+(2) Derby build environment is NOT dependency based build environment.
+    Make sure to check out explaination of "clobber" target in
+    section 4.1 of this document.
+
+
+
+3.4   Verify Derby build
+
+To verify if the Derby build was successful, do the
+following:
+
+(1) Run "ant" command again and nothing should happen. No 
+    files should get compiled, copied or generated. 
+
+(2) Check if the following directories were created:
+      - ${derby.source}/classes
+      - ${derby.source}/jars if you have built the 
+        jars in step 3 of section 3.3
+
+(3) Execute the following command:
+    
+    >java -cp ${derby.source}/classes org.apache.derby.tools.sysinfo
+
+    You can also execute one of the following commands if you 
+    have built the jars in step 3 of section 3.3:
+
+    For builds with sane=true
+    >java -cp ${derby.source}/jars/sane/derby.jar:${derby.source}/jars/sane/derbytools.jar org.apache.derby.tools.sysinfo
+
+    For builds with sane=false
+    >java -cp ${derby.source}/jars/insane/derby.jar:${derby.source}/jars/insane/derbytools.jar org.apache.derby.tools.sysinfo
+
+    The above commands should report the system info and output 
+    should look like the following:
+
+    ------------------ Java Information ------------------
+    Java Version:    1.4.1_07
+    Java Vendor:     Sun Microsystems Inc.
+    Java home:       C:\Program Files\Java\j2re1.4.1_07
+    Java classpath:  c:\derby\classes
+    OS name:         Windows 2000
+    OS architecture: x86
+    OS version:      5.0
+    Java user name:  derbyuser
+    Java user home:  C:\Documents and Settings\Administrator
+    Java user dir:   C:\derby
+    --------- Derby Information --------
+    [C:\derby\classes] 10.0.2.0 - (1)
+    ------------------------------------------------------
+    ----------------- Locale Information -----------------
+    ------------------------------------------------------
+
+
+(4) Execute the following command:
+    
+    >java -cp ${derby.source}/classes org.apache.derby.tools.ij 
+
+    You can also execute one of the following commands if you 
+    have built the jars in step 3 of section 3.3:
+
+    For builds with sane=true
+    >java -cp ${derby.source}/jars/sane/derby.jar:${derby.source}/jars/sane/derbytools.jar org.apache.derby.tools.ij 
+
+    For builds with sane=false
+    >java -cp ${derby.source}/jars/insane/derby.jar:${derby.source}/jars/insane/derbytools.jar org.apache.derby.tools.ij 
+                
+   
+(5) Execute the following statement: 
+
+    connect 'jdbc:derby:test;create=true'; 
+
+    The above statement should create and connect to a 
+    database with no errors.
+
+
+
+---------------------------------------------------------------
+4     Derby build miscellaneous information
+
+This section provides miscellaneous information about
+Derby builds. 
+
+
+
+4.1   Derby build targets
+
+Some of the main targets that can be called as
+"ant targetname" are as the  following:
+
+  source: to build source code. This is default target.
+
+  javadoc: to create javadoc for all source code.
+
+  publishedapi: to create javadoc for application api classes.
+
+  buildjars: to create jar files
+
+  clobber: remove all built objects except jars. You should run
+           this target if you have source code upgrade or
+           you changed the source code and you are getting
+           some errors.
+
+  clean: remove output directory (${derby.source}/classes)
+
+  cleanjars: remove jars directory (${derby.source}/jars)
+
+  cleandocs: remove javadoc directory (${derby.source}/javadoc)
+
+
+
+4.2   Derby source code upgrade
+
+After upgrading derby source code, do the following before 
+building the code as per instructions given in section 3.3:
+
+(1) Go to directory ${derby.source}.
+
+(2) Run the following command to clean up:
+
+    >ant clobber
+
+
+
+4.3   Derby Build flow
+
+This section provides the information on Derby build flow.
+This section can be skipped unless you are really interested
+in learning about Derby build flow.
+    
+Initially, Ant generates state.properties. This file contains 
+a single property, sanity, with a boolean value that determines 
+the sanity state of the build. 'Sanity' was a concept introduced 
+early in Cloudscape as a way of having assert functionality 
+in the code before Java actually supported such functionality 
+syntactically. It was a way to keep development 'sane,' 
+thus the name. Assertions are contained in an if-block based 
+on the static final boolean values SanityState.DEBUG or 
+SanityState.ASSERT, which are true in a sane (debug) build, 
+and false in an insane (non-debug/optimized) build. 
+Therefore, in an insane build, a smart compiler will not 
+write the code in the if-block into the classfile, since 
+it would never be run. 
+
+The source file containing the static final boolean values of the
+sanity state, org.apache.derby.iapi.services.sanity.SanityState 
+is then generated from a template. The sanity state defaults to 
+true. This also directs the compiler to turn on all debugging 
+options on the compiler. The sanity state can be set to insane 
+by running 'ant insane' or passing in the value -Dsane=false or 
+-Dsanity=false. Note that this file will be removed after 
+'ant clobber,' so if you are rebuilding from scratch and want 
+the build to be a non-debug build, run 'ant insane' before 
+building.
+
+Once the sanity state has been generated, Ant prints out for 
+reference the current properties that affect the build, 
+including base directory, output directory, compiler, 
+sanity state, and the value of the java property 'proceed.' 
+ 
+Next, the parser files are generated with JavaCC. Once the parser 
+files have been generated, the compilation of the source files 
+begins. The source is compiled in a specific order, that order 
+being: reference, internal API, public API, implementation. 
+At the end of the build, the properties files containing the 
+message files are copied into the output directory and the 
+version information properties files are generated.

Modified: incubator/derby/code/trunk/build.xml
==============================================================================
--- incubator/derby/code/trunk/build.xml	(original)
+++ incubator/derby/code/trunk/build.xml	Thu Sep 23 09:39:02 2004
@@ -1,770 +1,782 @@
-<?xml version="1.0"?>
-
-<project default="buildsource" basedir=".">
-
-<!-- Set Properties -->
-  <!-- User settings -->
-  <property file="${user.home}/ant.properties"/>
-  <!-- Set property lib dir -->
-  <property name="properties.dir" value="tools/ant/properties"/>
-  <!-- Significant dirs -->
-  <property file="${properties.dir}/dirs.properties"/>
-  <!-- Compiler settings -->
-  <property file="${properties.dir}/sane${sanity}.properties"/>
-  <property file="${properties.dir}/defaultcompiler.properties"/>
-  <property file="${properties.dir}/${build.compiler}.properties"/>
-  <!-- Compile-time classpath properties files -->
-  <property file="${properties.dir}/extrapath.properties"/>
-  <property file="${properties.dir}/compilepath.properties"/>
-  <!-- Release and version info -->
-  <property file="${properties.dir}/release.properties"/>
-
-<!-- Targets -->
-
-  <target name="buildsource" depends="init,engine,tools,drda,build,versioninfo"/>
-
-<!-- ==================================================================== -->
-<!--                       Initialize targets                             -->
-<!-- ==================================================================== -->
-
-  <target name="init" unless="init.done">
-    <tstamp/>
-    <mkdir dir="${out.dir}"/>
-    <!-- generate sanity state.properties if one does not exist -->
-    <available property="state.available" file="${state.file}"/>
-    <antcall target="ensuresanitystate"/>
-    <property file="${state.file}"/>
-    <property file="${properties.dir}/sane${sanity}.properties"/>
-    <antcall target="setissane"/>
-    <property name="init.done" value="true"/>
-  </target>
-
-  <target name="setissane">
-    <condition property="is.sane">
-      <equals arg1="${sanity}" arg2="true"/>
-    </condition>
-  </target>
-
-  <target name="ensuresanitystate" unless="state.available">
-    <antcall target="sane"/>
-  </target>
-
-  <target name="showenv" depends="init" unless="showenv.done">
-    <echo message=""/>
-    <echo message="Ant environment:"/>
-    <echo message="  Base Directory: ${basedir}"/>
-    <echo message="  Build output: ${out.dir}"/>
-    <echo message="  Compiler: ${build.compiler}"/>
-    <echo message="  Sane = ${sane}"/>
-    <echo message="  Proceed = ${proceed}"/>
-    <echo message=""/>
-    <property name="showenv.done" value="true"/>
-  </target>
-
-<!-- ==================================================================== -->
-<!--                     Build version info files                         -->
-<!-- ==================================================================== -->
-
-  <target name="versioninfo" depends="ckversioninfo,writeversioninfo"/>
-
-  <target name="ckversioninfo">
-    <condition property="versioninfo.available">
-      <and>
-        <available file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
-        <available file="${out.dir}/org/apache/derby/info/tools.properties"/>
-        <available file="${out.dir}/org/apache/derby/info/net.properties"/>
-      </and>
-    </condition>
-  </target>
-
-  <target name="writeversioninfo" unless="versioninfo.available">
-    <mkdir dir="${out.dir}/org/apache/derby/info/"/>
-
-    <antcall target="infowriter">
-      <param name="info.buildnumber" value="1"/>
-      <param name="info.iname" value="Apache Derby Embedded Engine"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.productfile" value="codeline"/>
-      <param name="info.file" value="${out.dir}/org/apache/derby/info/DBMS.properties"/>
-    </antcall>
-    <antcall target="infowriter">
-      <param name="info.buildnumber" value="1"/>
-      <param name="info.iname" value="Apache Derby Tools"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.productfile" value="codeline"/>
-      <param name="info.file" value="${out.dir}/org/apache/derby/info/tools.properties"/>
-    </antcall>
-    <antcall target="infowriter">
-      <param name="info.buildnumber" value="1"/>
-      <param name="info.iname" value="Apache Derby Network Server"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.productfile" value="codeline"/>
-      <param name="info.file" value="${out.dir}/org/apache/derby/info/net.properties"/>
-    </antcall>
-  </target>
-
-  <target name="cleanversion">
-    <delete file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
-    <delete file="${out.dir}/org/apache/derby/info/tools.properties"/>
-    <delete file="${out.dir}/org/apache/derby/info/net.properties"/>
-  </target>
-<!-- ==================================================================== -->
-<!--                         Info writer build target                     -->
-<!-- ==================================================================== -->
-
-  <target name="infowriter">
-    <propertyfile file="${info.file}" comment="${copyright.comment}">
-      <entry key="derby.version.major" value="${major}"/>
-      <entry key="derby.version.minor" value="${minor}"/>
-      <entry key="derby.version.maint" value="${maint}"/>
-      <entry key="derby.version.drdamaint" value="${drdamaint}"/>
-      <entry key="derby.build.number" value="${info.buildnumber}"/>
-      <entry key="derby.product.technology.name" value="${info.iname}"/>
-      <entry key="derby.product.external.name" value="${info.ename}"/>
-      <entry key="derby.product.external.version" value="${eversion}"/>
-      <entry key="derby.version.beta" value="${beta}"/>
-      <entry key="derby.product.vendor" value="${vendor}"/>
-      <entry key="derby.product.file" value="${info.productfile}"/>
-    </propertyfile>
-  </target>  
-
-
-<!-- ==================================================================== -->
-<!--                   Derby Engine build target                     -->
-<!-- ==================================================================== -->
-
-  <target name="engine" depends="state,parsers">
-    <ant dir="${derby.engine.src.dir}"/>
-    <antcall target="build"/>
-    <ant dir="${derby.engine.dir}/loc"/>
-    <antcall target="class_size_catalog"/>
-  </target>
-
-  <target name="tools" depends="engine">
-    <ant dir="${derby.tools.src.dir}"/>
-  </target>
-
-  <target name="drda" depends="engine">
-    <ant dir="${derby.drda.src.dir}"/>
-  </target>
-
-  <target name="build" >
-    <ant dir="${derby.build.src.dir}"/>
-  </target>
-
-<!-- ==================================================================== -->
-<!--                     Build SanityState.java                           -->
-<!-- ==================================================================== -->
-
-  <target name="getstate">
-    <condition property="needstate">
-      <or>
-        <not>
-          <equals arg1="${sane}" arg2="${sanity}"/>
-        </not>
-        <not>
-          <available file="${sanity.dir}/SanityState.java"/>
-        </not>
-      </or>
-    </condition>
-  </target>
-
-  <property name="state.file" value="${derby.engine.src.dir}/state.properties"/>
-  <property file="${state.file}"/>
-  <target name="state" if="needstate"
-          depends="showenv,getstate"
-          description="Build SanityState.java">
-    <echo message="  Generating SanityState.java..."/>
-    <property name="sane" value="true"/>
-    <filter token="SANE" value="${sane}"/>
-    <copy file="${sanity.dir}/SanityState.tmpl"
-          tofile="${sanity.dir}/SanityState.java"
-          overwrite="yes" filtering="on"/>
-    <property name="header" value="Generated file - do not modify!"/>
-    <propertyfile file="${state.file}" comment="${header}">
-      <entry key="sanity" value="${sane}" type="string"/>
-    </propertyfile>
-    <delete dir="${sanity.out.dir}"/>
-  </target>
-
-<!-- =================================================================== -->
-<!--                     Remove SanityState.java file                    -->
-<!-- =================================================================== -->
-  <target name="cleanstate">
-    <delete file="${derby.engine.src.dir}/state.properties"/>
-    <delete file="${sanity.dir}/SanityState.java"/>
-    <delete dir="${sanity.out.dir}"/>
-  </target>
-
-<!-- =================================================================== -->
-<!--                 Remove all built objects (except jars)              -->
-<!-- =================================================================== -->
-  <target name="clobber" depends="showenv,clean,cleanstate,cleanparsers,cleancatalog"/>
-
-<!-- =================================================================== -->
-<!--                       Remove output tree                            -->
-<!-- =================================================================== -->
-  <target name="clean">
-    <delete dir="${out.dir}"/>
-  </target>
-
-<!-- ==================================================================== -->
-<!--                         Build parsers                                -->
-<!-- ==================================================================== -->
-  <target name="parsers"
-          description="Build the parsers">
-    <ant dir="${derby.tools.dir}/impl/tools"  target="parser"/>
-    <ant dir="${derby.engine.dir}/impl/sql"  target="parser"/>
-  </target>
-
-  <target name="genParser" depends="chkparser" unless="parser.done">
-    <echo message="  ${msg}"/>
-    <delete>
-      <fileset dir="${directory}" includes="${rmfiles}"/>
-    </delete>
-    <java classname="javacc"
-          classpath="${jjpath}"
-                dir="${directory}"
-               fork="yes"
-        failonerror="true">
-      <arg value="${jjfile}"/>
-    </java>
-  </target>
-
-  <target name="chkparser">
-    <uptodate property="parser.done"
-              targetfile="${directory}/${chkfile}" >
-      <srcfiles dir="${directory}" includes="${jjfile}" />
-    </uptodate>
-  </target>
-
-<!-- =================================================================== -->
-<!--                     Remove parser-generated files                   -->
-<!-- =================================================================== -->
-  <target name="cleanparsers">
-    <delete>
-      <fileset dir="${derby.engine.dir}/impl/sql/compile" includes="SQLParser.java,SQLParserTokenManager.java,SQLParserConstants.java"/>
-    </delete>
-    <delete>
-      <fileset dir="${derby.tools.dir}/impl/tools/ij"
-            includes="ij.java ijTokenManager.java ijConstants.java Token.java,mtGrammar.java,mtGrammarConstants.java,mtGrammarTokenManager.java"/>
-    </delete>
-  </target>
-
-<!-- =================================================================== -->
-<!--                     Class Size Catalog build                        -->
-<!-- =================================================================== -->
-
-  <!-- Note that checking the up-to-date status of the files scanned by  -->
-  <!-- ClassSizeCrawler will not always result in the ClassSizeCatalog   -->
-  <!-- being updated properly. We would have to be able to scan the full -->
-  <!-- dependency tree. This does prevent recompilation in most cases,   -->
-  <!-- and requires it in the most obvious. If there is concern that     -->
-  <!-- the ClassSizeCatalog may have changed significantly since the     -->
-  <!-- last build, run cleancatalog and rebuild to regenerate it.        -->
-
-  <target name="class_size_catalog" depends="cscuptodate" unless="csc.uptodate"
-          description="create the class size catalog -- a java file">
-    <java classname="org.apache.derbyBuild.ClassSizeCrawler"
-          fork="yes"
-          failonerror="yes">
-      <classpath>
-        <pathelement path="${out.dir}"/>
-        <pathelement path="${compile.classpath}"/>
-      </classpath>
-      <jvmarg value="-DWS=${workspace}"/>
-      <jvmarg value="-DclassDir=${out.dir}"/>
-      <jvmarg value="-Dout=${derby.engine.src.dir}/${derby.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
-      <jvmarg value="-Dprefix.1=org.apache.derby.iapi.types"/>            
-      <jvmarg value="-Dprefix.2=org.apache.derby.impl"/>
-      <arg value="org.apache.derby.iapi.types.DataValueDescriptor"/>
-      <arg value="org.apache.derby.impl.services.cache.CachedItem"/>
-      <arg value="org.apache.derby.impl.store.raw.data.RecordId"/>
-      <arg value="org.apache.derby.iapi.store.raw.ContainerKey"/>
-      <arg value="org.apache.derby.iapi.services.cache.SizedCacheable"/>
-      <arg value="java.lang.ref.WeakReference"/>
-      <arg value="java.math.BigDecimal"/>
-      <arg value="java.util.ArrayList"/>
-      <arg value="java.util.GregorianCalendar"/>
-    </java>
-
-    <javac
-      bootclasspath="${empty}"
-      nowarn="on"
-      debug="${debug}"
-      depend="${depend}"
-      deprecation="${deprecation}"
-      optimize="${optimize}"
-      proceed="${proceed}"
-      verbose="${verbose}"
-      srcdir="${derby.engine.src.dir}"
-      destdir="${out.dir}">
-      <classpath>
-        <pathelement path="${compile.classpath}"/>
-      </classpath>
-      <include name="${derby.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
-    </javac>
-
-  </target>
-
-  <target name="cscuptodate">
-    <condition property="csc.uptodate">
-      <and>
-        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/types/DataValueDescriptor.java"
-                  targetfile="${out.dir}/org/apache/derby/iapi/types/DataValueDescriptor.class"/>
-        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/impl/services/cache/CachedItem.java"
-                  targetfile="${out.dir}/org/apache/derby/impl/services/cache/CachedItem.class"/>
-        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/impl/store/raw/data/RecordId.java"
-                  targetfile="${out.dir}/org/apache/derby/impl/store/raw/data/RecordId.class"/>
-        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/store/raw/ContainerKey.java"
-                  targetfile="${out.dir}/org/apache/derby/iapi/store/raw/ContainerKey.class"/>
-        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.java"
-                  targetfile="${out.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.class"/>
-        <available file="${osengsrc.dir}/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java"/>
-      </and>
-    </condition>
-  </target>
-
-  <target name="cleancatalog"
-          description="Remove the generated catalog java file.">
-    <delete file="${derby.engine.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
-  </target>
-
-<!-- =================================================================== -->
-<!--                     Generate sanity.properties                      -->
-<!-- =================================================================== -->
-
-  <target name="sane">
-    <propertyfile file="${state.file}" comment="${header}">
-      <entry key="sanity" value="true" type="string"/>
-    </propertyfile>
-  </target>
-  <target name="insane">
-    <propertyfile file="${state.file}" comment="${header}">
-      <entry key="sanity" value="false" type="string"/>
-    </propertyfile>
-  </target>
-
-
-<!-- =================================================================== -->
-<!--                           Javadoc targets                           -->
-<!-- =================================================================== -->
-
-  <target name="javadoc" depends="publishedapi,derbydocs,toolsdocs,grammardocs"/>
-
-  <target name="publishedapi">
-
-    <delete dir="${basedir}/javadoc/publishedapi"/>
-    <delete dir="${basedir}/javadoc/sourcedir"/>
-    <mkdir dir="${basedir}/javadoc/publishedapi"/>
-    <mkdir dir="${basedir}/javadoc/sourcedir"/>
-
-    <!-- drda files -->
-    <mkdir dir="${basedir}/javadoc/sourcedir"/>
-    <copy todir="${basedir}/javadoc/sourcedir"> 
-      <fileset dir="${derby.drda.src.dir}"
-               includesfile="${javadoctools.dir}/publishedapi.ant"/>
-    </copy>
-	
-    <!-- engine files -->
-    <copy todir="${basedir}/javadoc/sourcedir">
-      <fileset dir="${derby.engine.src.dir}"
-               includesfile="${javadoctools.dir}/publishedapi.ant"/>
-    </copy>
-
-    <!-- tools files -->
-    <copy todir="${basedir}/javadoc/sourcedir">
-      <fileset dir="${derby.tools.src.dir}"
-               includesfile="${javadoctools.dir}/publishedapi.ant"/>
-    </copy>
-
-    <javadoc sourcepath="${basedir}/javadoc/sourcedir/"
-             classpath="${compile.classpath};${osgi};${servlet22};${out.dir}"
-             breakiterator="true"
-             destdir="${basedir}/javadoc/publishedapi"
-             packagenames="org.apache.derby.authentication,org.apache.derby.drda,org.apache.derby.jdbc.io,org.apache.derby.jdbc,org.apache.derby.tools"
-             Windowtitle="Apache Derby ${major}.${minor} API Documentation"
-             Doctitle="Apache Derby ${major}.${minor} API Documentation"
-             bottom="Apache Derby ${major}.${minor} API Documentation  -  &lt;i&gt;Copyright &amp;copy; IBM Corp. 1997,2004 All Rights Reserved.&lt;/i&gt;"/>
-
-    <delete dir="${basedir}/javadoc/sourcedir"/>
-
-  </target>
-
-  <target name="derbydocs">
-
-    <delete dir="${basedir}/javadoc/engine"/>
-    <mkdir dir="${basedir}/javadoc/engine"/>
-
-    <antcall target="javadocsubpackages">
-      <param name="javadoc.sourcepath" value="${derby.engine.src.dir};${derby.drda.src.dir};${derby.tools.src.dir}"/>
-      <param name="javadoc.classpath" value="${basedir}/classes;${java14compile.classpath};${jars.extras};${osgi}"/>
-      <param name="javadoc.destdir" value="${basedir}/javadoc/engine"/>
-      <param name="javadoc.subpackages" value="org.apache.derby"/>
-      <param name="javadoc.doctitle" value="Apache Derby V${major}.${minor} Engine Documentation"/>
-      <param name="javadoc.windowtitle" value="Apache Derby V${major}.${minor} Engine Documentation"/>
-      <param name="javadoc.bottom" value="Apache Derby V${major}.${minor} Engine Documentation  -  &lt;i&gt;Copyright &amp;copy; IBM Corp. 1997,2004 All Rights Reserved.&lt;/i&gt;"/>
-    </antcall>
-  </target>
-
-  <target name="toolsdocs">
-
-    <delete dir="${basedir}/javadoc/tools"/>
-    <mkdir dir="${basedir}/javadoc/tools"/>
-
-    <antcall target="dojjdocs">
-      <param name="jjtodoc" value="${derby.tools.dir}/impl/tools/ij/ij.jj"/>
-      <param name="jjdoctarget" value="${basedir}/javadoc/tools/ij.html"/>
-    </antcall>
-
-  </target>
-
-  <target name="grammardocs">
-
-    <delete dir="${basedir}/javadoc/language"/>
-    <mkdir dir="${basedir}/javadoc/language"/>	
-
-    <antcall target="dojjdocs">
-      <param name="jjtodoc" value="${derby.engine.dir}/impl/sql/compile/sqlgrammar.jj"/>
-      <param name="jjdoctarget" value="${basedir}/javadoc/language/sqlgrammar.html"/>
-    </antcall>
-
-  </target>
-
-  <target name="dojjdocs">
-
-    <java classname="jjdoc" fork="yes">
-      <classpath path="${javatools.dir}/javacc.jar;${compile.classpath}"/>
-      <arg value="-NOONE_TABLE"/>
-      <arg value="-output_file=${jjdoctarget}"/>
-      <arg value="${jjtodoc}"/>
-    </java>
-
-  </target>
-
-  <target name="javadocsubpackages">
-    <java classname="com.sun.tools.javadoc.Main" fork="yes">
-      <classpath path="${java.home}/../lib/tools.jar;${out.dir}"/>
-      <jvmarg value="-mx320M"/>
-      <arg value="-subpackages"/>
-      <arg value="org"/>
-      <arg value="-private"/>
-      <arg value="-breakiterator"/>
-      <arg value="-sourcepath"/>
-      <arg value="${javadoc.sourcepath}"/>
-      <arg value="-classpath"/>
-      <arg value="${javadoc.classpath}"/>
-      <arg value="-d"/>
-      <arg value="${javadoc.destdir}"/>
-      <arg value="-windowtitle"/>
-      <arg value="${javadoc.windowtitle}"/>
-      <arg value="-doctitle"/>
-      <arg value="${javadoc.doctitle}"/>
-      <arg value="-bottom"/>
-      <arg value="${javadoc.bottom}"/>
-      <arg value="-taglet"/>
-      <arg value="org.apache.derbyBuild.javadoc.FormatIdTaglet"/>
-      <arg value="-taglet"/>
-      <arg value="org.apache.derbyBuild.javadoc.PurposeTaglet"/>
-      <arg value="-taglet"/>
-      <arg value="org.apache.derbyBuild.javadoc.UpgradeTaglet"/>
-      <arg value="-taglet"/>
-      <arg value="org.apache.derbyBuild.javadoc.DiskLayoutTaglet"/>
-      <arg value="-taglet"/>
-      <arg value="org.apache.derbyBuild.javadoc.EndFormatTaglet"/>
-    </java>
-  </target>
-
-  <target name="cleandocs">
-
-    <delete dir="${basedir}/javadoc"/>
-
-  </target>
-
-<!-- =================================================================== -->
-<!--                               Jar targets                           -->
-<!-- =================================================================== -->
-
-  <target name="buildjarsclean" depends="cleanjars,initjars,derbyjar,derbytoolsjar,derbynetjar"/>
-  <target name="buildjars" depends="initjars,derbyjar,derbytoolsjar,derbynetjar"/>
-
-  <target name="initjars" depends="setsanityname">
-    <property name="derby.jar.dir" value="${basedir}/jars/${sanity.name}"/>
-    <property name="derby.jar.topdir" value="${basedir}/jars"/>
-    <mkdir dir="${derby.jar.dir}"/>
-    <mkdir dir="${derby.jar.dir}/lists"/>
-    <condition property="changenumber" value="1">
-      <not>
-        <isset property="changenumber"/>
-      </not>
-    </condition>
-  </target>
-
-
-<!-- - - - - - - - - - - - - - - derby.jar target - - - - - - - - - - - -->
-
-  <target name="derbyjar" depends="initjars">
-
-    <echo message="Beginning derby.jar ${sanity.name} build"/>
-
-    <concat destfile="${derby.jar.dir}/lists/otherDerbyClasses.properties">
-      <fileset dir="${basedir}/tools/jar" includes="*DBMS*.properties"/>
-    </concat>
-
-    <mkdir dir="${derby.jar.dir}/lists/org/apache/derby"/>
-    <java classname="org.apache.derbyBuild.propertyconfig">
-      <arg value="${out.dir}/org/apache/derby/modules.properties"/>
-      <arg value="derby"/>
-      <arg value="${derby.jar.dir}/lists/org/apache/derby/modules.properties"/>
-      <classpath>
-        <pathelement path="${out.dir}"/>
-      </classpath>
-    </java>
-
-    <!-- filter out EmbeddedActivator if osgi.jar is not available -->
-    <antcall target="filteractivator"/>
-
-    <echo message=" creating derby.jar class list "/>
-    <java classname="org.apache.derbyBuild.classlister" fork="yes">
-      <jvmarg value="-DcloudscapeOnly=true"/>
-      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derby.list"/>
-      <arg value="${derby.jar.dir}/lists/otherDerbyClasses.properties"/> 
-      <arg value="${derby.jar.dir}/lists/org/apache/derby/modules.properties"/>
-      <classpath>
-        <pathelement path="${out.dir}"/> 
-      </classpath>
-    </java>
-
-    <!-- This next antcall generates a new properties file for the build.  -->
-    <!-- If a changenumber is passed into the build via a property file or -->
-    <!-- on the command line, the build number will be inserted into the   -->
-    <!-- build at this point.                                              -->
- 
-    <echo message=" creating new DBMS.properties file"/>
-    <antcall target="infowriter">
-      <param name="info.iname" value="Apache Derby Embedded Engine"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.buildnumber" value="${changenumber}"/>
-      <param name="info.productfile" value="derby.jar"/>
-      <param name="info.file" value="${out.dir}//org/apache/derby/info/DBMS.properties"/>
-    </antcall>
-    <echo file="${derby.jar.dir}/lists/derby.list"
-          append="true"
-          message="org/apache/derby/info/DBMS.properties"/>
-
-    <!-- the next two targets are orthogonal. Only one will be executed, -->
-    <!-- depending on whether or not osgi.jar is available.              -->
-    <antcall target="derbyjarwithosgi"/>
-    <antcall target="derbyjarwithoutosgi"/>
-
-    <!-- add non-class files to jar -->
-
-    <jar destfile="${derby.jar.dir}/derby.jar" 
-         update="true"
-         compress="true">
-      <fileset dir="${out.dir}"
-               includes="org/apache/derby/loc/m?_en.properties,
-                         org/apache/derby/loc/m??_en.properties,
-                         org/apache/derby/loc/sysinfoMessages.properties,
-                         org/apache/derby/loc/toolsmessages.properties,
-                         org/apache/derby/impl/jdbc/metadata.properties,
-                         org/apache/derby/impl/sql/catalog/metadata_net.properties,
-                         org/apache/derby/info/DBMS.properties"/>
-      <fileset dir="${derby.jar.dir}/lists"
-               includes="org/apache/derby/modules.properties"/>
-    </jar>
-
-  </target>
-
-  <target name="filteractivator" depends="checkosgijar" if="osgijar.unavailable">
-
-    <replaceregexp file="${derby.jar.dir}/lists/otherDerbyClasses.properties"
-                   match="derby.module.osgi.activator=org.apache.derby.osgi.EmbeddedActivator"
-                   replace=""/>
-
-  </target>
-
-  <target name="derbyjarwithoutosgi" depends="checkosgijar" if="osgijar.unavailable">
-
-    <manifest file="${derby.jar.dir}/lists/smf.mf">
-      <attribute name="Bundle-Vendor" value="Apache Software Foundation"/>
-      <attribute name="Bundle-Name" value="Apache Derby ${major}.${minor}"/>
-      <attribute name="Bundle-Version" value="${major}.${minor}.${maint}"/>
-    </manifest> 
-
-    <jar destfile="${derby.jar.dir}/derby.jar"
-         basedir="${out.dir}"
-	 includesfile="${derby.jar.dir}/lists/derby.list"
-         compress="true"
-         filesonly="true"
-         manifest="${derby.jar.dir}/lists/smf.mf"/>
-
-  </target>
-
-  <target name="derbyjarwithosgi" depends="checkosgijar" if="osgijar.available">
-
-    <manifest file="${derby.jar.dir}/lists/smf.mf">
-      <attribute name="Bundle-Vendor" value="Apache Software Foundation"/>
-      <attribute name="Bundle-Activator" value="org.apache.derby.osgi.EmbeddedActivator"/>
-      <attribute name="Bundle-Name" value="Apache Derby ${major}.${minor}"/>
-      <attribute name="Bundle-Version" value="${major}.${minor}.${maint}"/>
-      <attribute name="Import-Package" value="java.sql"/>
-      <attribute name="DynamicImport-Package" value="*"/>
-      <attribute name="Export-Package" value="org.apache.derby.authentication,org.apache.derby.database,org.apache.derby.io,org.apache.derby.jdbc,org.apache.derby.vti"/> 
-    </manifest> 
-
-    <jar destfile="${derby.jar.dir}/derby.jar"
-         basedir="${out.dir}"
-	 includesfile="${derby.jar.dir}/lists/derby.list"
-         compress="true"
-         filesonly="true"
-         manifest="${derby.jar.dir}/lists/smf.mf"/>
-
-  </target>
-
-<!-- - - - - - - - - - - - -  derbytools.jar target - - - - - - - - - - -->
-
-  <target name="derbytoolsjar" depends="setsanityname">
-
-    <echo message="Beginning derbytools.jar ${sanity.name} build"/>
-
-    <echo message=" creating tools.list "/>
-    <java classname="org.apache.derbyBuild.classlister" fork="yes">
-      <jvmarg value="-Ddb2jtools=true"/>
-      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derbytools.list"/>
-      <arg value="${basedir}/tools/jar/tools.properties"/>
-      <classpath>
-        <pathelement path="${out.dir}"/>
-      </classpath>
-    </java>
-    <replace file="${derby.jar.dir}/lists/derbytools.list" token="$$$$" value="$$"/>
-
-    <echo message=" creating new tools.properties file "/>
-    <antcall target="infowriter">
-      <param name="info.buildnumber" value="${changenumber}"/>
-      <param name="info.iname" value="Apache Derby Tools"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.productfile" value="derbytools.jar"/>
-      <param name="info.file" value="${out.dir}/org/apache/derby/info/tools.properties"/>
-    </antcall>
-
-    <delete file="${derby.jar.dir}/derbytools.jar"/>
-    <jar destfile="${derby.jar.dir}/derbytools.jar"
-         basedir="${out.dir}"
-         includesfile="${derby.jar.dir}/lists/derbytools.list"
-         compress="true"
-         filesonly="true"/>
-    <jar destfile="${derby.jar.dir}/derbytools.jar"
-         compress="true"
-         filesonly="true"
-         update="true">
-      <fileset dir="${out.dir}"
-               includes="org/apache/derby/loc/sysinfoMessages.properties,
-                         org/apache/derby/loc/toolsmessages.properties,
-                         org/apache/derby/info/tools.properties"/>
-    </jar>
-
-  </target>
-
-<!-- - - - - - - - - - - - - - derbynet.jar target - - - - - - - - - - - -->
-
-  <target name="derbynetjar" depends="setsanityname">
-
-    <echo message="Beginning derbynet.jar ${sanity.name} build"/>
-
-    <echo message=" creating net.list"/> 
-    <java classname="org.apache.derbyBuild.classlister" fork="yes">
-      <jvmarg value="-Ddb2jdrda=true"/>
-      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derbynet.list"/>
-      <arg value="${basedir}/tools/jar/net.properties"/>
-      <classpath>
-        <pathelement path="${out.dir}"/>
-      </classpath>
-    </java>
-
-    <echo message=" creating new net.properties file "/>
-    <antcall target="infowriter">
-      <param name="info.buildnumber" value="${changenumber}"/>
-      <param name="info.iname" value="Apache Derby Network Server"/>
-      <param name="info.ename" value="Apache Derby"/>
-      <param name="info.productfile" value="derbynet.jar"/>
-      <param name="info.file" value="${out.dir}/org/apache/derby/info/net.properties"/>
-    </antcall>
-
-    <delete file="${derby.jar.dir}/derbynet.jar"/>
-    <jar destfile="${derby.jar.dir}/derbynet.jar"
-         basedir="${out.dir}"
-         includesfile="${derby.jar.dir}/lists/derbynet.list"
-         compress="true"
-         filesonly="true"/>
-    <jar destfile="${derby.jar.dir}/derbynet.jar"
-         compress="true"
-         filesonly="true"
-         update="true">
-      <fileset dir="${out.dir}"
-               includes="org/apache/derby/loc/drda/**,
-                         org/apache/derby/info/net.properties"/>
-    </jar>
-
-  </target>
-
-<!-- - - - - - - - - - - -  jar build helper targets  - - - - - - - - - -->
-
-  <target name="setsanityname" depends="init,setissane,sanitynamesane,sanitynameinsane"/>
-
-  <target name="sanitynamesane" if="is.sane">
-    <property name="sanity.name" value="sane"/>
-  </target>
-
-  <target name="sanitynameinsane" unless="is.sane">
-    <property name="sanity.name" value="insane"/>
-  </target>
-
-  <target name="checkosgijar" depends="setosgiavailable,setosgiunavailable"/>
-  <target name="setosgiavailable">
-    <condition property="osgijar.available">
-      <available file="${osgi}"/>
-    </condition>
-  </target>
-  <target name="setosgiunavailable">
-    <condition property="osgijar.unavailable">
-      <not>
-        <available file="${osgi}"/>
-      </not>
-    </condition>
-  </target>
-
-
-  <target name="cleanjars" depends="setsanityname">
-    <delete dir="${basedir}/jars/${sanity.name}"/>
-  </target>
-
-<!-- =================================================================== -->
-<!--                         Nightly build targets                       -->
-<!-- =================================================================== -->
-
-  <target name="buildworld">
-
-    <property name="proceed" value="true"/>
-
-    <!-- Build insane product jars -->
-    <antcall target="clobber"/>
-    <antcall target="insane"/>
-    <antcall target="buildsource"/>
-    <antcall target="buildsource"/>
-    <antcall target="jars"/>
-
-
-    <!-- Build sane product jars -->
-    <antcall target="clobber"/>
-    <antcall target="sane"/>
-    <antcall target="buildsource"/>
-    <antcall target="buildsource"/>
-    <antcall target="jars"/>
-
-    <!-- Build everything else -->
-    <antcall target="javadoc"/>
-
-  </target>
-
-</project>
+<?xml version="1.0"?>
+
+<project default="buildsource" basedir=".">
+
+<!-- Set Properties -->
+  <!-- User settings -->
+  <property file="${user.home}/ant.properties"/>
+  <!-- Set property lib dir -->
+  <property name="properties.dir" value="tools/ant/properties"/>
+  <!-- Significant dirs -->
+  <property file="${properties.dir}/dirs.properties"/>
+  <!-- Compiler settings -->
+  <property file="${properties.dir}/sane${sanity}.properties"/>
+  <property file="${properties.dir}/defaultcompiler.properties"/>
+  <property file="${properties.dir}/${build.compiler}.properties"/>
+  <!-- Compile-time classpath properties files -->
+  <property file="${properties.dir}/extrapath.properties"/>
+  <property file="${properties.dir}/compilepath.properties"/>
+  <!-- Release and version info -->
+  <property file="${properties.dir}/release.properties"/>
+
+<!-- Targets -->
+
+  <target name="buildsource" depends="init,engine,tools,drda,build,versioninfo"/>
+
+<!-- ==================================================================== -->
+<!--                       Initialize targets                             -->
+<!-- ==================================================================== -->
+
+  <target name="init" unless="init.done">
+    <tstamp/>
+    <mkdir dir="${out.dir}"/>
+    <!-- generate sanity state.properties if one does not exist -->
+    <available property="state.available" file="${state.file}"/>
+    <antcall target="ensuresanitystate"/>
+    <property file="${state.file}"/>
+    <property file="${properties.dir}/sane${sanity}.properties"/>
+    <antcall target="setissane"/>
+    <property name="init.done" value="true"/>
+  </target>
+
+  <target name="setissane">
+    <condition property="is.sane">
+      <equals arg1="${sanity}" arg2="true"/>
+    </condition>
+  </target>
+
+  <target name="ensuresanitystate" unless="state.available">
+    <antcall target="sane"/>
+  </target>
+
+  <target name="showenv" depends="init" unless="showenv.done">
+    <echo message=""/>
+    <echo message="Ant environment:"/>
+    <echo message="  Base Directory: ${basedir}"/>
+    <echo message="  Build output: ${out.dir}"/>
+    <echo message="  Compiler: ${build.compiler}"/>
+    <echo message="  Sane = ${sane}"/>
+    <echo message="  Proceed = ${proceed}"/>
+    <echo message=""/>
+    <property name="showenv.done" value="true"/>
+  </target>
+
+<!-- ==================================================================== -->
+<!--                     Build version info files                         -->
+<!-- ==================================================================== -->
+
+  <target name="versioninfo" depends="ckversioninfo,writeversioninfo"/>
+
+  <target name="ckversioninfo">
+    <condition property="versioninfo.available">
+      <and>
+        <available file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
+        <available file="${out.dir}/org/apache/derby/info/tools.properties"/>
+        <available file="${out.dir}/org/apache/derby/info/net.properties"/>
+      </and>
+    </condition>
+  </target>
+
+  <target name="writeversioninfo" unless="versioninfo.available">
+    <mkdir dir="${out.dir}/org/apache/derby/info/"/>
+
+    <antcall target="infowriter">
+      <param name="info.buildnumber" value="1"/>
+      <param name="info.iname" value="Apache Derby Embedded Engine"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.productfile" value="codeline"/>
+      <param name="info.file" value="${out.dir}/org/apache/derby/info/DBMS.properties"/>
+    </antcall>
+    <antcall target="infowriter">
+      <param name="info.buildnumber" value="1"/>
+      <param name="info.iname" value="Apache Derby Tools"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.productfile" value="codeline"/>
+      <param name="info.file" value="${out.dir}/org/apache/derby/info/tools.properties"/>
+    </antcall>
+    <antcall target="infowriter">
+      <param name="info.buildnumber" value="1"/>
+      <param name="info.iname" value="Apache Derby Network Server"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.productfile" value="codeline"/>
+      <param name="info.file" value="${out.dir}/org/apache/derby/info/net.properties"/>
+    </antcall>
+  </target>
+
+  <target name="cleanversion">
+    <delete file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
+    <delete file="${out.dir}/org/apache/derby/info/tools.properties"/>
+    <delete file="${out.dir}/org/apache/derby/info/net.properties"/>
+  </target>
+<!-- ==================================================================== -->
+<!--                         Info writer build target                     -->
+<!-- ==================================================================== -->
+
+  <target name="infowriter">
+    <propertyfile file="${info.file}" comment="${copyright.comment}">
+      <entry key="derby.version.major" value="${major}"/>
+      <entry key="derby.version.minor" value="${minor}"/>
+      <entry key="derby.version.maint" value="${maint}"/>
+      <entry key="derby.version.drdamaint" value="${drdamaint}"/>
+      <entry key="derby.build.number" value="${info.buildnumber}"/>
+      <entry key="derby.product.technology.name" value="${info.iname}"/>
+      <entry key="derby.product.external.name" value="${info.ename}"/>
+      <entry key="derby.product.external.version" value="${eversion}"/>
+      <entry key="derby.version.beta" value="${beta}"/>
+      <entry key="derby.product.vendor" value="${vendor}"/>
+      <entry key="derby.product.file" value="${info.productfile}"/>
+    </propertyfile>
+  </target>  
+
+
+<!-- ==================================================================== -->
+<!--                   Derby Engine build target                     -->
+<!-- ==================================================================== -->
+
+  <target name="engine" depends="state,parsers">
+    <ant dir="${derby.engine.src.dir}"/>
+    <antcall target="build"/>
+    <ant dir="${derby.engine.dir}/loc"/>
+    <antcall target="class_size_catalog"/>
+  </target>
+
+  <target name="tools" depends="engine">
+    <ant dir="${derby.tools.src.dir}"/>
+  </target>
+
+  <target name="drda" depends="engine">
+    <ant dir="${derby.drda.src.dir}"/>
+  </target>
+
+  <target name="build" >
+    <ant dir="${derby.build.src.dir}"/>
+  </target>
+
+<!-- ==================================================================== -->
+<!--                     Build SanityState.java                           -->
+<!-- ==================================================================== -->
+
+  <target name="getstate">
+    <condition property="needstate">
+      <or>
+        <not>
+          <equals arg1="${sane}" arg2="${sanity}"/>
+        </not>
+        <not>
+          <available file="${sanity.dir}/SanityState.java"/>
+        </not>
+      </or>
+    </condition>
+  </target>
+
+  <property name="state.file" value="${derby.engine.src.dir}/state.properties"/>
+  <property file="${state.file}"/>
+  <target name="state" if="needstate"
+          depends="showenv,getstate"
+          description="Build SanityState.java">
+    <echo message="  Generating SanityState.java..."/>
+    <property name="sane" value="true"/>
+    <filter token="SANE" value="${sane}"/>
+    <copy file="${sanity.dir}/SanityState.tmpl"
+          tofile="${sanity.dir}/SanityState.java"
+          overwrite="yes" filtering="on"/>
+    <property name="header" value="Generated file - do not modify!"/>
+    <propertyfile file="${state.file}" comment="${header}">
+      <entry key="sanity" value="${sane}" type="string"/>
+    </propertyfile>
+    <delete dir="${sanity.out.dir}"/>
+  </target>
+
+<!-- =================================================================== -->
+<!--                     Remove SanityState.java file                    -->
+<!-- =================================================================== -->
+  <target name="cleanstate">
+    <delete file="${derby.engine.src.dir}/state.properties"/>
+    <delete file="${sanity.dir}/SanityState.java"/>
+    <delete dir="${sanity.out.dir}"/>
+  </target>
+
+<!-- =================================================================== -->
+<!--                 Remove all built objects (except jars)              -->
+<!-- =================================================================== -->
+  <target name="clobber" depends="showenv,clean,cleanstate,cleanparsers,cleancatalog"/>
+
+<!-- =================================================================== -->
+<!--                       Remove output tree                            -->
+<!-- =================================================================== -->
+  <target name="clean">
+    <delete dir="${out.dir}"/>
+  </target>
+
+<!-- ==================================================================== -->
+<!--                         Build parsers                                -->
+<!-- ==================================================================== -->
+  <target name="parsers"
+          description="Build the parsers">
+    <ant dir="${derby.tools.dir}/impl/tools"  target="parser"/>
+    <ant dir="${derby.engine.dir}/impl/sql"  target="parser"/>
+  </target>
+
+  <target name="genParser" depends="chkparser" unless="parser.done">
+    <echo message="  ${msg}"/>
+    <delete>
+      <fileset dir="${directory}" includes="${rmfiles}"/>
+    </delete>
+    <java classname="javacc"
+          classpath="${jjpath}"
+                dir="${directory}"
+               fork="yes"
+        failonerror="true">
+      <arg value="${jjfile}"/>
+    </java>
+  </target>
+
+  <target name="chkparser">
+    <uptodate property="parser.done"
+              targetfile="${directory}/${chkfile}" >
+      <srcfiles dir="${directory}" includes="${jjfile}" />
+    </uptodate>
+  </target>
+
+<!-- =================================================================== -->
+<!--                     Remove parser-generated files                   -->
+<!-- =================================================================== -->
+  <target name="cleanparsers">
+    <delete>
+      <fileset dir="${derby.engine.dir}/impl/sql/compile" includes="SQLParser.java,SQLParserTokenManager.java,SQLParserConstants.java"/>
+    </delete>
+    <delete>
+      <fileset dir="${derby.tools.dir}/impl/tools/ij"
+            includes="ij.java ijTokenManager.java ijConstants.java Token.java,mtGrammar.java,mtGrammarConstants.java,mtGrammarTokenManager.java"/>
+    </delete>
+  </target>
+
+<!-- =================================================================== -->
+<!--                     Class Size Catalog build                        -->
+<!-- =================================================================== -->
+
+  <!-- Note that checking the up-to-date status of the files scanned by  -->
+  <!-- ClassSizeCrawler will not always result in the ClassSizeCatalog   -->
+  <!-- being updated properly. We would have to be able to scan the full -->
+  <!-- dependency tree. This does prevent recompilation in most cases,   -->
+  <!-- and requires it in the most obvious. If there is concern that     -->
+  <!-- the ClassSizeCatalog may have changed significantly since the     -->
+  <!-- last build, run cleancatalog and rebuild to regenerate it.        -->
+
+  <target name="class_size_catalog" depends="cscuptodate" unless="csc.uptodate"
+          description="create the class size catalog -- a java file">
+    <java classname="org.apache.derbyBuild.ClassSizeCrawler"
+          fork="yes"
+          failonerror="yes">
+      <classpath>
+        <pathelement path="${out.dir}"/>
+        <pathelement path="${compile.classpath}"/>
+      </classpath>
+      <jvmarg value="-DWS=${workspace}"/>
+      <jvmarg value="-DclassDir=${out.dir}"/>
+      <jvmarg value="-Dout=${derby.engine.src.dir}/${derby.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
+      <jvmarg value="-Dprefix.1=org.apache.derby.iapi.types"/>            
+      <jvmarg value="-Dprefix.2=org.apache.derby.impl"/>
+      <arg value="org.apache.derby.iapi.types.DataValueDescriptor"/>
+      <arg value="org.apache.derby.impl.services.cache.CachedItem"/>
+      <arg value="org.apache.derby.impl.store.raw.data.RecordId"/>
+      <arg value="org.apache.derby.iapi.store.raw.ContainerKey"/>
+      <arg value="org.apache.derby.iapi.services.cache.SizedCacheable"/>
+      <arg value="java.lang.ref.WeakReference"/>
+      <arg value="java.math.BigDecimal"/>
+      <arg value="java.util.ArrayList"/>
+      <arg value="java.util.GregorianCalendar"/>
+    </java>
+
+    <javac
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}"
+      srcdir="${derby.engine.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <pathelement path="${compile.classpath}"/>
+      </classpath>
+      <include name="${derby.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
+    </javac>
+
+  </target>
+
+  <target name="cscuptodate">
+    <condition property="csc.uptodate">
+      <and>
+        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/types/DataValueDescriptor.java"
+                  targetfile="${out.dir}/org/apache/derby/iapi/types/DataValueDescriptor.class"/>
+        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/impl/services/cache/CachedItem.java"
+                  targetfile="${out.dir}/org/apache/derby/impl/services/cache/CachedItem.class"/>
+        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/impl/store/raw/data/RecordId.java"
+                  targetfile="${out.dir}/org/apache/derby/impl/store/raw/data/RecordId.class"/>
+        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/store/raw/ContainerKey.java"
+                  targetfile="${out.dir}/org/apache/derby/iapi/store/raw/ContainerKey.class"/>
+        <uptodate srcfile="${osengsrc.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.java"
+                  targetfile="${out.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.class"/>
+        <available file="${osengsrc.dir}/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java"/>
+      </and>
+    </condition>
+  </target>
+
+  <target name="cleancatalog"
+          description="Remove the generated catalog java file.">
+    <delete file="${derby.engine.dir}/iapi/services/cache/ClassSizeCatalog.java"/>
+  </target>
+
+<!-- =================================================================== -->
+<!--                     Generate sanity.properties                      -->
+<!-- =================================================================== -->
+
+  <target name="sane">
+    <propertyfile file="${state.file}" comment="${header}">
+      <entry key="sanity" value="true" type="string"/>
+    </propertyfile>
+  </target>
+  <target name="insane">
+    <propertyfile file="${state.file}" comment="${header}">
+      <entry key="sanity" value="false" type="string"/>
+    </propertyfile>
+  </target>
+
+
+<!-- =================================================================== -->
+<!--                           Javadoc targets                           -->
+<!-- =================================================================== -->
+
+  <target name="javadoc" depends="publishedapi,derbydocs,toolsdocs,grammardocs"/>
+
+  <target name="publishedapi">
+
+    <delete dir="${basedir}/javadoc/publishedapi"/>
+    <delete dir="${basedir}/javadoc/sourcedir"/>
+    <mkdir dir="${basedir}/javadoc/publishedapi"/>
+    <mkdir dir="${basedir}/javadoc/sourcedir"/>
+
+    <!-- drda files -->
+    <mkdir dir="${basedir}/javadoc/sourcedir"/>
+    <copy todir="${basedir}/javadoc/sourcedir"> 
+      <fileset dir="${derby.drda.src.dir}"
+               includesfile="${javadoctools.dir}/publishedapi.ant"/>
+    </copy>
+	
+    <!-- engine files -->
+    <copy todir="${basedir}/javadoc/sourcedir">
+      <fileset dir="${derby.engine.src.dir}"
+               includesfile="${javadoctools.dir}/publishedapi.ant"/>
+    </copy>
+
+    <!-- tools files -->
+    <copy todir="${basedir}/javadoc/sourcedir">
+      <fileset dir="${derby.tools.src.dir}"
+               includesfile="${javadoctools.dir}/publishedapi.ant"/>
+    </copy>
+
+    <javadoc sourcepath="${basedir}/javadoc/sourcedir/"
+             classpath="${compile.classpath};${osgi};${servlet22};${out.dir}"
+             breakiterator="true"
+             destdir="${basedir}/javadoc/publishedapi"
+             packagenames="org.apache.derby.authentication,org.apache.derby.drda,org.apache.derby.jdbc.io,org.apache.derby.jdbc,org.apache.derby.tools"
+             Windowtitle="Apache Derby ${major}.${minor} API Documentation"
+             Doctitle="Apache Derby ${major}.${minor} API Documentation"
+             bottom="Apache Derby ${major}.${minor} API Documentation  -  &lt;i&gt;Copyright &amp;copy; IBM Corp. 1997,2004 All Rights Reserved.&lt;/i&gt;"/>
+
+    <delete dir="${basedir}/javadoc/sourcedir"/>
+
+  </target>
+
+  <target name="derbydocs">
+
+    <delete dir="${basedir}/javadoc/engine"/>
+    <mkdir dir="${basedir}/javadoc/engine"/>
+
+    <antcall target="javadocsubpackages">
+      <param name="javadoc.sourcepath" value="${derby.engine.src.dir};${derby.drda.src.dir};${derby.tools.src.dir}"/>
+      <param name="javadoc.classpath" value="${basedir}/classes;${java14compile.classpath};${jars.extras};${osgi}"/>
+      <param name="javadoc.destdir" value="${basedir}/javadoc/engine"/>
+      <param name="javadoc.subpackages" value="org.apache.derby"/>
+      <param name="javadoc.doctitle" value="Apache Derby V${major}.${minor} Engine Documentation"/>
+      <param name="javadoc.windowtitle" value="Apache Derby V${major}.${minor} Engine Documentation"/>
+      <param name="javadoc.bottom" value="Apache Derby V${major}.${minor} Engine Documentation  -  &lt;i&gt;Copyright &amp;copy; IBM Corp. 1997,2004 All Rights Reserved.&lt;/i&gt;"/>
+    </antcall>
+  </target>
+
+  <target name="toolsdocs">
+
+    <delete dir="${basedir}/javadoc/tools"/>
+    <mkdir dir="${basedir}/javadoc/tools"/>
+
+    <antcall target="dojjdocs">
+      <param name="jjtodoc" value="${derby.tools.dir}/impl/tools/ij/ij.jj"/>
+      <param name="jjdoctarget" value="${basedir}/javadoc/tools/ij.html"/>
+    </antcall>
+
+  </target>
+
+  <target name="grammardocs">
+
+    <delete dir="${basedir}/javadoc/language"/>
+    <mkdir dir="${basedir}/javadoc/language"/>	
+
+    <antcall target="dojjdocs">
+      <param name="jjtodoc" value="${derby.engine.dir}/impl/sql/compile/sqlgrammar.jj"/>
+      <param name="jjdoctarget" value="${basedir}/javadoc/language/sqlgrammar.html"/>
+    </antcall>
+
+  </target>
+
+  <target name="dojjdocs">
+
+    <java classname="jjdoc" fork="yes">
+      <classpath path="${javatools.dir}/javacc.jar;${compile.classpath}"/>
+      <arg value="-NOONE_TABLE"/>
+      <arg value="-output_file=${jjdoctarget}"/>
+      <arg value="${jjtodoc}"/>
+    </java>
+
+  </target>
+
+  <target name="javadocsubpackages">
+    <java classname="com.sun.tools.javadoc.Main" fork="yes">
+      <classpath path="${java.home}/../lib/tools.jar;${out.dir}"/>
+      <jvmarg value="-mx320M"/>
+      <arg value="-subpackages"/>
+      <arg value="org"/>
+      <arg value="-private"/>
+      <arg value="-breakiterator"/>
+      <arg value="-sourcepath"/>
+      <arg value="${javadoc.sourcepath}"/>
+      <arg value="-classpath"/>
+      <arg value="${javadoc.classpath}"/>
+      <arg value="-d"/>
+      <arg value="${javadoc.destdir}"/>
+      <arg value="-windowtitle"/>
+      <arg value="${javadoc.windowtitle}"/>
+      <arg value="-doctitle"/>
+      <arg value="${javadoc.doctitle}"/>
+      <arg value="-bottom"/>
+      <arg value="${javadoc.bottom}"/>
+      <arg value="-taglet"/>
+      <arg value="org.apache.derbyBuild.javadoc.FormatIdTaglet"/>
+      <arg value="-taglet"/>
+      <arg value="org.apache.derbyBuild.javadoc.PurposeTaglet"/>
+      <arg value="-taglet"/>
+      <arg value="org.apache.derbyBuild.javadoc.UpgradeTaglet"/>
+      <arg value="-taglet"/>
+      <arg value="org.apache.derbyBuild.javadoc.DiskLayoutTaglet"/>
+      <arg value="-taglet"/>
+      <arg value="org.apache.derbyBuild.javadoc.EndFormatTaglet"/>
+    </java>
+  </target>
+
+  <target name="cleandocs">
+
+    <delete dir="${basedir}/javadoc"/>
+
+  </target>
+
+<!-- =================================================================== -->
+<!--                               Jar targets                           -->
+<!-- =================================================================== -->
+
+  <target name="buildjarsclean" depends="cleanjars,initjars,derbyjar,derbytoolsjar,derbynetjar"/>
+  <target name="buildjars" depends="initjars,derbyjar,derbytoolsjar,derbynetjar"/>
+
+  <target name="initjars" depends="setsanityname,getsvnversion">
+    <property name="derby.jar.dir" value="${basedir}/jars/${sanity.name}"/>
+    <property name="derby.jar.topdir" value="${basedir}/jars"/>
+    <mkdir dir="${derby.jar.dir}"/>
+    <mkdir dir="${derby.jar.dir}/lists"/>
+     <loadfile srcFile="${basedir}/changenumber.properties"
+               failonerror="false"
+               property="changenumber"/>
+    <condition property="changenumber" value="???">
+      <not>
+        <isset property="changenumber"/>
+      </not>
+    </condition>
+    <echo message="Revision number set to ${changenumber}."/>
+  </target>
+
+
+<!-- - - - - - - - - - - - - - - derby.jar target - - - - - - - - - - - -->
+
+  <target name="derbyjar" depends="initjars">
+
+    <echo message="Beginning derby.jar ${sanity.name} build"/>
+
+    <concat destfile="${derby.jar.dir}/lists/otherDerbyClasses.properties">
+      <fileset dir="${basedir}/tools/jar" includes="*DBMS*.properties"/>
+    </concat>
+
+    <mkdir dir="${derby.jar.dir}/lists/org/apache/derby"/>
+    <java classname="org.apache.derbyBuild.propertyconfig">
+      <arg value="${out.dir}/org/apache/derby/modules.properties"/>
+      <arg value="derby"/>
+      <arg value="${derby.jar.dir}/lists/org/apache/derby/modules.properties"/>
+      <classpath>
+        <pathelement path="${out.dir}"/>
+      </classpath>
+    </java>
+
+    <!-- filter out EmbeddedActivator if osgi.jar is not available -->
+    <antcall target="filteractivator"/>
+
+    <echo message=" creating derby.jar class list "/>
+    <java classname="org.apache.derbyBuild.classlister" fork="yes">
+      <jvmarg value="-DcloudscapeOnly=true"/>
+      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derby.list"/>
+      <arg value="${derby.jar.dir}/lists/otherDerbyClasses.properties"/> 
+      <arg value="${derby.jar.dir}/lists/org/apache/derby/modules.properties"/>
+      <classpath>
+        <pathelement path="${out.dir}"/> 
+      </classpath>
+    </java>
+
+    <!-- This next antcall generates a new properties file for the build.  -->
+    <!-- If a changenumber is passed into the build via a property file or -->
+    <!-- on the command line, the build number will be inserted into the   -->
+    <!-- build at this point.                                              -->
+ 
+    <echo message=" creating new DBMS.properties file"/>
+    <antcall target="infowriter">
+      <param name="info.iname" value="Apache Derby Embedded Engine"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.buildnumber" value="${changenumber}"/>
+      <param name="info.productfile" value="derby.jar"/>
+      <param name="info.file" value="${out.dir}//org/apache/derby/info/DBMS.properties"/>
+    </antcall>
+    <echo file="${derby.jar.dir}/lists/derby.list"
+          append="true"
+          message="org/apache/derby/info/DBMS.properties"/>
+
+    <!-- the next two targets are orthogonal. Only one will be executed, -->
+    <!-- depending on whether or not osgi.jar is available.              -->
+    <antcall target="derbyjarwithosgi"/>
+    <antcall target="derbyjarwithoutosgi"/>
+
+    <!-- add non-class files to jar -->
+
+    <jar destfile="${derby.jar.dir}/derby.jar" 
+         update="true"
+         compress="true">
+      <fileset dir="${out.dir}"
+               includes="org/apache/derby/loc/m?_en.properties,
+                         org/apache/derby/loc/m??_en.properties,
+                         org/apache/derby/loc/sysinfoMessages.properties,
+                         org/apache/derby/loc/toolsmessages.properties,
+                         org/apache/derby/impl/jdbc/metadata.properties,
+                         org/apache/derby/impl/sql/catalog/metadata_net.properties,
+                         org/apache/derby/info/DBMS.properties"/>
+      <fileset dir="${derby.jar.dir}/lists"
+               includes="org/apache/derby/modules.properties"/>
+    </jar>
+
+  </target>
+
+  <target name="filteractivator" depends="checkosgijar" if="osgijar.unavailable">
+
+    <replaceregexp file="${derby.jar.dir}/lists/otherDerbyClasses.properties"
+                   match="derby.module.osgi.activator=org.apache.derby.osgi.EmbeddedActivator"
+                   replace=""/>
+
+  </target>
+
+  <target name="derbyjarwithoutosgi" depends="checkosgijar" if="osgijar.unavailable">
+
+    <manifest file="${derby.jar.dir}/lists/smf.mf">
+      <attribute name="Bundle-Vendor" value="Apache Software Foundation"/>
+      <attribute name="Bundle-Name" value="Apache Derby ${major}.${minor}"/>
+      <attribute name="Bundle-Version" value="${major}.${minor}.${maint}"/>
+    </manifest> 
+
+    <jar destfile="${derby.jar.dir}/derby.jar"
+         basedir="${out.dir}"
+	 includesfile="${derby.jar.dir}/lists/derby.list"
+         compress="true"
+         filesonly="true"
+         manifest="${derby.jar.dir}/lists/smf.mf"/>
+
+  </target>
+
+  <target name="derbyjarwithosgi" depends="checkosgijar" if="osgijar.available">
+
+    <manifest file="${derby.jar.dir}/lists/smf.mf">
+      <attribute name="Bundle-Vendor" value="Apache Software Foundation"/>
+      <attribute name="Bundle-Activator" value="org.apache.derby.osgi.EmbeddedActivator"/>
+      <attribute name="Bundle-Name" value="Apache Derby ${major}.${minor}"/>
+      <attribute name="Bundle-Version" value="${major}.${minor}.${maint}"/>
+      <attribute name="Import-Package" value="java.sql"/>
+      <attribute name="DynamicImport-Package" value="*"/>
+      <attribute name="Export-Package" value="org.apache.derby.authentication,org.apache.derby.database,org.apache.derby.io,org.apache.derby.jdbc,org.apache.derby.vti"/> 
+    </manifest> 
+
+    <jar destfile="${derby.jar.dir}/derby.jar"
+         basedir="${out.dir}"
+	 includesfile="${derby.jar.dir}/lists/derby.list"
+         compress="true"
+         filesonly="true"
+         manifest="${derby.jar.dir}/lists/smf.mf"/>
+
+  </target>
+
+<!-- - - - - - - - - - - - -  derbytools.jar target - - - - - - - - - - -->
+
+  <target name="derbytoolsjar" depends="setsanityname">
+
+    <echo message="Beginning derbytools.jar ${sanity.name} build"/>
+
+    <echo message=" creating tools.list "/>
+    <java classname="org.apache.derbyBuild.classlister" fork="yes">
+      <jvmarg value="-Ddb2jtools=true"/>
+      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derbytools.list"/>
+      <arg value="${basedir}/tools/jar/tools.properties"/>
+      <classpath>
+        <pathelement path="${out.dir}"/>
+      </classpath>
+    </java>
+    <replace file="${derby.jar.dir}/lists/derbytools.list" token="$$$$" value="$$"/>
+
+    <echo message=" creating new tools.properties file "/>
+    <antcall target="infowriter">
+      <param name="info.buildnumber" value="${changenumber}"/>
+      <param name="info.iname" value="Apache Derby Tools"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.productfile" value="derbytools.jar"/>
+      <param name="info.file" value="${out.dir}/org/apache/derby/info/tools.properties"/>
+    </antcall>
+
+    <delete file="${derby.jar.dir}/derbytools.jar"/>
+    <jar destfile="${derby.jar.dir}/derbytools.jar"
+         basedir="${out.dir}"
+         includesfile="${derby.jar.dir}/lists/derbytools.list"
+         compress="true"
+         filesonly="true"/>
+    <jar destfile="${derby.jar.dir}/derbytools.jar"
+         compress="true"
+         filesonly="true"
+         update="true">
+      <fileset dir="${out.dir}"
+               includes="org/apache/derby/loc/sysinfoMessages.properties,
+                         org/apache/derby/loc/toolsmessages.properties,
+                         org/apache/derby/info/tools.properties"/>
+    </jar>
+
+  </target>
+
+<!-- - - - - - - - - - - - - - derbynet.jar target - - - - - - - - - - - -->
+
+  <target name="derbynetjar" depends="setsanityname">
+
+    <echo message="Beginning derbynet.jar ${sanity.name} build"/>
+
+    <echo message=" creating net.list"/> 
+    <java classname="org.apache.derbyBuild.classlister" fork="yes">
+      <jvmarg value="-Ddb2jdrda=true"/>
+      <jvmarg value="-Doutputfile=${derby.jar.dir}/lists/derbynet.list"/>
+      <arg value="${basedir}/tools/jar/net.properties"/>
+      <classpath>
+        <pathelement path="${out.dir}"/>
+      </classpath>
+    </java>
+
+    <echo message=" creating new net.properties file "/>
+    <antcall target="infowriter">
+      <param name="info.buildnumber" value="${changenumber}"/>
+      <param name="info.iname" value="Apache Derby Network Server"/>
+      <param name="info.ename" value="Apache Derby"/>
+      <param name="info.productfile" value="derbynet.jar"/>
+      <param name="info.file" value="${out.dir}/org/apache/derby/info/net.properties"/>
+    </antcall>
+
+    <delete file="${derby.jar.dir}/derbynet.jar"/>
+    <jar destfile="${derby.jar.dir}/derbynet.jar"
+         basedir="${out.dir}"
+         includesfile="${derby.jar.dir}/lists/derbynet.list"
+         compress="true"
+         filesonly="true"/>
+    <jar destfile="${derby.jar.dir}/derbynet.jar"
+         compress="true"
+         filesonly="true"
+         update="true">
+      <fileset dir="${out.dir}"
+               includes="org/apache/derby/loc/drda/**,
+                         org/apache/derby/info/net.properties"/>
+    </jar>
+
+  </target>
+
+<!-- - - - - - - - - - - -  jar build helper targets  - - - - - - - - - -->
+
+  <target name="setsanityname" depends="init,setissane,sanitynamesane,sanitynameinsane"/>
+
+  <target name="sanitynamesane" if="is.sane">
+    <property name="sanity.name" value="sane"/>
+  </target>
+
+  <target name="sanitynameinsane" unless="is.sane">
+    <property name="sanity.name" value="insane"/>
+  </target>
+
+  <target name="checkosgijar" depends="setosgiavailable,setosgiunavailable"/>
+  <target name="setosgiavailable">
+    <condition property="osgijar.available">
+      <available file="${osgi}"/>
+    </condition>
+  </target>
+  <target name="setosgiunavailable">
+    <condition property="osgijar.unavailable">
+      <not>
+        <available file="${osgi}"/>
+      </not>
+    </condition>
+  </target>
+
+   <target name="getsvnversion">
+     <exec executable="svnversion"
+           failifexecutionfails="no"
+           output="${basedir}/changenumber.properties">
+       <arg value="${basedir}"/>
+       <arg value="-n"/>
+     </exec>
+   </target>
+
+  <target name="cleanjars" depends="setsanityname">
+    <delete dir="${basedir}/jars/${sanity.name}"/>
+  </target>
+
+<!-- =================================================================== -->
+<!--                         Nightly build targets                       -->
+<!-- =================================================================== -->
+
+  <target name="buildworld">
+
+    <property name="proceed" value="true"/>
+
+    <!-- Build insane product jars -->
+    <antcall target="clobber"/>
+    <antcall target="insane"/>
+    <antcall target="buildsource"/>
+    <antcall target="buildsource"/>
+    <antcall target="jars"/>
+
+
+    <!-- Build sane product jars -->
+    <antcall target="clobber"/>
+    <antcall target="sane"/>
+    <antcall target="buildsource"/>
+    <antcall target="buildsource"/>
+    <antcall target="jars"/>
+
+    <!-- Build everything else -->
+    <antcall target="javadoc"/>
+
+  </target>
+
+</project>

Modified: incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java
==============================================================================
--- incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java	(original)
+++ incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DB2jServerImpl.java	Thu Sep 23 09:39:02 2004
@@ -154,7 +154,7 @@
 	protected static String att_extnam;
 	protected static String att_srvrlslv; 
 	protected static String prdId;
-	private static int buildNumber;
+	private static String buildNumber;
 	// we will use single or mixed, not double byte to reduce traffic on the
 	// wire, this is in keeping with JCC
 	// Note we specify UTF8 for the single byte encoding even though it can

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/diag/Performance.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/diag/Performance.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/diag/Performance.java	Thu Sep 23 09:39:02 2004
@@ -20,5 +20,5 @@
 	// file and change the value of this to `true', then compile
 	// whichever other classes are depending on this.  In general,
 	// such a check-out should only be temporary.
-	public static final boolean MEASURE = false;
+	public static final boolean MEASURE = true;
 }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/info/ProductVersionHolder.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/info/ProductVersionHolder.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/info/ProductVersionHolder.java	Thu Sep 23 09:39:02 2004
@@ -122,7 +122,7 @@
 	private int minorVersion = BAD_NUMBER;
 	private int maintVersion = BAD_NUMBER;
 	private int drdaMaintVersion = BAD_NUMBER;
-	private int buildNumber = BAD_NUMBER;
+	private String buildNumber = "????";
 	private Boolean isBeta;
 
 	private ProductVersionHolder() {
@@ -141,7 +141,7 @@
 								 int minorVersion,
 								 int maintVersion,
 								 int drdaMaintVersion,
-								 int buildNumber,
+								 String buildNumber,
 								 Boolean isBeta)
 	{
 		if (productVendorName != null)
@@ -171,7 +171,7 @@
 	  @param maintVersion The least significant portion of a 3 part
 	  product version. Must be non-negative.
 	  @param drdaMaintVersion The protocol modification number for minor release.
-	  @param buildNumber The buildNumber for a product. Must be positive.
+	  @param buildNumber The buildNumber for a product. 
 	  @param isBeta true iff the product is beta.
 	  @return A valid ProductVersionHolder of null if any of the parameters
 	  provided are not valid.
@@ -185,7 +185,7 @@
 						   int minorVersion,
 						   int maintVersion,
 						   int drdaMaintVersion,
-						   int buildNumber,
+						   String buildNumber,
 						   Boolean isBeta)
 	{
 		ProductVersionHolder pvh =
@@ -288,7 +288,7 @@
 		int v2 = parseInt(p.getProperty(PropertyNames.PRODUCT_MINOR_VERSION));
 		int v3 = parseInt(p.getProperty(PropertyNames.PRODUCT_MAINT_VERSION));
 		int v4 = parseInt(p.getProperty(PropertyNames.PRODUCT_DRDA_MAINT_VERSION));
-		int bn = parseInt(p.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER));
+		String bn = p.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER);
 		Boolean isBeta =
 			Boolean.valueOf(p.getProperty(PropertyNames.PRODUCT_BETA_VERSION));
 		return 	getProductVersionHolder(pvn,pn,ptn,v1,v2,v3,v4,bn,isBeta);
@@ -357,8 +357,40 @@
 	/**
 	  Return the build number for this product.
 	  */
-	public int getBuildNumber() {return buildNumber;}
+	public String getBuildNumber() {return buildNumber;}
 
+    /**
+     * Return the build number as an integer if possible,
+     * mapping from the SVN number.
+     * nnnnn -> returns nnnnn
+     * nnnnnM -> returns -nnnnn indicates a modified code base
+     * nnnnn:mmmmm -> returns -nnnnn
+     * anything else -> returns -1
+    */
+    public int getBuildNumberAsInt(){
+    	if (buildNumber == null)
+    	    return -1;
+    	boolean dubiousCode = false;
+    	int offset = buildNumber.indexOf('M');
+    	if (offset == -1)
+    	    offset = buildNumber.indexOf(':');
+    	else
+    	    dubiousCode = true;
+    	if (offset == -1)
+    		offset = buildNumber.length();
+        else
+            dubiousCode = true;
+    	
+    	try {
+    		int bnai = Integer.parseInt(buildNumber.substring(0, offset));
+    		if (dubiousCode)
+    		    bnai = -bnai;
+    		return bnai;
+    	} catch (NumberFormatException nfe) 
+     	{
+     		return -1;
+    	}
+    }
 
 	/**
 	  Parse a string containing a non-negative integer. Return
@@ -426,7 +458,7 @@
 
 		return sb.toString();
 	}
-	public static String fullVersionString(int major, int minor, int maint, boolean isBeta, int build) {
+	public static String fullVersionString(int major, int minor, int maint, boolean isBeta, String build) {
 		StringBuffer sb = new StringBuffer();
 		sb.append(major);
 		sb.append('.');
@@ -462,7 +494,7 @@
 			sb.append(' ');
             sb.append(preRelease);
         }
-		if (build != 0) {
+		if (build != null) {
 			sb.append(" - (");
 
 			sb.append(build);
@@ -478,7 +510,7 @@
     public String getVersionBuildString(boolean withBuild)
     {
 		return ProductVersionHolder.fullVersionString(majorVersion, minorVersion, maintVersion, isBeta(),
-			withBuild ? buildNumber : 0);
+			withBuild ? buildNumber : null);
     }
 
 	/*

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java	Thu Sep 23 09:39:02 2004
@@ -279,26 +279,26 @@
 		byte[] result = new byte[16];
 
 		int lsequence = sequence; 
-		result[0] = (byte)((lsequence & 0xff000000) >>> 24);
-		result[1] = (byte)((lsequence & 0x00ff0000) >>> 16);
-		result[2] = (byte)((lsequence & 0x0000ff00) >>> 8);
-		result[3] = (byte) (lsequence & 0x000000ff);
+		result[0] = (byte)(lsequence >>> 24);
+		result[1] = (byte)(lsequence >>> 16);
+		result[2] = (byte)(lsequence >>> 8);
+		result[3] = (byte)lsequence;
 
 		long ltimemillis = timemillis;
-		result[4] = (byte)((ltimemillis & 0x0000ff0000000000L) >>> 40);
-		result[5] = (byte)((ltimemillis & 0x000000ff00000000L) >>> 32);
-		result[6] = (byte)((ltimemillis & 0x00000000ff000000L) >>> 24);
-		result[7] = (byte)((ltimemillis & 0x0000000000ff0000L) >>> 16);
- 		result[8] = (byte)((ltimemillis & 0x000000000000ff00L) >>> 8);
-		result[9] = (byte) (ltimemillis & 0x00000000000000ffL);
+		result[4] = (byte)(ltimemillis >>> 40);
+		result[5] = (byte)(ltimemillis >>> 32);
+		result[6] = (byte)(ltimemillis >>> 24);
+		result[7] = (byte)(ltimemillis >>> 16);
+ 		result[8] = (byte)(ltimemillis >>> 8);
+		result[9] = (byte)ltimemillis;
 
 		long linetaddr = majorId;
-		result[10] = (byte)((linetaddr & 0x0000ff0000000000L) >>> 40);
-		result[11] = (byte)((linetaddr & 0x000000ff00000000L) >>> 32);
-		result[12] = (byte)((linetaddr & 0x00000000ff000000L) >>> 24);
-		result[13] = (byte)((linetaddr & 0x0000000000ff0000L) >>> 16);
-		result[14] = (byte)((linetaddr & 0x000000000000ff00L) >>> 8);
-		result[15] = (byte) (linetaddr & 0x00000000000000ffL);
+		result[10] = (byte)(linetaddr >>> 40);
+		result[11] = (byte)(linetaddr >>> 32);
+		result[12] = (byte)(linetaddr >>> 24);
+		result[13] = (byte)(linetaddr >>> 16);
+		result[14] = (byte)(linetaddr >>> 8);
+		result[15] = (byte)linetaddr;
 
 		return result;
 	}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java	Thu Sep 23 09:39:02 2004
@@ -157,7 +157,18 @@
 			*/
 			try
 			{
-				ps.execute(spsActivation, false, false, false);
+				ResultSet rs = ps.execute(spsActivation, false, false, false);
+                if( rs.returnsRows())
+                {
+                    // Fetch all the data to ensure that functions in the select list or values statement will
+                    // be evaluated and side effects will happen. Why else would the trigger action return
+                    // rows, but for side effects?
+                    // The result set was opened in ps.execute()
+                    while( rs.getNextRow() != null)
+                    {
+                    }
+                }
+                rs.close();
 			} 
 			catch (StandardException e)
 			{

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java	Thu Sep 23 09:39:02 2004
@@ -2218,7 +2218,7 @@
 
 		// For 2.0 beta we added the build number and the isBeta indication.
 		// (5 bytes from our first spare long)
-		daos.writeInt(jbmsVersion.getBuildNumber());
+		daos.writeInt(jbmsVersion.getBuildNumberAsInt());
 		byte flags = 0;
 		if (onDiskBeta) flags |= IS_BETA_FLAG;
 		daos.writeByte(flags);

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java	Thu Sep 23 09:39:02 2004
@@ -379,7 +379,7 @@
 			int major = Integer.valueOf(p.getProperty ("derby.locale.version.major")).intValue();
 			int minor = Integer.valueOf(p.getProperty ("derby.locale.version.minor")).intValue();
 			int maint = Integer.valueOf(p.getProperty ("derby.locale.version.maint")).intValue();
-			int build = Integer.valueOf(p.getProperty ("derby.locale.build.number")).intValue();
+			String build = p.getProperty ("derby.locale.build.number");
 
 			String lv = ProductVersionHolder.fullVersionString(major, minor, maint, false, build);
 
@@ -862,7 +862,7 @@
 			minor.intValue(),
 			0,
 			0,
-			build.intValue(),
+			build.toString(),
 			Boolean.FALSE);
 
 		ZipInfoProperties zip = new ZipInfoProperties(jccVersion);

Modified: incubator/derby/code/trunk/java/tools/org/apache/derby/tools/sysinfo.java
==============================================================================
--- incubator/derby/code/trunk/java/tools/org/apache/derby/tools/sysinfo.java	(original)
+++ incubator/derby/code/trunk/java/tools/org/apache/derby/tools/sysinfo.java	Thu Sep 23 09:39:02 2004
@@ -120,7 +120,7 @@
 		gets the build number for the IBM Cloudscape embedded library
 		@return the build number, or -1 if the information is not found.
 	*/
-  static public int getBuildNumber()
+  static public String getBuildNumber()
   {
     return getBuildNumber("DBMS");
   }
@@ -129,14 +129,14 @@
 		gets the build number for the specified library
 		@param genus which library to get the build number for. Valid inputs are
 			DBMS, TOOLS
-		@return the build number, or -1 if the information is not found.
+		@return the build number, or ???? if the information is not found.
 	*/
-  static public int getBuildNumber(String genus)
+  static public String getBuildNumber(String genus)
   {
         ProductVersionHolder pvh = ProductVersionHolder.getProductVersionHolderFromMyEnv(genus);
         if (pvh == null)
         {
-            return -1;
+            return "????";
         }
 
         return pvh.getBuildNumber();