Show build.xml syntax highlighted
<?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,client,build,versioninfo,localeinfo"/>
<target name="all" depends="buildsource,demo,testing"/>
<!-- ==================================================================== -->
<!-- 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"/>
<available file="${out.dir}/org/apache/derby/info/dnc.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>
<antcall target="infowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="Apache Derby Network Client"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/dnc.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"/>
<delete file="${out.dir}/org/apache/derby/info/dnc.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>
<!-- ==================================================================== -->
<!-- Locale info writer build target -->
<!-- ==================================================================== -->
<target name="buildlocaleinfo">
<antcall target="localeinfowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="_${locale.iname}"/>
<param name="info.ename" value="${locale.ename}"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/locale_${locale.iname}.properties"/>
</antcall>
</target>
<target name="localeinfowriter">
<propertyfile file="${info.file}" comment="${copyright.comment}">
<entry key="derby.locale.version.major" value="${major}"/>
<entry key="derby.locale.version.minor" value="${minor}"/>
<entry key="derby.locale.version.maint" value="${maint}"/>
<entry key="derby.locale.build.number" value="${info.buildnumber}"/>
<entry key="derby.locale.technology.name" value="${info.iname}"/>
<entry key="derby.locale.external.name" value="${info.ename}"/>
<entry key="derby.version.beta" value="${beta}"/>
<entry key="derby.locale.vendor" value="${vendor}"/>
<entry key="derby.product.file" value="${info.productfile}"/>
</propertyfile>
</target>
<!-- ==================================================================== -->
<!-- Build Locale info -->
<!-- ==================================================================== -->
<target name="localeinfo" depends="checklocaleinfo" unless="localeinfo.available">
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="de_DE"/>
<param name="locale.ename" value="German/Germany [de_DE]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="es"/>
<param name="locale.ename" value="Spanish/International [es]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="fr"/>
<param name="locale.ename" value="French/International [fr]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="it"/>
<param name="locale.ename" value="Italian/International [it]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="ja_JP"/>
<param name="locale.ename" value="Japanese/Japan [ja_JP]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="ko_KR"/>
<param name="locale.ename" value="Korean/Korea [ko_KR]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="pt_BR"/>
<param name="locale.ename" value="Portuguese/Brazil [pt_BR]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="zh_CN"/>
<param name="locale.ename" value="Simplified_Chinese/PR_China [zh_CN]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="zh_TW"/>
<param name="locale.ename" value="Chinese/Taiwan_Traditional [zh_TW]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
</target>
<target name="checklocaleinfo">
<condition property="localeinfo.available">
<and>
<available file="${out.dir}/org/apache/derby/info/locale_de_DE.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_es.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_fr.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_it.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_ja_JP.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_ko_KR.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_pt_BR.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_zh_CN.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_zh_TW.properties"/>
</and>
</condition>
</target>
<target name="cleanlocale">
<delete file="${out.dir}/org/apache/derby/info/locale_de_DE.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_es.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_fr.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_it.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_ja_JP.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_ko_KR.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_pt_BR.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_zh_CN.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_zh_TW.properties"/>
</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="engine_169_opt" depends="engine">
<ant dir="${derby.engine.src.dir}" target="engine_169_opt"/>
</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="client" depends="engine,init">
<ant dir="${derby.client.src.dir}"/>
</target>
<target name="build">
<ant dir="${derby.build.src.dir}"/>
</target>
<target name="demo">
<ant dir="${derby.demo.src.dir}"/>
</target>
<target name="testing" depends="demo">
<ant dir="${derby.testing.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="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="${javacc}"
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,TokenMgrError.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,CharStream.java,SimpleCharStream.java,TokenMgrError.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"/>
<arg value="java.util.Vector"/>
</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="${derby.engine.dir}/iapi/types/DataValueDescriptor.java"
targetfile="${out.dir}/org/apache/derby/iapi/types/DataValueDescriptor.class"/>
<uptodate srcfile="${derby.engine.dir}/impl/services/cache/CachedItem.java"
targetfile="${out.dir}/org/apache/derby/impl/services/cache/CachedItem.class"/>
<uptodate srcfile="${derby.engine.dir}/impl/store/raw/data/RecordId.java"
targetfile="${out.dir}/org/apache/derby/impl/store/raw/data/RecordId.class"/>
<uptodate srcfile="${derby.engine.dir}/iapi/store/raw/ContainerKey.java"
targetfile="${out.dir}/org/apache/derby/iapi/store/raw/ContainerKey.class"/>
<uptodate srcfile="${derby.engine.dir}/iapi/services/cache/SizedCacheable.java"
targetfile="${out.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.class"/>
<available file="${derby.engine.dir}/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="init,initjars,publishedapi,derbydocs,toolsdocs,grammardocs"/>
<target name="publishedapi">
<tstamp>
<format
property="javadoc.ts"
pattern="EEE yyyy-MM-dd HH:mm:ssZ"
locale="en, us"/>
</tstamp>
<property
name="javadoc.Footer"
value="Built on ${javadoc.ts}, from revision ${changenumber}"/>
<delete dir="${out.javadoc.dir}/publishedapi"/>
<delete dir="${out.javadoc.dir}/sourcedir"/>
<mkdir dir="${out.javadoc.dir}/publishedapi"/>
<mkdir dir="${out.javadoc.dir}/sourcedir"/>
<!-- drda files -->
<mkdir dir="${out.javadoc.dir}/sourcedir"/>
<copy todir="${out.javadoc.dir}/sourcedir">
<fileset dir="${derby.drda.src.dir}"
includesfile="${javadoctools.dir}/publishedapi.ant"/>
</copy>
<!-- engine files -->
<copy todir="${out.javadoc.dir}/sourcedir">
<fileset dir="${derby.engine.src.dir}"
includesfile="${javadoctools.dir}/publishedapi.ant"/>
</copy>
<!-- tools files -->
<copy todir="${out.javadoc.dir}/sourcedir">
<fileset dir="${derby.tools.src.dir}"
includesfile="${javadoctools.dir}/publishedapi.ant"/>
</copy>
<!-- client files -->
<copy todir="${out.javadoc.dir}/sourcedir">
<fileset dir="${derby.client.src.dir}"
includesfile="${javadoctools.dir}/publishedapi.ant"/>
</copy>
<javadoc sourcepath="${out.javadoc.dir}/sourcedir"
classpath="${compile.classpath};${osgi};${servlet24};${out.dir}"
breakiterator="true"
destdir="${out.javadoc.dir}/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"
Footer="${javadoc.Footer}"
bottom="Apache Derby ${major}.${minor} API Documentation - <i>Copyright &copy; 1997,2005 The Apache Software Foundation or its licensors, as applicable.</i>"/>
<delete dir="${out.javadoc.dir}/sourcedir"/>
</target>
<target name="derbydocs">
<delete dir="${out.javadoc.dir}/engine"/>
<mkdir dir="${out.javadoc.dir}/engine"/>
<javadoc
additionalparam="-J-mx320M"
packagenames="org.*"
access="private"
breakiterator="yes"
sourcepath="${derby.engine.src.dir};${derby.drda.src.dir};${derby.tools.src.dir}"
classpath="${basedir}/classes;${java14compile.classpath};${jars.extras};${osgi}"
destdir="${out.javadoc.dir}/engine"
windowtitle="Apache Derby V${major}.${minor} Engine Documentation"
doctitle="Apache Derby V${major}.${minor} Engine Documentation"
Footer="${javadoc.Footer}"
bottom="Apache Derby V${major}.${minor} Engine Documentation - <i>Copyright &copy; 1997,2005 The Apache Software Foundation or its licensors, as applicable.</i>"
source="1.4">
<taglet name="org.apache.derbyBuild.javadoc.FormatIdTaglet"
path="${basedir}/classes"/>
<taglet name="org.apache.derbyBuild.javadoc.PurposeTaglet"
path="${basedir}/classes"/>
<taglet name="org.apache.derbyBuild.javadoc.UpgradeTaglet"
path="${basedir}/classes"/>
<taglet name="org.apache.derbyBuild.javadoc.DiskLayoutTaglet"
path="${basedir}/classes"/>
<taglet name="org.apache.derbyBuild.javadoc.EndFormatTaglet"
path="${basedir}/classes"/>
</javadoc>
</target>
<target name="toolsdocs">
<delete dir="${out.javadoc.dir}/tools"/>
<mkdir dir="${out.javadoc.dir}/tools"/>
<antcall target="dojjdocs">
<param name="jjtodoc" value="${derby.tools.dir}/impl/tools/ij/ij.jj"/>
<param name="jjdoctarget" value="${out.javadoc.dir}/tools/ij.html"/>
</antcall>
</target>
<target name="grammardocs">
<delete dir="${out.javadoc.dir}/language"/>
<mkdir dir="${out.javadoc.dir}/language"/>
<antcall target="dojjdocs">
<param name="jjtodoc" value="${derby.engine.dir}/impl/sql/compile/sqlgrammar.jj"/>
<param name="jjdoctarget" value="${out.javadoc.dir}/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="cleandocs">
<delete dir="${out.javadoc.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Eclipse Plugin -->
<!-- =================================================================== -->
<target name="plugin" depends= "buildjars">
<echo message="Begining Derby Eclipse plugin build"/>
<property name="plugin.tmp.dir" value ="plugintmp"/>
<mkdir dir="${derby.jar.dir}/${plugin.tmp.dir}"/>
<java classname="org.apache.derbyBuild.eclipse.DerbyEclipsePlugin">
<arg value="${derby.jar.dir}/${plugin.tmp.dir}"/>
<classpath>
<pathelement path="${out.dir}"/>
</classpath>
</java>
<property file="${derby.jar.dir}/${plugin.tmp.dir}/plugintmp.properties"/>
<echo message="Derby Eclipse plugin build: ${plugin.derby.version.build.number}"/>
<property name="plugin.dir" value ="plugins"/>
<property name="plugin.core.dir" value ="${plugin.derby.core}_${plugin.derby.version}"/>
<mkdir dir="${derby.jar.dir}/${plugin.tmp.dir}/${plugin.dir}/${plugin.core.dir}"/>
<copy todir="${derby.jar.dir}/${plugin.tmp.dir}/${plugin.dir}/${plugin.core.dir}">
<fileset dir="${derby.jar.dir}" includes="derby*.jar" excludes="derbyTesting.jar,derbyLocale*.jar"/>
</copy>
<copy todir="${derby.jar.dir}/${plugin.tmp.dir}/${plugin.dir}/${plugin.core.dir}">
<fileset dir="${derby.jar.dir}/${plugin.tmp.dir}" includes="plugin*.xml"/>
</copy>
<delete file="${derby.jar.dir}/${plugin.tmp.dir}/plugintmp.properties"/>
<delete file="${derby.jar.dir}/${plugin.tmp.dir}/plugin.xml"/>
<!-- ZIP to create the final Derby plug-in -->
<zip zipfile="${derby.jar.dir}/${plugin.derby.core.zipfile}_${plugin.derby.version}.zip" compress="true" basedir="${derby.jar.dir}/${plugin.tmp.dir}"/>
<delete dir="${derby.jar.dir}/${plugin.tmp.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Jar targets -->
<!-- =================================================================== -->
<target name="buildjarsclean" depends="cleanjars,initjars,derbyjar,derbytoolsjar,derbynetjar,derbyclientjar,derbywar,derbylocalejars,derbytestingjar"/>
<target name="buildjars" depends="initjars,derbyjar,derbytoolsjar,derbynetjar,derbyclientjar,derbywar,derbylocalejars,derbytestingjar"/>
<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"/>
<!-- copy license file to lists dir for inclusion in derby.jar -->
<mkdir dir="${derby.jar.dir}/lists/META-INF"/>
<copy todir="${derby.jar.dir}/lists/META-INF">
<fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
</copy>
<!-- 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="META-INF/**,
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}.${changenumber}"/>
</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}.${changenumber}"/>
<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>
<!-- copy license file to lists dir for inclusion in derbytools.jar -->
<mkdir dir="${derby.jar.dir}/lists/META-INF"/>
<copy todir="${derby.jar.dir}/lists/META-INF">
<fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
</copy>
<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"/>
<fileset dir="${derby.jar.dir}/lists"
includes="META-INF/**"/>
</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>
<!-- copy license file to lists dir for inclusion in derbynet.jar -->
<mkdir dir="${derby.jar.dir}/lists/META-INF"/>
<copy todir="${derby.jar.dir}/lists/META-INF">
<fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
</copy>
<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"/>
<fileset dir="${derby.jar.dir}/lists"
includes="META-INF/**"/>
</jar>
</target>
<!-- - - - - - - - - - - - - - derbyclient.jar target - - - - - - - - -->
<target name="derbyclientjar" depends="setsanityname,initjars">
<echo message="Beginning derbyclient.jar ${sanity.name} build"/>
<echo message=" creating new dnc.properties file "/>
<mkdir dir="${out.dir}/org/apache/derby/info/"/>
<antcall target="infowriter">
<param name="info.buildnumber" value="${changenumber}"/>
<param name="info.iname" value="Apache Derby Network Client"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/dnc.properties"/>
</antcall>
<!-- copy license file to lists dir for inclusion in derbyclient.jar -->
<mkdir dir="${derby.jar.dir}/lists/META-INF"/>
<copy todir="${derby.jar.dir}/lists/META-INF">
<fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
</copy>
<delete file="${derby.jar.dir}/derbyclient.jar"/>
<jar destfile="${derby.jar.dir}/derbyclient.jar"
compress="true"
filesonly="true"
update="true">
<fileset dir="${out.dir}"
includes="org/apache/derby/client/**,
org/apache/derby/client/jdbc/Client**,org/apache/derby/jdbc/Client**,org/apache/derby/iapi/services/info/**
org/apache/derby/info/dnc.properties"/>
<fileset dir="${derby.jar.dir}/lists"
includes="META-INF/**"/>
</jar>
</target>
<!-- - - - - - - - - - - - - - derby.war target - - - - - - - - - - - -->
<target name="derbywar" depends="initjars">
<echo message="Beginning derby.war build"/>
<delete file="${derby.jar.dir}/derby.war"/>
<zip zipfile="${derby.jar.dir}/derby.war" compress="true" basedir="tools/j2ee/derby"/>
</target>
<!-- - - - - - - - - - - - - - locale jar targets - - - - - - - - - - - -->
<target name="derbylocalejars" depends="initjars">
<!-- copy license file to lists dir for inclusion in derbynet.jar -->
<mkdir dir="${derby.jar.dir}/lists/META-INF"/>
<copy todir="${derby.jar.dir}/lists/META-INF">
<fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
</copy>
<!-- call localejar for each locale -->
<antcall target="localejar">
<param name="locale.iname" value="de_DE"/>
<param name="locale.ename" value="German/Germany [de_DE]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="es"/>
<param name="locale.ename" value="Spanish/International [es]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="fr"/>
<param name="locale.ename" value="French/International [fr]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="it"/>
<param name="locale.ename" value="Italian/International [it]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="ja_JP"/>
<param name="locale.ename" value="Japanese/Japan [ja_JP]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="ko_KR"/>
<param name="locale.ename" value="Korean/Korea [ko_KR]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="pt_BR"/>
<param name="locale.ename" value="Portuguese/Brazil [pt_BR]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="zh_CN"/>
<param name="locale.ename" value="Simplified_Chinese/PR_China [zh_CN]"/>
</antcall>
<antcall target="localejar">
<param name="locale.iname" value="zh_TW"/>
<param name="locale.ename" value="Chinese/Taiwan_Traditional [zh_TW]"/>
</antcall>
</target>
<target name="localejar">
<echo message="Building derbyLocale_${locale.iname}.jar"/>
<!-- generate new locale property file -->
<antcall target="localeinfowriter">
<param name="info.buildnumber" value="${changenumber}"/>
<param name="info.iname" value="_${locale.iname}"/>
<param name="info.ename" value="${locale.ename}"/>
<param name="info.productfile" value="derbyLocale_${locale.iname}.jar"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/locale_${locale.iname}.properties"/>
</antcall>
<jar destfile="${derby.jar.dir}/derbyLocale_${locale.iname}.jar"
compress="true"
filesonly="true">
<fileset dir="${out.dir}"
includes="org/apache/derby/info/*_${locale.iname}.properties,
org/apache/derby/loc/*_${locale.iname}.properties,
org/apache/derby/loc/drda/*_${locale.iname}.properties"/>
<fileset dir="${derby.jar.dir}/lists"
includes="META-INF/**"/>
</jar>
</target>
<!-- - - - - - - - - - - - derby testing jar target - - - - - - - - - - -->
<target name="derbytestingjar" depends="initjars,ckderbytesting" if="derbyTesting.available">
<zip destfile="${derby.jar.dir}/derbyTesting.jar" filesonly="true" compress="true">
<fileset dir="${out.dir}" includes="org/apache/derbyTesting/**,SimpleApp*,org/apache/derby/impl/tools/ij/mt*.class,org/apache/derby/impl/tools/ij/SimpleCharStream.class,org/apache/derby/impl/drda/TestProto.class,org/apache/derby/iapi/services/diag/DiagnosticUtil.class,org/apache/derby/iapi/services/diag/Diagnosticable.class,org/apache/derby/iapi/services/diag/DiagnosticableGeneric.class,org/apache/derby/impl/store/access/conglomerate/QualifierUtil.class,org/apache/derby/loc/m*_qq_PP_testOnly*"/>
</zip>
</target>
<target name="ckderbytesting">
<available file="${out.dir}/org/apache/derbyTesting"
property="derbyTesting.available"/>
</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="all"/>
<antcall target="buildjars"/>
<!-- Build sane product jars -->
<antcall target="clobber"/>
<antcall target="sane"/>
<antcall target="all"/>
<antcall target="buildjars"/>
<!-- Build everything else -->
<antcall target="javadoc"/>
</target>
<target name="gump_split_1" depends="insane,init,state,parsers">
<ant dir="${derby.engine.src.dir}" target="engine_169"/>
<ant dir="${derby.engine.dir}/iapi" target="compile_iapi_error"/>
<ant dir="${derby.engine.dir}/iapi/jdbc" target="compile_iapi_jdbc_jsr169"/>
<ant dir="${derby.engine.dir}/iapi/jdbc" target="compile_iapi_jdbc_stmt"/>
</target>
<target name="gump_split_2">
<ant dir="${derby.engine.dir}/iapi/jdbc" target="compile_iapi_jdbc_jdbc2"/>
</target>
<target name="gump_split_3">
<ant dir="${derby.engine.dir}/iapi" target="compile_iapi_jdbc"/>
<ant dir="${derby.engine.dir}/impl" target="compile"/>
<ant dir="${derby.engine.dir}/impl/jdbc" target="compile_jsr169"/>
</target>
<target name="gump_split_4">
<ant dir="${derby.engine.dir}/impl/jdbc" target="compile_jdbc2"/>
</target>
<target name="gump_split_5">
<ant dir="${derby.engine.dir}/impl"/>
<ant dir="${derby.engine.dir}/jdbc" target="compile_jsr169"/>
</target>
<target name="gump_split_6">
<ant dir="${derby.engine.dir}/jdbc" target="compile_jdbc2"/>
</target>
<target name="gump_split_7" depends="all,buildjars,javadoc"/>
<target name="snapshot" depends="clobber,snapshotError,init,initjars">
<antcall target="insane"/>
<antcall target="all"/>
<antcall target="buildjars"/>
<antcall target="plugin"/>
<antcall target="publishedapi"/>
<mkdir dir="${basedir}/snapshot"/>
<zip destfile="${basedir}/snapshot/incubating-derby-snapshot-${major}.${minor}-${changenumber}.zip">
<fileset dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
<fileset dir="${basedir}" includes="COPYRIGHT,LICENSE,NOTICE,README,frameworks/**,javadoc/publishedapi/**"/>
<fileset dir="${basedir}/java" includes="demo/**"/>
</zip>
<tar destfile="${basedir}/snapshot/incubating-derby-snapshot-${major}.${minor}-${changenumber}.tar.gz"
compression="gzip">
<tarfileset dir="${basedir}/jars/insane" includes="*.jar,*.war"/>
<tarfileset dir="${basedir}" includes="COPYRIGHT,LICENSE,NOTICE,README,frameworks/**,javadoc/publishedapi/**"/>
<tarfileset dir="${basedir}/java" includes="demo/**"/>
</tar>
<copy file="${basedir}/jars/insane/derby_core_plugin_${major}.${minor}.0.zip"
tofile="${basedir}/snapshot/derby_core_plugin_${major}.${minor}.0.${changenumber}.zip"/>
</target>
<target name="snapshotError" if="is.sane">
<echo message="Please generate the snapshot using an insane build."/>
<echo message="Either run "ant -Dsane=false snapshot", or run"/>
<echo message="the insane target before running the snapshot target."/>
<echo message=""/>
<fail message="Exiting snapshot build..."/>
</target>
</project>
See more files for this project here