projekti pod git sistemom za održavanje verzija -- projects under
the git version control system
1 <project name=
"mjc2wsl" default=
"all">
2 <property file=
"custom.properties"/>
4 <condition property=
"fermat.dir" value=
"C:\fermat3">
5 <os family=
"windows" />
8 <condition property=
"fermat.dir" value=
"${user.home}/fermat3">
9 <not><os family=
"windows" /></not>
13 <property name=
"java.encoding" value=
"utf-8" />
14 <taskdef resource=
"net/sf/antcontrib/antlib.xml"/>
16 <property name=
"mjc2wsl.class.dir" value=
"bin" />
17 <property name=
"mjc2wsl.src.dir" value=
"src" />
18 <property name=
"mjc2wsl.options" value=
"" />
20 <property name=
"compiler.class.dir" value=
"compiler-bin" />
21 <property name=
"compiler.src.dir" value=
"compiler" />
23 <property name=
"samples.main.dir" value=
"samples" />
24 <property name=
"samples.temp.dir" value=
"samples-temp" />
26 <property name=
"transf.wsl.file" value=
"src-wsl/transf-min.wsl" />
27 <property name=
"transf.wsl.ini" value=
"transf.ini" />
30 Builder script for mjc2wsl and related tools, runs test
33 Also gives options to chain the tools on individual files.
37 <mkdir dir=
"${mjc2wsl.class.dir}"/>
38 <mkdir dir=
"${compiler.class.dir}"/>
39 <mkdir dir=
"${samples.temp.dir}"/>
40 <copy todir=
"${samples.temp.dir}">
41 <fileset dir=
"${samples.main.dir}">
42 <include name=
"*.mj"/>
47 <target name=
"build" depends=
"init" description=
"build the mjc2wsl tool">
48 <javac srcdir=
"${mjc2wsl.src.dir}" destdir=
"${mjc2wsl.class.dir}" includeAntRuntime='no'
/>
51 <target name=
"mj-build" depends=
"init" description=
"build the mj compiler">
52 <javac srcdir=
"${compiler.src.dir}" destdir=
"${compiler.class.dir}" includeAntRuntime='no'
/>
55 <target name=
"mj-compile">
56 <echo message=
"${filename}" />
57 <java classpath=
"${compiler.class.dir}" classname=
"Compiler">
58 <arg value=
"${filename}" />
62 <target name=
"mj-samples" depends=
"mj-build" description=
"run the mj compiler on the samples">
63 <foreach param=
"filename" target=
"mj-compile">
65 <fileset dir='${samples.temp.dir}'
>
66 <include name=
"*.mj"/>
72 <target name=
"mj-samples1" depends=
"mj-build">
73 <!-- simplistic version when antlib (foreach) is not available -->
74 <antcall target=
"mj-compile">
75 <param name=
"filename" value=
"samples-temp/sample.mj" />
77 <antcall target=
"mj-compile">
78 <param name=
"filename" value=
"samples-temp/sample1.mj" />
80 <antcall target=
"mj-compile">
81 <param name=
"filename" value=
"samples-temp/sample0.mj" />
85 <target name=
"mjc2wsl">
86 <echo message=
"${filename}" />
87 <java classpath=
"${mjc2wsl.class.dir}" classname=
"mjc2wsl">
88 <arg line=
"${mjc2wsl.options}" />
89 <arg value=
"${filename}" />
93 <target name=
"mjc2wsl-samples" depends=
"build" description=
"run the mjc2wsl tool on the samples">
94 <foreach param=
"filename" target=
"mjc2wsl">
96 <fileset dir='${samples.temp.dir}'
>
97 <include name=
"*.obj"/>
103 <target name=
"mjc2wsl-samples1" depends=
"build">
104 <!-- simplistic version when antlib (foreach) is not available -->
105 <antcall target=
"mjc2wsl">
106 <param name=
"filename" value=
"samples-temp/sample0.obj" />
110 <target name=
"wsl-run" >
111 <exec executable=
"${fermat.dir}/bin/wsl" inputstring=
"${inputstring}">
112 <env key=
"PATH" path=
"${env.PATH}:${fermat.dir}/bin"/>
113 <env key=
"FermaT" path=
"${fermat.dir}" />
114 <env key=
"SCHEME_LIBRARY_PATH" path=
"${fermat.dir}/slib/" />
115 <env key=
"SCM_INIT_PATH" path=
"${fermat.dir}/scm/Init5e5.scm" />
116 <arg value=
"${filename}"/>
120 <target name=
"wsl-transf"
121 description=
"transform (simplify) a single wsl file generated by mjc2wsl">
122 <delete file=
"${transf.wsl.ini}"/>
124 <antcall target=
"wsl-run">
125 <param name=
"filename" value=
"${transf.wsl.file}" />
126 <param name=
"inputstring" value=
"${transf.filename}" />
130 <target name=
"wsl-transf-samples" depends=
"make-transf-ini-samples"
131 description=
"transform (simplify) the wsl files generated by mjc2wsl">
132 <antcall target=
"wsl-run">
133 <param name=
"filename" value=
"${transf.wsl.file}" />
137 <target name=
"make-transf-ini-samples">
138 <fileset dir=
"${samples.temp.dir}" casesensitive=
"no" id=
"generated-wsl-fileset">
139 <patternset id=
"non.transformed.sources">
140 <include name=
"**/*.wsl"/>
141 <exclude name=
"**/*_t.wsl"/>
144 <pathconvert pathsep=
"${line.separator}"
145 property=
"generated-wsl-files" refid=
"generated-wsl-fileset" />
147 <echo file=
"${transf.wsl.ini}">${generated-wsl-files}
</echo>
150 <target name=
"all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples'
151 description=
"build the tools, run them on the samples to check">
155 <target name=
"clean" description=
"clean up all the generated content">
156 <delete includeemptydirs=
"true">
158 <include name=
"${mjc2wsl.class.dir}/*.class"/>
159 <include name=
"${compiler.class.dir}/*.class"/>
160 <include name=
"${samples.temp.dir}/*"/>
163 <include name=
"${mjc2wsl.class.dir}"/>
164 <include name=
"${compiler.class.dir}"/>
165 <include name=
"${samples.temp.dir}"/>
170 <!-- jedit specific flags; needs to be the first or the last 10 lines