build.xml 4.57 KB
Newer Older
1 2
<project name="BytecodeOutline" default="plugin">

3
  <!-- defines the location of the asm project via asm.project.dir -->
ekuleshov's avatar
ekuleshov committed
4
  <property file="${user.home}/asm-build.properties"/>
5 6

  <!-- TODO right now we define bco.version/plugin.id here, but we shall read it from MANIFEST.MF -->
ekuleshov's avatar
ekuleshov committed
7
  <property file="build.properties"/>
8

9 10 11 12
  <!-- defines product.version fro asm etc  -->
  <property file="${asm.project.dir}/build.properties" />


13 14 15
  <property name="src"                value="${basedir}/src"/>
  <property name="externals"          value="${basedir}/externals"/>
  <property name="out"                value="${basedir}/output"/>
16
  <property name="lib"                value="${basedir}/lib"/>
17
  <property name="out.build"          value="${out}/build"/>
ekuleshov's avatar
ekuleshov committed
18

19 20 21 22
  <property name="plugin.jar"   value="${plugin.id}_${bco.version}.jar"/>
  <property name="feature.jar"  value="${plugin.id}.feature_${bco.version}.jar"/>
  <property name="asm-debug-all.jar" value="${asm.project.dir}/output/dist/lib/all/asm-debug-all-${product.version}.jar"/>
  <property name="asm.jar" value="${lib}/asm-debug-all.jar"/>
23

andrei's avatar
andrei committed
24 25 26
   <path id="saxon.classpath">
        <fileset dir="${saxon.home}" includes="*.jar"/>
    </path>
27 28

  <target name="init">
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    <condition property="asm.recompile" >
        <not><available file="${asm.jar}" /></not>
    </condition>
  </target>

    <!-- Trigger (re-)compilation of FB core, if findbugs.jar is not available -->
    <target name="asmcompile" if="asm.recompile" >
        <echo message="Building ASM core libraries"/>
        <ant dir="${asm.project.dir}" inheritall="false" target="jar" >
        	<property name="product.noshrink" value="true"/>
    	</ant>
        <copy tofile="${asm.jar}" preservelastmodified="true" file="${asm-debug-all.jar}" />
    </target>

  <target name="compile" depends="init, asmcompile">
44
    <path id="classpath">
45
      <fileset dir="lib" includes="*.jar"/>
andrei's avatar
andrei committed
46
      <fileset dir="${eclipse.home}" includes="plugins/**/*.jar"/>
47 48
    </path>
    <mkdir dir="${out.build}"/>
andrei's avatar
andrei committed
49
    <javac destdir="${out.build}" debug="on" source="1.5" target="1.5" includeantruntime="false">
50 51 52
      <classpath refid="classpath"/>
      <src path="${src}"/>
      <include name="**/*.java"/>
53
    </javac>
54 55 56
  </target>

  <target name="jars" depends="compile">
57
    <copy todir="${out.build}">
58
      <fileset dir="${src}">
59 60
        <include name="**/*.properties"/>
      </fileset>
61 62
    </copy>

ekuleshov's avatar
ekuleshov committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76
    <zip zipfile="${out}/BytecodeOutlinesrc.zip">
      <zipfileset dir="${src}" includes="**/*" prefix="src"/>
      <fileset dir=".">
        <include name="icons/*"/>
        <include name="plugin.xml"/>
        <include name="build.properties"/>
        <include name="META-INF/*"/>
        <include name="build.xml"/>
        <include name="build.config"/>
        <include name=".project"/>
        <include name=".classpath"/>
        <include name="README.txt"/>
        <include name="LICENSE.txt"/>
      </fileset>
ebruneton's avatar
ebruneton committed
77 78 79
      <fileset dir="site">
        <include name="feature.xml"/>
        <include name="site.xml"/>
80
      </fileset>
81 82 83
    </zip>
  </target>

84
  <target name="plugin" depends="jars,xslt">
85
    <zip zipfile="${out}/${plugin.jar}">
86
      <zipfileset dir="${out}" includes="BytecodeOutlinesrc.zip"/>
87
      <fileset dir=".">
88
        <include name="META-INF/MANIFEST.MF"/>
89 90
        <include name="icons/**/*"/>
        <include name="plugin.xml"/>
91
        <include name="about.html"/>
92
        <include name="*.txt"/>
93
        <include name="lib/*.jar"/>
94
      </fileset>
95
    <fileset dir="${out.build}">
andrei's avatar
andrei committed
96 97
      <include name="**/*"/>
    </fileset>
ekuleshov's avatar
ekuleshov committed
98
      <zipfileset dir="${out}/doc" includes="toc.xml,ref-*.html" prefix="doc"/>
99
    </zip>
ekuleshov's avatar
ekuleshov committed
100
  </target>
101

ekuleshov's avatar
ekuleshov committed
102 103
  <target name="feature" depends="plugin">
    <jar zipfile="${out}/${feature.jar}">
ebruneton's avatar
ebruneton committed
104
      <fileset dir="site" includes="feature.xml"/>
ekuleshov's avatar
ekuleshov committed
105 106
    </jar>
  </target>
107

ekuleshov's avatar
ekuleshov committed
108
  <target name="site" depends="feature">
109
    <zip zipfile="${out}/${plugin.id}.update_${bco.version}.zip">
ebruneton's avatar
ebruneton committed
110
      <zipfileset dir="site" includes="site.xml"/>
ekuleshov's avatar
ekuleshov committed
111 112
      <zipfileset dir="${out}" includes="${feature.jar}" prefix="features"/>
      <zipfileset dir="${out}" includes="${plugin.jar}"  prefix="plugins"/>
113 114
    </zip>
  </target>
115

116
  <target name="clean">
ekuleshov's avatar
ekuleshov committed
117 118
    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${out}" includes="**/*"/>
119
      <fileset dir="${lib}" includes="**/*"/>
ekuleshov's avatar
ekuleshov committed
120
    </delete>
121 122
  </target>

123 124
  <target name="xslt" depends="init">
    <mkdir dir="${out}/doc"/>
andrei's avatar
andrei committed
125
    <xslt basedir="." destdir="${out}/doc" includes="opcodes.xml" classpathref="saxon.classpath"
126
          style="opcodes-doc.xsl" force="true">
andrei's avatar
andrei committed
127
       <factory name="net.sf.saxon.TransformerFactoryImpl" />
128 129 130
    </xslt>
  </target>

131
</project>