build.xml 2.52 KB
Newer Older
Administrator's avatar
Administrator committed
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
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
===========================================================================
*
*  INVOCATION
*
*  Stand in the distribution directory Mouse-1.7 and invoke Apache Ant:
*
*      ant -Ddest=<destdir> <targets>
*
*  where <destdir> is name of the directory to contain the result.
*  This directory will be deleted if it exists  and then re-created.
*  If you omit -D option, destdir is the subdirectory 'build' of Mouse-1.7.
*
*  <targets> are one or more of:
*    full-jar     - build complete Mouse-1.7.jar
*    runtime-jar  - build Mouse-1.7.runtime.jar
*    compile      - compile all source to subdirectory 'mouse'
*                   of destdir. It is included in the preceding two.
*  Default is all of above.
*
*  2011-11-08 Created.
*  2012-01-06 Updated for version 1.5.1.
*  2013-04-15 Updated for version 1.6.
*  2014-04-13 Updated for version 1.6.1.
*  2015-07-25 Updated for version 1.7.
*
* =========================================================================
-->

<project name="MakeMouse" basedir="." default="all" >

  <property name="dest" value="${basedir}/build" />
Administrator's avatar
Administrator committed
35
  <property name="lib"       location="${basedir}/lib"       />
Administrator's avatar
Administrator committed
36

Administrator's avatar
Administrator committed
37
38
39
40
41
42
43
  <path id="libraries">
     <pathelement location="${src}" />
     <fileset dir="${lib}">
	<include name="**/*.jar" />
     </fileset>
  </path>
  
Administrator's avatar
Administrator committed
44
45
46
  <target name="all" depends="full-jar, runtime-jar" />

  <target name="full-jar" depends="compile, rtsource">
Administrator's avatar
Administrator committed
47
48
49
50
51
52
    <jar basedir="${dest}" destfile="${dest}/Mouse-1.7.jar">
      <manifest>
        <attribute name="Main-Class" value="mouse/Generate" />
	<attribute name="Class-Path" value="java-cup-11b-runtime.jar" />
      </manifest>      
    </jar>
Administrator's avatar
Administrator committed
53
54
55
56
57
58
59
60
61
    <delete dir="${dest}/rtsource" />
  </target>

  <target name="runtime-jar" depends="compile">
    <jar basedir="${dest}/mouse/runtime"
         destfile="${dest}/Mouse-1.7.runtime.jar" />
  </target>

  <target name="compile" depends="init">
Administrator's avatar
Administrator committed
62
63
64
    <javac srcdir="${basedir}/src" destdir="${dest}" includeAntRuntime="no">
      <classpath refid="libraries"/>
    </javac>
Administrator's avatar
Administrator committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  </target>

  <target name="rtsource" depends="rtdir" >
    <copy todir="${dest}/rtsource">
      <fileset dir="${basedir}/src/mouse/runtime" />
    </copy>
  </target>

  <target name="rtdir" depends="init">
    <mkdir dir="${dest}/rtsource"/>
  </target>

  <target name="init" depends="clean">
    <mkdir dir="${dest}"/>
  </target>

  <target name="clean">
    <delete dir="${dest}"/>
  </target>

</project>