build.xml 4.14 KB
Newer Older
Daniel Dreibrodt's avatar
Daniel Dreibrodt committed
1 2
<?xml version="1.0" encoding="UTF-8"?>

Daniel Dreibrodt's avatar
Daniel Dreibrodt committed
3
<project name="skin-designer" default="jar" basedir=".">
4

5 6 7 8 9 10 11 12 13 14 15
  <property name="src"   value="src"   />
  <property name="build" value="build" />
  <property name="dist"  value="dist"  />
  <property name="lang"  value="lang"  />
  <property name="share" value="share" />
  <property file="build.properties" />  
  
  <condition property="isWindows">
    <os family="windows"/>
  </condition>
    
16
  <target name="bootstrap">
17 18
    <mkdir dir="${build}" />
    <mkdir dir="${dist}" />
19 20 21
  </target>

  <target name="compile" depends="bootstrap">
22 23 24
    <mkdir dir="${build}/classes" />
    <javac srcdir="${src}"
           destdir="${build}/classes"
25 26 27 28 29 30
           target="1.6"
           source="1.6"
           fork="true" />
  </target>

  <target name="copy-resources" depends="bootstrap">
31 32 33
    <mkdir dir="${build}/resources/vlcskineditor/icons" />
    <copy todir="${build}/resources/vlcskineditor/icons">
      <fileset dir="${src}/vlcskineditor/icons" />
34 35 36 37
    </copy>
  </target>

  <target name="jar" depends="compile, copy-resources">
38
    <jar destfile="VLCSkinEditor.jar">
39 40
     <fileset dir="${build}/classes" />
     <fileset dir="${build}/resources" />
41 42 43 44 45 46 47 48
      <manifest>
        <attribute name="Main-Class"
                   value="vlcskineditor.Main" />
      </manifest>
    </jar>
  </target>

  <target name="clean">
49 50
    <delete dir="${build}" />
    <delete dir="${dist}" />
51
  </target>
52 53 54
  
  <target name="package-update" depends="jar">
    <echo file=".updated" />
55
    <zip destfile="${dist}/VLCSkinEditor_update.zip">            
56 57 58
      <fileset dir="${share}/" includes="VLCSkinEditor.exe
                                         ICE_JNIRegistry.dll" />
      <fileset dir="." includes=".updated
59
                                 VLCSkinEditor.jar
60 61
                                 README.TXT
                                 LICENSE.TXT
62
                                 skin.dtd
63 64 65 66 67 68 69
                                 ${lang}/*.txt
                                 ${lang}/*/*.txt" />
    </zip>
    <delete file=".updated" />
  </target>
  
  <target name="package-win32" depends="jar">
70
    <zip destfile="${dist}/VLCSkinEditor_w32.zip">            
71 72 73 74
      <fileset dir="${share}/" includes="VLCSkinEditor.exe
                                         ICE_JNIRegistry.dll" />
      <fileset dir="." includes="README.TXT
                                 LICENSE.TXT
75
                                 VLCSkinEditor.jar
76
                                 skin.dtd
77 78 79 80 81
                                 ${lang}/*.txt
                                 ${lang}/*/*.txt"/>
    </zip>
  </target> 
  
Daniel Dreibrodt's avatar
Daniel Dreibrodt committed
82
  <target name="get-is-dir" unless="is.dir" if="isWindows">
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    <input
      message="Please enter the directory where InnoSetup is installed:"
      addproperty="is.dir.read"
    />
    <available property="is.exists" file="${is.dir.read}/iscc.exe"/>
    <fail unless="is.exists"/>
    <propertyfile
      file="build.properties"
      comment="Build configuration">
      <entry key="is.dir" value="${is.dir.read}"/>
    </propertyfile>
  </target>
  
  <target name="installer-win32" depends="jar,get-is-dir" if="isWindows">
    <exec executable="${is.dir}/iscc.exe">
      <arg line="SkinEditorInstaller.iss"/>
    </exec>
  </target>
  
  <target name="package-unix" depends="jar">
103
    <tar destfile="${dist}/VLCSkinEditor_unix.tar">            
104 105
      <fileset dir="${share}/" includes="VLCSkinEditor" />
      <fileset dir="." includes="README.TXT 
106 107
                                 LICENSE.TXT
                                 VLCSkinEditor.jar
108
                                 skin.dtd
109 110 111 112 113 114 115 116 117 118 119 120
                                 ${lang}/*.txt
                                 ${lang}/*/*.txt" />
    </tar>
    <gzip destfile="${dist}/VLCSkinEditor_unix.tar.gz" src="${dist}/VLCSkinEditor_unix.tar" />
    <delete file="${dist}/VLCSkinEditor_unix.tar" />
  </target>  
  
  <target name="package-all" depends="package-update,
                                      package-win32,
                                      package-unix,
                                      installer-win32" />
</project>