aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/build.xml
blob: 998ee5f75529e6a9276655920ced1827b07cf549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<project default="extractAndJar" basedir=".">

  <!-- top-level -->
  <target name="extractAndJar" depends="extract,jar,srcjar" />

  <target name="extract" depends="unzipSource,createPatchedSource" />

  <target name="jar" depends="pack">
    <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="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"/> <!-- 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" />

  <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" />
    </copy>
  </target>

</project>