<project name="embed" default="main" basedir="."> <description>Embed proposal</description> <property file="${user.home}/build.properties" /> <property name="base.path" location="/usr/share/java"/> <property name="ant.src" location="../.."/> <property name="commons.src" location="${ant.src}/../jakarta-commons"/> <property name="sandbox.src" location="${ant.src}/../jakarta-commons-sandbox"/> <property name="embed.build" location="build"/> <property name="debug" value="true"/> <!-- Those 2 should be moved to JXPath and velocity. --> <property name="commons-logging.jar" location="${commons.src}/logging/dist/commons-logging.jar" /> <property name="jxpath.jar" location="${commons.src}/jxpath/dist/commons-jxpath.jar" /> <property name="velocity.jar" location="${base.path}/velocity/velocity-20020220.jar" /> <property name="velocity-dep.jar" location="${base.path}/velocity/velocity-dep-20020220.jar" /> <property name="jexl.jar" location="${sandbox.src}/jexl/dist/commons-jexl.jar" /> <property name="commons-discovery.jar" location="${commons.src}/discovery/dist/commons-discovery.jar" /> <target name="build" depends="main" /> <target name="main"> <mkdir dir="${ant.home}/lib"/> <mkdir dir="build/classes" /> <javac srcdir="src/java" debug="${debug}" destdir="${embed.build}/classes" > <include name="**" /> <exclude name="org/apache/tools/ant/taskdefs/optional/**" /> </javac> <copy toDir="${embed.build}/classes"> <fileset dir="src/java" includes="META-INF/**" /> </copy> <jar file="${embed.build}/ant-sax2.jar" basedir="${embed.build}/classes"> <include name="**" /> </jar> <echo message="${embed.build}/ant-sax2.jar toDir=${ant.home}/lib"/> <copy file="${embed.build}/ant-sax2.jar" toDir="${ant.home}/lib"/> <copy file="${commons-logging.jar}" toDir="${ant.home}/lib"/> <copy file="${commons-discovery.jar}" toDir="${ant.home}/lib"/> <copy file="${commons-logging.jar}" toDir="${embed.build}"/> <copy file="${commons-discovery.jar}" toDir="${embed.build}"/> </target> <target name="embed-optional"> <mkdir dir="${ant.home}/lib"/> <mkdir dir="build/classes" /> <javac srcdir="src/java" debug="${debug}" destdir="${embed.build}/classes" > <include name="org/apache/tools/ant/taskdefs/optional/**" /> <classpath> <!-- all this will move to their package --> <pathelement location="build/classes" /> <pathelement location="${jxpath.jar}" /> <pathelement location="${velocity.jar}" /> <pathelement location="${jexl.jar}" /> <pathelement location="${commons-discovery.jar}" /> </classpath> </javac> <copy toDir="${embed.build}/classes"> <fileset dir="src/java" includes="META-INF/**" /> </copy> <jar file="${embed.build}/optional-dynprop.jar" basedir="${embed.build}/classes"> <include name="org/apache/tools/ant/taskdefs/optional/**" /> </jar> <echo message="${embed.build}/ant-sax2.jar toDir=${ant.home}/lib"/> <copy file="${embed.build}/ant-sax2.jar" toDir="${ant.home}/lib"/> <copy file="${commons-logging.jar}" toDir="${ant.home}/lib"/> <copy file="${commons-discovery.jar}" toDir="${ant.home}/lib"/> <copy file="${commons-logging.jar}" toDir="${embed.build}"/> <copy file="${commons-discovery.jar}" toDir="${embed.build}"/> </target> <target name="gump" description="Patch gump bootstrap ant" depends="main" > <!-- What we'll do - in order to get around gump classpath use - is to recreate ant.jar ( using build/classes ) to include our code --> <unjar jar="${ant.src}/bootstrap/lib/ant.jar" dest="${embed.build}/classes" /> <delete file="${ant.src}/bootstrap/lib/ant.jar" /> <jar file="${ant.src}/bootstrap/lib/ant.jar" basedir="${embed.build}/classes"/> </target> <target name="install" description="Installs built jars"> <echo message="${embed.build}/ant-sax2.jar toDir=${ant.home}/lib"/> <copy file="${embed.build}/ant-sax2.jar" toDir="${ant.home}/lib"/> </target> <target name="install-embed" depends="main, install" description="Installs core built jars"/> <target name="install-embed-optional" depends="embed-optional, install" description="Installs extra built jars"> <copy file="${commons-logging.jar}" toDir="${ant.home}/lib"/> <copy file="${commons-discovery.jar}" toDir="${ant.home}/lib"/> </target> </project>