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.7KB

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