You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <project name="bcel-builder" default="packageAndPush" basedir=".">
  2. <!-- *********************************************************************** -->
  3. <!-- compliance for Alex build -->
  4. <!-- *********************************************************************** -->
  5. <!--<import file="../build/build-common.xml"/>-->
  6. <path id="bcel-builder.test.src.path">
  7. <fileset dir="${basedir}/../lib">
  8. <include name="junit/*.jar"/>
  9. </fileset>
  10. <path refid="bcel-builder.src.path"/>
  11. </path>
  12. <path id="bcel-builder.src.path">
  13. <fileset dir="${basedir}/../lib">
  14. <include name="regexp/*.jar"/>
  15. </fileset>
  16. </path>
  17. <target name="cleanall" depends="clean">
  18. <delete dir="bin"/>
  19. <delete dir="bintest"/>
  20. <!-- FIXME: not consistent with Alex policy -->
  21. <mkdir dir="bin"/>
  22. </target>
  23. <target name="init"/>
  24. <target name="compile" depends="init">
  25. <srccompile project="bcel-builder" path="bcel-builder.src.path"/>
  26. </target>
  27. <target name="test:compile" depends="compile">
  28. <testcompile project="bcel-builder" path="bcel-builder.test.src.path"/>
  29. </target>
  30. <target name="test" depends="test:compile">
  31. <testrun project="bcel-builder" path="bcel-builder.test.src.path" suite="org.aspectj.apache.bcel.classfile.tests.AllTests"/>
  32. </target>
  33. <!-- *********************************************************************** -->
  34. <!-- top-level -->
  35. <target name="extractAndPatchAndJar" depends="extractAndPatch,jar,srcjar" />
  36. <target name="extractAndPatch" depends="unzipSource,createPatchedSource" />
  37. <target name="packageAndPush" depends="buildTheJars,push"/>
  38. <target name="jar" depends="pack">
  39. <!-- FIXME AV: someone fix this target since it is broken... looks for bcel/build.xml that does not exist -->
  40. <!-- <copy file="../lib/regexp/jakarta-regexp-1.2.jar"-->
  41. <!-- tofile="bcel/lib/Regex.jar" />-->
  42. <!-- <ant dir="bcel" target="jar" />-->
  43. <!-- <copy file="bcel/bin/bcel.jar" toDir="." />-->
  44. </target>
  45. <target name="srcjar" depends="pack">
  46. <zip basedir="bcel" destfile="bcel-src.zip" includes="*/**" excludes="bin/**,lib/**"/>
  47. </target>
  48. <target name="push">
  49. <copy file="bcel.jar" todir="../lib/bcel" />
  50. <copy file="bcel-src.zip" todir="../lib/bcel" />
  51. <delete file="bcel.jar"/>
  52. <delete file="bcel-src.zip"/>
  53. </target>
  54. <target name="buildTheJars">
  55. <zip file="bcel.jar" basedir="bin" includes="**/*" excludes="**/tests/*.class"/>
  56. <zip file="bcel-src.zip" basedir="src" includes="**/*"/>
  57. </target>
  58. <target name="diff" depends="transformFromAJ,pack">
  59. <!-- Wipe out some of the rubbish that can arise due to doing a 'ant jar' before doing the diff -->
  60. <delete dir="bcel/bin"/>
  61. <delete dir="bcel/lib"/>
  62. <exec dir="." executable="diff.exe" output="patch.txt">
  63. <arg line="-N"/> <!-- Treat absent files as empty -->
  64. <arg line="-a"/> <!-- Treat all files as text -->
  65. <arg line="-u"/> <!-- Output (default 3) lines of unified context -->
  66. <arg line="-r"/> <!-- Recursively compare any subdirectories found -->
  67. <arg line="-b"/> <!-- Ignore changes in the amount of white space -->
  68. <arg line="bcel-5.1" />
  69. <arg line="bcel" />
  70. </exec>
  71. </target>
  72. <target name="clean">
  73. <delete dir="bcel-5.1" />
  74. <delete dir="bcel" />
  75. <delete file="bcel.jar" />
  76. <delete file="bcel-src.zip" />
  77. <!--delete dir="src" /-->
  78. <mkdir dir="src" /> <!-- empty src dir -->
  79. </target>
  80. <!-- internals -->
  81. <target name="unzipSource">
  82. <delete dir="bcel-5.1" />
  83. <unzip src="bcel-5.1-src.zip" dest="." />
  84. </target>
  85. <target name="createPatchedSource" depends="patch,unpack,transformToAJ" />
  86. <target name="patch">
  87. <delete dir="bcel" />
  88. <copy todir="bcel">
  89. <fileset dir="bcel-5.1" />
  90. </copy>
  91. <patch patchfile="patch.txt" strip="1" dir="bcel" />
  92. </target>
  93. <target name="pack">
  94. <delete dir="bcel/src/java" />
  95. <copy toDir="bcel/src/java">
  96. <fileset dir="src" />
  97. </copy>
  98. </target>
  99. <target name="unpack">
  100. <delete dir="src" />
  101. <copy toDir="src">
  102. <fileset dir="bcel/src/java" >
  103. </fileset>
  104. </copy>
  105. </target>
  106. <target name="transformFromAJ">
  107. <delete dir="src-temp" />
  108. <echo message="Copying 'src' to 'src-temp' and modifying file names to remove aspectj"/>
  109. <copy toDir="src-temp">
  110. <fileset dir="src"/>
  111. <mapper type="regexp" from="^(.*)aspectj\\apache(.*)$" to="\1apache\2"/>
  112. </copy>
  113. <delete dir="src"/>
  114. <echo message="Modifying file contents to change refs from 'org.aspectj.apache.bcel' to 'org.apache.bcel'"/>
  115. <replaceregexp byline="true" flags="g">
  116. <regexp pattern="org.aspectj.apache.bcel"/>
  117. <substitution expression="org.apache.bcel"/>
  118. <fileset dir="src-temp">
  119. <include name="**/*"/>
  120. </fileset>
  121. </replaceregexp>
  122. <echo message="Copying from 'src-temp' back to 'src'"/>
  123. <copy toDir="src">
  124. <fileset dir="src-temp"/>
  125. </copy>
  126. <delete dir="src-temp"/>
  127. </target>
  128. <target name="transformToAJ">
  129. <delete dir="src-temp" />
  130. <echo message="Copying 'src' to 'src-temp' and modifying file names to include aspectj"/>
  131. <copy toDir="src-temp">
  132. <fileset dir="src"/>
  133. <mapper type="regexp" from="^(.*)apache(.*)$" to="\1aspectj\\apache\2"/>
  134. </copy>
  135. <delete dir="src"/>
  136. <echo message="Modifying file contents to change refs from 'org.apache.bcel' to 'org.aspectj.apache.bcel'"/>
  137. <replaceregexp byline="true" flags="g">
  138. <regexp pattern="org.apache.bcel"/>
  139. <substitution expression="org.aspectj.apache.bcel"/>
  140. <fileset dir="src-temp">
  141. <include name="**/*"/>
  142. </fileset>
  143. </replaceregexp>
  144. <echo message="Copying from 'src-temp' back to 'src'"/>
  145. <copy toDir="src">
  146. <fileset dir="src-temp"/>
  147. </copy>
  148. <delete dir="src-temp"/>
  149. </target>
  150. </project>