build.xml 3.21 KB
Newer Older
petter's avatar
petter committed
1
2
3
<project name="TTT" default ="all" basedir=".">
  <property name="java"       location="java" />
  <property name="lib"       location="lib" />
4
  <property name="native"       location="native" />
petter's avatar
petter committed
5
6
7
8
  <property name="classes"   location="bin" />
  <property name="dist"      location="dist"/>
  <property name="etc" 	     location="etc" />
  <property environment="env" />
petter's avatar
petter committed
9
10
  <taskdef name="nsis" classname="com.danielreese.nsisant.Task">
    <classpath location="${lib}/nsisant-1.3.jar"/>
petter's avatar
petter committed
11
  </taskdef>
petter's avatar
petter committed
12
13
14
  <!--taskdef name="nsis" classname="net.sf.nsisant.Task">
    <classpath location="${lib}/nsisant-1.3.jar"/>
  </taskdef-->
petter's avatar
petter committed
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

  <path id="sources">
    <fileset dir="${src}">
      <include name="**/**.java" />
    </fileset>
  </path>

  <path id="libraries">
     <pathelement location="${classes}" />
     <pathelement location="${lib}" />
     <fileset dir="${lib}">
       <include name="**/*.jar" />
       <include name="**/*.zip" />
     </fileset>
     <!-- here, we include all necessary libraries -->
     <!--fileset dir="${plugins}">
       <include name="**/*.jar" />
     </fileset-->
     <pathelement path="${java.class.path}" />
  </path>

  <!-- initialize the workspace -->
  <target name="init">
    <mkdir dir="${classes}" />
    <mkdir dir="${dist}" />    
  </target>

  <!-- deletes all build-related directories -->
  <target name="clean">
    <delete>
      <fileset dir="." defaultexcludes="no" includes="**/*~"/>
      <fileset dir="." defaultexcludes="no" includes="**/#*#"/>
    </delete>
    <delete dir="${classes}" />
    <delete dir="${dist}" />
    <delete dir="${etc}" />
  </target>


  <!-- Compiles the .java files to the classes directory -->
  <target name="classes" depends="init">
    <depend srcdir="${java}" destdir="${classes}" cache="${etc}" />
    <javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off"
58
      source="6" target="6" debug="on" encoding="Cp1252" >
petter's avatar
petter committed
59
60
      <classpath refid="libraries"/>
    </javac>
ludwig's avatar
ludwig committed
61
    
petter's avatar
petter committed
62
63
64
65
  </target>

  <!-- Packs the classes into single .jar files -->
  <target name="pack" depends="classes">
petter's avatar
petter committed
66
    <copy todir="${classes}/resources"><fileset dir="${java}/resources"></fileset></copy>
ludwig's avatar
ludwig committed
67
    <jar jarfile="${dist}/ttt.jar" basedir="${classes}">   
petter's avatar
petter committed
68
69
      <manifest>
       <attribute name="Main-Class" value="ttt/TTT" />
petter's avatar
petter committed
70
       <attribute name="Class-Path" value="itext-1.4.8.jar jsch-0.1.49.jar swing-layout-1.0.2.jar jmf-2.1.1e.jar mp3plugin.jar lti-civil.jar v4l4j.jar base64coder.jar" />
petter's avatar
petter committed
71
72
73
     </manifest>
     </jar>
    <copy todir="${dist}"><fileset dir="${lib}"></fileset></copy>
74
75
    <copy todir="${dist}"><fileset dir="${native}"></fileset></copy>
    <copy todir="${dist}" file="run.sh" />
76
77
78
    <copy todir="${dist}" file="beamer.sh" />
    <copy todir="${dist}" file="rotateTablet.sh" />
    <copy todir="${dist}" file="rotatebackTablet.sh" />
petter's avatar
petter committed
79
    <zip destfile="./ttt.zip" basedir="." includes="dist/*" update="true"/> 
petter's avatar
petter committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
  </target>

  <target name="installer" depends="pack">
    <nsis nocd="on" verbosity="2" script="nsis/ttt.nsi"/>
  </target>

  <!-- build the whole project -->
  <target name="all" depends="pack" />
  <target name="run" depends="pack">
    <java jar="${dist}/ttt.jar" fork="true">
      <assertions><disable /></assertions>
    </java>
  </target>
</project>