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

ekuleshov's avatar
ekuleshov committed
3 4
  <property file="${user.home}/asm-build.properties"/>
  <property file="build.properties"/>
5

6 7 8 9
  <property name="src"                value="${basedir}/src"/>
  <property name="externals"          value="${basedir}/externals"/>
  <property name="out"                value="${basedir}/output"/>
  <property name="out.build"          value="${out}/build"/>
ekuleshov's avatar
ekuleshov committed
10 11 12 13

  <property name="plugin.jar"   value="${plugin.id}_${plugin.version}.jar"/>
  <property name="feature.jar"  value="${plugin.id}.feature_${plugin.version}.jar"/>
  
14 15 16

  <target name="init">
    <path id="classpath">
ekuleshov's avatar
ekuleshov committed
17 18
      <fileset dir="${externals}" includes="**/*.jar"/>
      <fileset dir="${eclipse.home}" includes="plugins/**/*.jar"/>
19 20 21 22 23
    </path>
  </target>

  <target name="compile" depends="init">
    <mkdir dir="${out.build}"/>
24 25
    <!-- Eclipse requires JDK 1.4, also we can set both properties to 1.4 -->
    <javac destdir="${out.build}" debug="on" source="1.4" target="1.4">
26 27 28
      <classpath refid="classpath"/>
      <src path="${src}"/>
      <include name="**/*.java"/>
29
    </javac>      
30 31 32
  </target>

  <target name="jars" depends="compile">
33 34 35 36 37
    <copy todir="${out.build}">
      <fileset dir="${src}">      
        <include name="**/*.properties"/>
      </fileset>
    </copy>      
ekuleshov's avatar
ekuleshov committed
38
    <jar jarfile="${out}/BytecodeOutline.jar" basedir="${out.build}">
39 40 41 42 43 44
      <include name="**/*"/>
      <manifest>
        <attribute name="Implementation-Title" value="BytecodeOutline"/>
        <attribute name="Implementation-Version" value="${plugin.version}"/>
      </manifest>
    </jar>
ekuleshov's avatar
ekuleshov committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    
    <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="feature.xml"/>
        <include name="site.xml"/>
        <include name="build.xml"/>
        <include name="build.config"/>
        <include name=".project"/>
        <include name=".classpath"/>
        <include name="README.txt"/>
        <include name="LICENSE.txt"/>
      </fileset>
62 63 64 65
    </zip>
  </target>

  <target name="plugin" depends="jars">
ekuleshov's avatar
ekuleshov committed
66
    <jar zipfile="${out}/${plugin.jar}" manifest="META-INF/MANIFEST.MF">
67
      <zipfileset dir="${out}" includes="BytecodeOutline.jar,BytecodeOutlinesrc.zip"/>
68
      <fileset dir=".">
ekuleshov's avatar
ekuleshov committed
69
        <include name="externals/*.jar"/>
70 71 72 73
        <include name="icons/**/*"/>
        <include name="plugin.xml"/>
        <include name="*.txt"/>
      </fileset>
ekuleshov's avatar
ekuleshov committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87
    </jar>
  </target>
  
  <target name="feature" depends="plugin">
    <jar zipfile="${out}/${feature.jar}">
      <fileset dir="." includes="feature.xml"/>
    </jar>
  </target>
  
  <target name="site" depends="feature">
    <zip zipfile="${out}/${plugin.id}.update_${plugin.version}.zip">
      <zipfileset dir="." includes="site.xml"/>
      <zipfileset dir="${out}" includes="${feature.jar}" prefix="features"/>
      <zipfileset dir="${out}" includes="${plugin.jar}"  prefix="plugins"/>
88 89 90 91
    </zip>
  </target>
  
  <target name="clean">
ekuleshov's avatar
ekuleshov committed
92 93 94
    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${out}" includes="**/*"/>
    </delete>
95 96 97
  </target>

</project>