<project default="extractAndJar" basedir=".">
<!-- top-level -->
- <target name="extractAndJar" depends="extract,jar" />
+ <target name="extractAndJar" depends="extract,jar,srcjar" />
<target name="extract" depends="unzipSource,createPatchedSource" />
<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="diff" depends="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"/>
- <arg line="-a"/>
- <arg line="-u"/>
- <arg line="-r"/>
- <arg line="-b"/>
+ <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>
<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>
diff -N -a -u -r -b bcel-5.1/build.xml bcel/build.xml
---- bcel-5.1/build.xml 2003-04-25 09:06:14.000000000 -0700
-+++ bcel/build.xml 2004-01-29 04:37:15.593750000 -0800
+--- bcel-5.1/build.xml 2003-04-25 09:06:14.000000000 +0100
++++ bcel/build.xml 2004-05-24 14:05:28.265625000 +0100
@@ -65,7 +65,7 @@
<target name="build" depends="compile"/>
basedir="${build.dest}"
manifest="${basedir}/manifest.txt"
diff -N -a -u -r -b bcel-5.1/manifest.txt bcel/manifest.txt
---- bcel-5.1/manifest.txt 1969-12-31 16:00:00.000000000 -0800
-+++ bcel/manifest.txt 2004-01-29 04:37:15.609375000 -0800
+--- bcel-5.1/manifest.txt 1970-01-01 00:00:00.000000000 +0000
++++ bcel/manifest.txt 2004-05-24 14:05:28.328125000 +0100
@@ -0,0 +1,3 @@
+Created-By: Jakarta BCEL 5.1
+Manifest-Version: 1.0
+Main-Class: listclass
diff -N -a -u -r -b bcel-5.1/src/java/org/apache/bcel/generic/Instruction.java bcel/src/java/org/apache/bcel/generic/Instruction.java
---- bcel-5.1/src/java/org/apache/bcel/generic/Instruction.java 2003-04-25 09:06:16.000000000 -0700
-+++ bcel/src/java/org/apache/bcel/generic/Instruction.java 2004-01-29 04:37:15.640625000 -0800
+--- bcel-5.1/src/java/org/apache/bcel/generic/Instruction.java 2003-04-25 09:06:16.000000000 +0100
++++ bcel/src/java/org/apache/bcel/generic/Instruction.java 2004-05-24 14:38:31.062500000 +0100
@@ -190,26 +190,223 @@
Class clazz;
return obj;
}
+diff -N -a -u -r -b bcel-5.1/src/java/org/apache/bcel/generic/LDC_W.java bcel/src/java/org/apache/bcel/generic/LDC_W.java
+--- bcel-5.1/src/java/org/apache/bcel/generic/LDC_W.java 2003-04-25 09:06:16.000000000 +0100
++++ bcel/src/java/org/apache/bcel/generic/LDC_W.java 2004-05-24 14:38:31.359375000 +0100
+@@ -83,6 +83,6 @@
+ {
+ setIndex(bytes.readUnsignedShort());
+ // Override just in case it has been changed
+- opcode = org.apache.bcel.Constants.LDC_W;
++ // opcode = org.apache.bcel.Constants.LDC_W;
+ }
+ }
diff -N -a -u -r -b bcel-5.1/src/java/org/apache/bcel/generic/MethodGen.java bcel/src/java/org/apache/bcel/generic/MethodGen.java
---- bcel-5.1/src/java/org/apache/bcel/generic/MethodGen.java 2003-04-25 09:06:16.000000000 -0700
-+++ bcel/src/java/org/apache/bcel/generic/MethodGen.java 2004-01-29 04:39:47.265625000 -0800
+--- bcel-5.1/src/java/org/apache/bcel/generic/MethodGen.java 2003-04-25 09:06:16.000000000 +0100
++++ bcel/src/java/org/apache/bcel/generic/MethodGen.java 2004-05-24 14:38:30.343750000 +0100
@@ -133,9 +133,9 @@
/* Add local variables, namely the implicit `this' and the arguments
<p> There are five top-level ant targets apart from the usual "clean":</p>
<ul>
- <li>ant extractAndJar -- this is just the composition of the extract
- and jar targets, and is the default. It extracts the source from bcel-5.1-src.zip,
- patches it, compiles the patched version into a jar and drops the new jar,
- bcel.jar, into the project root. This is the default task, mainly used
+ <li>ant extractAndJar -- this is just the composition of the extract,
+ jar and srcjar targets, and is the default. It extracts the source from bcel-5.1-src.zip,
+ patches it, compiles the patched version into a jar and drops the new archives:
+ bcel.jar and bcel-src.zip, into the project root. This is the default task, mainly used
to sanity check the building and make sure we're generating something.
- The bcel.jar this generates should be the same as that in ..\lib\bcel\bcel.jar.
+ The bcel.jar and bcel-src.zip generated should be the same as that in ..\lib\bcel\.
</li>
<li>ant extract -- this extracts the source from bcel-5.1-src.zip,
patches it, and copies the patched source into the project src directory,
there to be visible by eclipse for people to do development on it.
+ For the patch file to be applied you need to have a patch.exe on your path,
+ this bcel building process was tested with the version from cygwin.
</li>
<li>ant jar -- this copies the edited source from the project source
directory and jars it up into bcel.jar, there to be tested.
</li>
- <li>ant push -- this pushes the new bcel.jar into ..\lib\bcel\bcel.jar,
- ready to be used by the greater compiler.</li>
+ <li>ant srcjar -- this copies the edited source from the project source
+ directory and jars up the source code into bcel-src.zip.
+ </li>
+
+ <li>ant push -- this pushes the new bcel.jar and bcel-src.zip into ..\lib\bcel\.
+ - ready to be used by the greater compiler.</li>
<li>ant diff -- this creates the patch.txt file, composed of the differences
- between the project src directory and the original bcel-5.1 source. </li>
+ between the project src directory and the original bcel-5.1 source.
+ For the patch file to be built successfully you need to have a diff.exe on your path,
+ this bcel building process was tested with the version from cygwin.
+ </li>
</ul>
<p> All of the tasks are destructive, so don't do "ant extract", for example,