summaryrefslogtreecommitdiffstats
path: root/bcel-builder
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-12 07:57:44 +0000
committeraclement <aclement>2004-08-12 07:57:44 +0000
commit228fc8df0081ca7ac06eb6c1a6dc43b06ee3f17d (patch)
tree3a1607c11a3db9ff0358c55146d3190dbd7a4121 /bcel-builder
parent95995e13ff3038491d5f11ec67d51ca2bda83e29 (diff)
downloadaspectj-228fc8df0081ca7ac06eb6c1a6dc43b06ee3f17d.tar.gz
aspectj-228fc8df0081ca7ac06eb6c1a6dc43b06ee3f17d.zip
BCEL rename (enhancement 61374)
Diffstat (limited to 'bcel-builder')
-rw-r--r--bcel-builder/build.xml69
-rw-r--r--bcel-builder/patch.txt10
-rw-r--r--bcel-builder/readme.html24
3 files changed, 88 insertions, 15 deletions
diff --git a/bcel-builder/build.xml b/bcel-builder/build.xml
index 998ee5f75..102eb316d 100644
--- a/bcel-builder/build.xml
+++ b/bcel-builder/build.xml
@@ -1,9 +1,9 @@
-<project default="extractAndJar" basedir=".">
+<project default="extractAndPatchAndJar" basedir=".">
<!-- top-level -->
- <target name="extractAndJar" depends="extract,jar,srcjar" />
+ <target name="extractAndPatchAndJar" depends="extractAndPatch,jar,srcjar" />
- <target name="extract" depends="unzipSource,createPatchedSource" />
+ <target name="extractAndPatch" depends="unzipSource,createPatchedSource" />
<target name="jar" depends="pack">
<copy file="../lib/regexp/jakarta-regexp-1.2.jar"
@@ -21,7 +21,7 @@
<copy file="bcel-src.zip" todir="../lib/bcel" />
</target>
- <target name="diff" depends="pack">
+ <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"/>
@@ -54,7 +54,7 @@
<unzip src="bcel-5.1-src.zip" dest="." />
</target>
- <target name="createPatchedSource" depends="patch,unpack" />
+ <target name="createPatchedSource" depends="patch,unpack,transformToAJ" />
<target name="patch">
<delete dir="bcel" />
@@ -74,8 +74,65 @@
<target name="unpack">
<delete dir="src" />
<copy toDir="src">
- <fileset dir="bcel/src/java" />
+ <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>
diff --git a/bcel-builder/patch.txt b/bcel-builder/patch.txt
index 9f07195a7..63ff8b5de 100644
--- a/bcel-builder/patch.txt
+++ b/bcel-builder/patch.txt
@@ -1,6 +1,6 @@
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 +0100
-+++ bcel/build.xml 2004-05-24 14:05:28.265625000 +0100
++++ bcel/build.xml 2004-08-11 21:25:17.449281600 +0100
@@ -65,7 +65,7 @@
<target name="build" depends="compile"/>
@@ -12,14 +12,14 @@ diff -N -a -u -r -b bcel-5.1/build.xml bcel/build.xml
manifest="${basedir}/manifest.txt"
diff -N -a -u -r -b bcel-5.1/manifest.txt bcel/manifest.txt
--- bcel-5.1/manifest.txt 1970-01-01 00:00:00.000000000 +0000
-+++ bcel/manifest.txt 2004-05-24 14:05:28.328125000 +0100
++++ bcel/manifest.txt 2004-08-11 21:25:17.509368000 +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 +0100
-+++ bcel/src/java/org/apache/bcel/generic/Instruction.java 2004-05-24 14:38:31.062500000 +0100
++++ bcel/src/java/org/apache/bcel/generic/Instruction.java 2004-08-11 21:28:49.424086400 +0100
@@ -190,26 +190,223 @@
Class clazz;
@@ -258,7 +258,7 @@ diff -N -a -u -r -b bcel-5.1/src/java/org/apache/bcel/generic/Instruction.java b
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
++++ bcel/src/java/org/apache/bcel/generic/LDC_W.java 2004-08-11 21:28:47.160832000 +0100
@@ -83,6 +83,6 @@
{
setIndex(bytes.readUnsignedShort());
@@ -269,7 +269,7 @@ diff -N -a -u -r -b bcel-5.1/src/java/org/apache/bcel/generic/LDC_W.java bcel/sr
}
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 +0100
-+++ bcel/src/java/org/apache/bcel/generic/MethodGen.java 2004-05-24 14:38:30.343750000 +0100
++++ bcel/src/java/org/apache/bcel/generic/MethodGen.java 2004-08-11 21:28:47.641523200 +0100
@@ -133,9 +133,9 @@
/* Add local variables, namely the implicit `this' and the arguments
diff --git a/bcel-builder/readme.html b/bcel-builder/readme.html
index 27d75c0f2..734be723e 100644
--- a/bcel-builder/readme.html
+++ b/bcel-builder/readme.html
@@ -29,21 +29,26 @@ appropriate bcel.jar file. Now put it in the appropriate place. </p>
project, well, then you've got some development to do. You'll need
to know some more ant targets. But before anything, get that
<strong>bcel-5.1-src.zip</strong> and stick it in this directory.
+<b>NOTE: You should be working on BCEL when the package names are org.aspectj.apache.bcel,
+and *not* when the package names are org.apache.bcel. If you run the extractAndPatch task
+below, you will be left with a src folder in the correct state for further development.</b>
</p>
<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,
+ <li>ant extractAndPatchAndJar -- 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:
+ patches it, renames the files to start org.aspectj.apache rather than org.apache then
+ 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 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,
+ <li>ant extractAndPatch -- this extracts the source from bcel-5.1-src.zip,
+ patches it, renames the files to start org.aspectj.apache rather than org.apache then
+ 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.
@@ -62,9 +67,20 @@ to know some more ant targets. But before anything, get that
<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.
+ In order to create the patch, we transform the packages back to org.apache from
+ org.aspectj.apache. To continue working on BCEL once you have done this, you might
+ need to run the transformToAJ task to switch the packages back to the AJ prefix.
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>
+
+ <li>ant transformToAJ - this changes the packages for the BCEL classes to
+ org.aspectj.apache from org.apache. This is used by the extractAndPatch task above.
+ </li>
+
+ <li>ant transformFromAJ - this changes the packages for the BCEL classes to
+ org.apache from org.aspectj.apache. This is used by the diff task.
+ </li>
</ul>
<p> All of the tasks are destructive, so don't do "ant extract", for example,