123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <project name="bcel-builder" default="packageAndPush" basedir=".">
-
- <!-- *********************************************************************** -->
- <!-- compliance for Alex build -->
- <!-- *********************************************************************** -->
- <import file="../build/build-common.xml"/>
-
- <path id="bcel-builder.test.src.path">
- <fileset dir="${basedir}/../lib">
- <include name="junit/*.jar"/>
- </fileset>
- <path refid="bcel-builder.src.path"/>
- </path>
-
- <path id="bcel-builder.src.path">
- <fileset dir="${basedir}/../lib">
- <include name="regexp/*.jar"/>
- </fileset>
- </path>
-
- <target name="cleanall" depends="clean">
- <delete dir="bin"/>
- <!-- FIXME: not consistent with Alex policy -->
- <mkdir dir="bin"/>
- </target>
-
- <target name="compile" depends="init">
- <srccompile project="bcel-builder" path="bcel-builder.src.path"/>
- </target>
-
- <target name="test:compile" depends="compile">
- <testcompile project="bcel-builder" path="bcel-builder.test.src.path"/>
- </target>
-
- <target name="test" depends="test:compile">
- <testrun project="bcel-builder" path="bcel-builder.test.src.path" suite="org.aspectj.apache.bcel.classfile.tests.AllTests"/>
- </target>
- <!-- *********************************************************************** -->
-
-
-
- <!-- top-level -->
- <target name="extractAndPatchAndJar" depends="extractAndPatch,jar,srcjar" />
-
- <target name="extractAndPatch" depends="unzipSource,createPatchedSource" />
-
- <target name="packageAndPush" depends="buildTheJars,push"/>
-
- <target name="jar" depends="pack">
- <!-- FIXME av -->
- <!-- <copy file="../lib/regexp/jakarta-regexp-1.2.jar"-->
- <!-- tofile="bcel/lib/Regex.jar" />-->
- <!-- <ant dir="bcel" target="jar" />-->
- <!-- <copy file="bcel/bin/bcel.jar" toDir="." />-->
- </target>
-
- <target name="srcjar" depends="pack">
- <zip basedir="bcel" destfile="bcel-src.zip" includes="*/**" excludes="bin/**,lib/**"/>
- </target>
-
- <target name="push">
- <copy file="bcel.jar" todir="../lib/bcel" />
- <copy file="bcel-src.zip" todir="../lib/bcel" />
- </target>
-
- <target name="buildTheJars">
- <zip file="bcel.jar" basedir="bin" includes="**/*" excludes="**/tests/*.class"/>
- <zip file="bcel-src.zip" basedir="src" includes="**/*"/>
- </target>
-
- <target name="diff" depends="transformFromAJ,pack">
-
- <!-- Wipe out some of the rubbish that can arise due to doing a 'ant jar' before doing the diff -->
- <delete dir="bcel/bin"/>
- <delete dir="bcel/lib"/>
-
- <exec dir="." executable="diff.exe" output="patch.txt">
- <arg line="-N"/> <!-- Treat absent files as empty -->
- <arg line="-a"/> <!-- Treat all files as text -->
- <arg line="-u"/> <!-- Output (default 3) lines of unified context -->
- <arg line="-r"/> <!-- Recursively compare any subdirectories found -->
- <arg line="-b"/> <!-- Ignore changes in the amount of white space -->
- <arg line="bcel-5.1" />
- <arg line="bcel" />
- </exec>
- </target>
-
- <target name="clean">
- <delete dir="bcel-5.1" />
- <delete dir="bcel" />
- <delete file="bcel.jar" />
- <delete file="bcel-src.zip" />
- <!--delete dir="src" /-->
- <mkdir dir="src" /> <!-- empty src dir -->
- </target>
-
- <!-- internals -->
-
- <target name="unzipSource">
- <delete dir="bcel-5.1" />
- <unzip src="bcel-5.1-src.zip" dest="." />
- </target>
-
- <target name="createPatchedSource" depends="patch,unpack,transformToAJ" />
-
- <target name="patch">
- <delete dir="bcel" />
- <copy todir="bcel">
- <fileset dir="bcel-5.1" />
- </copy>
- <patch patchfile="patch.txt" strip="1" dir="bcel" />
- </target>
-
- <target name="pack">
- <delete dir="bcel/src/java" />
- <copy toDir="bcel/src/java">
- <fileset dir="src" />
- </copy>
- </target>
-
- <target name="unpack">
- <delete dir="src" />
- <copy toDir="src">
- <fileset dir="bcel/src/java" >
- </fileset>
- </copy>
- </target>
-
- <target name="transformFromAJ">
- <delete dir="src-temp" />
-
- <echo message="Copying 'src' to 'src-temp' and modifying file names to remove aspectj"/>
-
- <copy toDir="src-temp">
- <fileset dir="src"/>
- <mapper type="regexp" from="^(.*)aspectj\\apache(.*)$" to="\1apache\2"/>
- </copy>
-
- <delete dir="src"/>
-
- <echo message="Modifying file contents to change refs from 'org.aspectj.apache.bcel' to 'org.apache.bcel'"/>
- <replaceregexp byline="true" flags="g">
- <regexp pattern="org.aspectj.apache.bcel"/>
- <substitution expression="org.apache.bcel"/>
- <fileset dir="src-temp">
- <include name="**/*"/>
- </fileset>
- </replaceregexp>
-
- <echo message="Copying from 'src-temp' back to 'src'"/>
- <copy toDir="src">
- <fileset dir="src-temp"/>
- </copy>
- <delete dir="src-temp"/>
- </target>
-
- <target name="transformToAJ">
- <delete dir="src-temp" />
-
- <echo message="Copying 'src' to 'src-temp' and modifying file names to include aspectj"/>
-
- <copy toDir="src-temp">
- <fileset dir="src"/>
- <mapper type="regexp" from="^(.*)apache(.*)$" to="\1aspectj\\apache\2"/>
- </copy>
-
- <delete dir="src"/>
-
- <echo message="Modifying file contents to change refs from 'org.apache.bcel' to 'org.aspectj.apache.bcel'"/>
- <replaceregexp byline="true" flags="g">
- <regexp pattern="org.apache.bcel"/>
- <substitution expression="org.aspectj.apache.bcel"/>
- <fileset dir="src-temp">
- <include name="**/*"/>
- </fileset>
- </replaceregexp>
-
- <echo message="Copying from 'src-temp' back to 'src'"/>
- <copy toDir="src">
- <fileset dir="src-temp"/>
- </copy>
- <delete dir="src-temp"/>
- </target>
-
- </project>
|