gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant build - task to execute wsl, given the install dir
[mjc2wsl.git] / build.xml
1 <project name="mjc2wsl" default="all">
2 <property name="java.encoding" value="utf-8" />
3 <taskdef resource="net/sf/antcontrib/antlib.xml"/>
5 <property name="mjc2wsl.class.dir" value="bin" />
6 <property name="mjc2wsl.src.dir" value="src" />
7 <property name="mjc2wsl.options" value="" />
9 <property name="compiler.class.dir" value="compiler-bin" />
10 <property name="compiler.src.dir" value="compiler" />
12 <property name="samples.main.dir" value="samples" />
13 <property name="samples.temp.dir" value="samples-temp" />
15 <property name="fermat.dir" value="/home/donny/d/donny/fermat3" />
17 <target name="help" description="a short help text">
18 <echo>Possible options:
19 all - build the tool and the compiler and test on the samples
20 build - build the mjc2wsl tool
21 mj-build - build the mj compiler
22 mj-samples - run the mj compiler on the samples (build if needed)
23 </echo>
24 </target>
26 <target name="init">
27 <mkdir dir="${mjc2wsl.class.dir}"/>
28 <mkdir dir="${compiler.class.dir}"/>
29 <mkdir dir="${samples.temp.dir}"/>
30 <copy todir="${samples.temp.dir}">
31 <fileset dir="${samples.main.dir}">
32 <include name="*.mj"/>
33 </fileset>
34 </copy>
35 </target>
37 <target name="build" depends="init" description="build the mjv2wsl tool">
38 <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
39 </target>
41 <target name="mj-build" depends="init" description="build the mj compiler">
42 <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
43 </target>
45 <target name="mj-compile">
46 <echo message="${filename}" />
47 <java classpath="${compiler.class.dir}" classname="Compiler">
48 <arg value="${filename}" />
49 </java>
50 </target>
52 <target name="mj-samples" depends="build" description="run the mj compiler on the samples">
53 <foreach param="filename" target="mj-compile">
54 <path>
55 <fileset dir='${samples.temp.dir}'>
56 <include name="*.mj"/>
57 </fileset>
58 </path>
59 </foreach>
60 </target>
62 <target name="mj-samples1" depends="mj-build">
63 <!-- simplistic version when antlib (foreach) is not available -->
64 <antcall target="mj-compile">
65 <param name="filename" value="samples-temp/sample.mj" />
66 </antcall>
67 <antcall target="mj-compile">
68 <param name="filename" value="samples-temp/sample1.mj" />
69 </antcall>
70 <antcall target="mj-compile">
71 <param name="filename" value="samples-temp/sample0.mj" />
72 </antcall>
73 </target>
75 <target name="mjc2wsl">
76 <echo message="${filename}" />
77 <java classpath="${mjc2wsl.class.dir}" classname="mjc2wsl">
78 <arg line="${mjc2wsl.options}" />
79 <arg value="${filename}" />
80 </java>
81 </target>
83 <target name="mjc2wsl-samples" depends="build">
84 <foreach param="filename" target="mjc2wsl">
85 <path>
86 <fileset dir='${samples.temp.dir}'>
87 <include name="*.obj"/>
88 </fileset>
89 </path>
90 </foreach>
91 </target>
93 <target name="mjc2wsl-samples1" depends="build">
94 <!-- simplistic version when antlib (foreach) is not available -->
95 <antcall target="mjc2wsl">
96 <param name="filename" value="samples-temp/sample0.obj" />
97 </antcall>
98 </target>
100 <target name="wsl-run" >
101 <exec executable="${fermat.dir}/bin/wsl" >
102 <env key="PATH" path="${env.PATH}:${fermat.dir}/bin"/>
103 <env key="FermaT" path="${fermat.dir}" />
104 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
105 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e5.scm" />
106 <arg value="${filename}"/>
107 </exec>
108 </target>
110 <target name="all" depends='mj-samples,mjc2wsl-samples' description="build the tools, run them on the samples to check">
112 </target>
114 <target name="clean" description="clean up all the generated content">
115 <delete includeemptydirs="true">
116 <fileset dir=".">
117 <include name="${mjc2wsl.class.dir}/*.class"/>
118 <include name="${compiler.class.dir}/*.class"/>
119 <include name="${samples.temp.dir}/*"/>
120 </fileset>
121 <dirset dir=".">
122 <include name="${mjc2wsl.class.dir}"/>
123 <include name="${compiler.class.dir}"/>
124 <include name="${samples.temp.dir}"/>
125 </dirset>
126 </delete>
127 </target>
129 <!-- jedit specific flags; needs to be the first or the last 10 lines
130 :noTabs=true:
131 -->
132 </project>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner