gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant task to save the version number in git
[mjc2wsl.git] / build.xml
1 <project name="mjc2wsl" default="all">
2 <description>
3 Builder script for mjc2wsl and related tools, runs tests
4 on given samples.
5 </description>
7 <!-- use this file for any custom local needs -->
8 <property file="custom.properties"/>
9 <property environment="env"/>
11 <!-- try and detect the fermat.dir based on the operating system
12 should be set as a custom value in "custom.properties"
13 if it's in a non default location.
14 -->
15 <condition property="fermat.dir" value="C:\fermat3">
16 <os family="windows" />
17 </condition>
19 <condition property="fermat.dir" value="${user.home}/fermat3">
20 <not><os family="windows" /></not>
21 </condition>
23 <property name="java.encoding" value="utf-8" />
24 <taskdef resource="net/sf/antcontrib/antlib.xml"/>
26 <!-- **************************************** -->
27 <!-- main variables that can be altered in the
28 properties file or through command line switches.
29 -->
30 <!-- **************************************** -->
32 <!-- when using multiple threads there is a problem with logging!-->
33 <property name="global.max.threads" value="1" />
35 <property name="mjc2wsl.class.dir" value="bin" />
36 <property name="mjc2wsl.src.dir" value="src" />
37 <property name="mjc2wsl.options" value="" />
38 <property name="mjc2wsl.main" value="com.quemaster.transformations.mjc2wsl.Mjc2wsl" />
40 <property name="res.dir" value="res" />
41 <property name="dist.dir" value="dist" />
43 <property name="compiler.class.jar" value="lib/mj.jar" />
44 <property name="compiler.class.dir" value="lib/compiler-bin" />
45 <property name="compiler.src.dir" value="lib/compiler-src" />
46 <property name="compiler.classname.compiler" value="MJ.Compiler" />
47 <property name="compiler.classname.interpreter" value="MJ.Run" />
48 <property name="compiler.classname.decoder" value="MJ.Decode" />
50 <property name="samples.main.dir" value="samples/alpha-mj" />
51 <property name="samples.temp.dir" value="temp/alpha-mj" />
53 <property name="transf.wsl.file" value="src-wsl/hill_climbing.wsl" />
54 <property name="transf.wsl.ini" value="transf.ini" />
55 <property name="transf.wsl.ext" value="_tr.wsl" />
56 <!-- args can be used to send additional arguments to a script -->
57 <property name="transf.wsl.args" value="" />
59 <property name="metrics.wsl.file" value="src-wsl/metrics_csv.wsl" />
60 <property name="metrics.extension" value=".met" />
62 <property name="tests.dir" value="tests" />
64 <property name="log.dir" value="${basedir}/logs" />
65 <property name="log.file.transformations" value="${log.dir}/transformations" />
66 <property name="log.file.mjc2wsl" value="${log.dir}/mjc2wsl" />
67 <property name="log.file.tests.m" value="${log.dir}/tests-mj" />
68 <property name="log.file.tests.t" value="${log.dir}/tests-wsl" />
70 <property name="version.file" value="${res.dir}/com/quemaster/transformations/mjc2wsl/version.properties" />
72 <!-- **************************************** -->
73 <!-- patterns -->
74 <!-- **************************************** -->
76 <patternset id="non.transformed.sources">
77 <include name="**/*.wsl"/>
78 <exclude name="**/*${transf.wsl.ext}"/>
79 </patternset>
81 <patternset id="transformed.sources">
82 <include name="**/*${transf.wsl.ext}"/>
83 </patternset>
85 <!-- **************************************** -->
86 <!-- general tasks -->
87 <!-- **************************************** -->
89 <target name="init" depends="init-time">
90 <mkdir dir="${mjc2wsl.class.dir}"/>
91 <mkdir dir="${compiler.class.dir}"/>
92 <mkdir dir="${samples.temp.dir}"/>
93 <mkdir dir="${log.dir}"/>
94 <mkdir dir="${dist.dir}"/>
95 <copy todir="${samples.temp.dir}">
96 <fileset dir="${samples.main.dir}">
97 <include name="*.mj"/>
98 </fileset>
99 </copy>
100 </target>
102 <target name="init-time">
103 <tstamp>
104 <format property="time" pattern="yy-MM-dd--HH-mm-ss-SSS"/>
105 </tstamp>
106 </target>
108 <target name="all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples,metrics-samples-compare-wsl'
109 description="build the tools, run them on the samples to check">
111 </target>
113 <target name="clean" description="clean up all the generated content">
114 <delete includeemptydirs="true">
115 <fileset dir="${mjc2wsl.class.dir}"/>
116 <fileset dir="${compiler.class.dir}"/>
117 <fileset dir="${samples.temp.dir}"/>
118 <fileset dir="${log.dir}"/>
119 </delete>
120 </target>
122 <target name="pack.jar" depends="build,update-version-string"
123 description="Packs the binaries in a jar and place it in ${dist.dir}">
125 <mkdir dir="${dist.dir}"/>
126 <jar destfile="${dist.dir}/mjc2wsl.jar"
127 includes="**">
128 <manifest>
129 <attribute name="Built-By" value="${user.name}"/>
130 <attribute name="Implementation-Vendor"
131 value="Doni Pracner"/>
132 <attribute name="Implementation-Title"
133 value="MicroJava bytecode to WSL"/>
134 <attribute name="Implementation-Version" value="${version}"/>
135 <attribute name="Main-Class" value="${mjc2wsl.main}"/>
136 </manifest>
137 <fileset dir="${mjc2wsl.class.dir}"/>
138 </jar>
140 </target>
142 <!-- **************************************** -->
143 <!-- version tasks
144 based on ideas by Jesper Öqvist http://llbit.se/?p=1876 -->
145 <!-- **************************************** -->
147 <!-- this target is only run if the 'version' property is undefined -->
149 <target name="update-version-string" unless="version">
150 <!-- get a new version string using git describe if possible -->
151 <echo message="Updating version string..."/>
152 <exec executable="git" outputproperty="version"
153 failifexecutionfails="false">
154 <arg value="describe"/>
155 </exec>
156 <antcall target="-store-version-string"/>
157 <!-- ensure version is defined even if git was not available -->
158 <property file="${version.file}"/>
159 </target>
161 <target name="-store-version-string" if="version">
162 <!-- store the new version string in the correct property file -->
163 <echo message="version=${version}"/>
164 <dirname file="${version.file}" property="version.file.dir"/>
165 <mkdir dir="${version.file.dir}" />
166 <propertyfile file="${version.file}">
167 <entry key="version" value="${version}"/>
168 </propertyfile>
169 <exec executable="git" failifexecutionfails="false">
170 <arg value="update-index"/>
171 <arg value="--assume-unchanged"/>
172 <arg value="${version.file}"/>
173 </exec>
174 </target>
176 <target name="git-version-string" if="version">
177 <!-- explicitly store the new version string in git -->
178 <!-- needs the version set already, preferably from the command line -->
179 <echo message="version=${version}"/>
180 <dirname file="${version.file}" property="version.file.dir"/>
181 <mkdir dir="${version.file.dir}" />
182 <propertyfile file="${version.file}">
183 <entry key="version" value="${version}"/>
184 </propertyfile>
185 <!-- remove the first line with the date if you can.
186 for whatever reason Java Properties always writes this
187 -->
188 <exec executable="sed" failifexecutionfails="false">
189 <arg line="-e '1d' -i ${version.file}"/>
190 </exec>
191 <exec executable="git" failifexecutionfails="false">
192 <arg value="update-index"/>
193 <arg value="--no-assume-unchanged"/>
194 <arg value="${version.file}"/>
195 </exec>
196 </target>
198 <!-- **************************************** -->
199 <!-- mjc2wsl related tasks -->
200 <!-- **************************************** -->
202 <target name="build" depends="init,update-version-string" description="build the mjc2wsl tool">
203 <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
204 <copy todir="${mjc2wsl.class.dir}">
205 <fileset dir="${res.dir}"/>
206 </copy>
207 </target>
209 <target name="mjc2wsl">
210 <echo message="${filename}" />
211 <java classpath="${mjc2wsl.class.dir}:${res.dir}" classname="${mjc2wsl.main}">
212 <arg line="${mjc2wsl.options}" />
213 <arg value="${filename}" />
214 </java>
215 </target>
217 <target name="mjc2wsl-samples" depends="build,init-time" description="run the mjc2wsl tool on the samples">
218 <record name="${log.file.mjc2wsl}${time}.txt" emacsmode="true" />
219 <echo>Used options:${mjc2wsl.options}</echo>
220 <foreach param="filename" target="mjc2wsl" parallel="true" maxthreads="${global.max.threads}">
221 <path>
222 <fileset dir='${samples.temp.dir}'>
223 <include name="*.obj"/>
224 </fileset>
225 </path>
226 </foreach>
227 <record name="${log.file.mjc2wsl}${time}.txt" action="stop" />
228 <copy file="${log.file.mjc2wsl}${time}.txt" tofile="${log.file.mjc2wsl}.txt"/>
229 </target>
231 <target name="mjc2wsl-samples1" depends="build">
232 <!-- simplistic version when antlib (foreach) is not available -->
233 <antcall target="mjc2wsl">
234 <param name="filename" value="samples-temp/sample0.obj" />
235 </antcall>
236 </target>
239 <!-- **************************************** -->
240 <!-- MicroJava related tasks -->
241 <!-- **************************************** -->
244 <target name="mj-build" depends="init" description="build the mj compiler">
245 <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
246 </target>
248 <target name="mj-compile" description="compile a MJ into obj file; given ${filename}">
249 <echo message="${filename}" />
250 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.compiler}">
251 <arg value="${filename}" />
252 </java>
253 </target>
255 <target name="mj-samples" description="run the mj compiler on the samples" depends="init">
256 <foreach param="filename" target="mj-compile" parallel="true" maxthreads="${global.max.threads}">
257 <path>
258 <fileset dir='${samples.temp.dir}'>
259 <include name="*.mj"/>
260 </fileset>
261 </path>
262 </foreach>
263 </target>
265 <target name="mj-decode" description="decode a MJ obj file given in ${filename}">
266 <echo message="${filename}" />
267 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
268 classname="${compiler.classname.decoder}"
269 output="${filename}.decoded" >
270 <arg value="${filename}" />
271 </java>
272 </target>
274 <target name="mj-decode-samples" description="decode all of the obj files in ${samples.temp.dir}">
275 <foreach param="filename" target="mj-decode">
276 <path>
277 <fileset dir='${samples.temp.dir}'>
278 <include name="*.obj"/>
279 </fileset>
280 </path>
281 </foreach>
282 </target>
284 <target name="mj-run" description="run a MJ obj file given in ${filename} with ${inputstring}">
285 <echo message="${filename}" />
286 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.interpreter}" inputstring="${inputstring}">
287 <arg value="${filename}" />
288 </java>
289 </target>
291 <target name="mj-samples1" depends="mj-build">
292 <!-- simplistic version when antlib (foreach) is not available -->
293 <antcall target="mj-compile">
294 <param name="filename" value="samples-temp/sample.mj" />
295 </antcall>
296 <antcall target="mj-compile">
297 <param name="filename" value="samples-temp/sample1.mj" />
298 </antcall>
299 <antcall target="mj-compile">
300 <param name="filename" value="samples-temp/sample0.mj" />
301 </antcall>
302 </target>
305 <!-- **************************************** -->
306 <!-- wsl related tasks -->
307 <!-- **************************************** -->
309 <target name="wsl-run" >
310 <property name="args" value=""/>
311 <property name="wslrun.workdir" value=""/>
312 <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}"
313 dir="${wslrun.workdir}" >
314 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
315 <env key="FermaT" path="${fermat.dir}" />
316 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
317 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
318 <arg line="${filename} ${args}"/>
319 </exec>
320 </target>
322 <target name="wsl-transf"
323 description="transform (simplify) a single wsl file generated by mjc2wsl">
324 <stopwatch name="transf-${transf.filename}" action="start"/>
325 <antcall target="wsl-run">
326 <param name="filename" value="${transf.wsl.file}" />
327 <param name="args" value="${transf.wsl.args} ${transf.filename}" />
328 </antcall>
329 <record name="${transf.filename}-time.txt" action="start" emacsmode="true"/>
330 <stopwatch name="transf-${transf.filename}" action="total"/>
331 <record name="${transf.filename}-time.txt" action="stop"/>
332 </target>
334 <target name="wsl-transf-samples" depends="init"
335 description="transform (simplify) the wsl files generated by mjc2wsl" >
336 <record name="${log.file.transformations}${time}.txt" emacsmode="true" />
337 <foreach param="transf.filename" target="wsl-transf" parallel="true" maxthreads="${global.max.threads}">
338 <path>
339 <fileset dir='${samples.temp.dir}'>
340 <patternset refid="non.transformed.sources"/>
341 <depth max="0"/>
342 </fileset>
343 </path>
344 </foreach>
345 <record name="${log.file.transformations}${time}.txt" action="stop" />
346 <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
347 </target>
349 <target name="wsl-transf-samples-ini" depends="init-time,make-transf-ini-samples"
350 description="transform (simplify) the wsl files generated by mjc2wsl - uses ini file">
351 <record name="${log.file.transformations}${time}i.txt" emacsmode="true" />
352 <antcall target="wsl-run">
353 <param name="filename" value="${transf.wsl.file}" />
354 </antcall>
355 <record name="${log.file.transformations}${time}i.txt" action="stop" />
356 <copy file="${log.file.transformations}${time}i.txt" tofile="${log.file.transformations}.txt"/>
357 </target>
359 <target name="make-transf-ini-samples">
360 <fileset dir="${samples.temp.dir}" casesensitive="no" id="generated-wsl-fileset">
361 <patternset refid="non.transformed.sources"/>
362 </fileset>
363 <pathconvert pathsep="${line.separator}"
364 property="generated-wsl-files" refid="generated-wsl-fileset" />
366 <echo file="${transf.wsl.ini}">${generated-wsl-files}</echo>
367 </target>
370 <!-- **************************************** -->
371 <!-- Testing tasks -->
372 <!-- **************************************** -->
374 <target name="manual-test-run"
375 description="run .obj .wsl ${transf.wsl.ext}, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
376 <record name="${file.dir}/${file.name}.out1" emacsmode="true" />
377 <antcall target="mj-run">
378 <param name="filename" value="${file.dir}/${file.name}.obj" />
379 <param name="inputstring" value="${inputstring}" />
380 </antcall>
381 <record name="${file.dir}/${file.name}.out1" action="stop" />
382 <record name="${file.dir}/${file.name}.out2" emacsmode="true" />
383 <antcall target="wsl-run">
384 <param name="filename" value="${file.dir}/${file.name}.wsl" />
385 <param name="inputstring" value="${inputstring}" />
386 </antcall>
387 <record name="${file.dir}/${file.name}.out2" action="stop" />
388 <record name="${file.dir}/${file.name}.out3" emacsmode="true" />
389 <antcall target="wsl-run">
390 <param name="filename" value="${file.dir}/${file.name}${transf.wsl.ext}" />
391 <param name="inputstring" value="${inputstring}" />
392 </antcall>
393 <record name="${file.dir}/${file.name}.out3" action="stop" />
394 </target>
396 <target name="manual-test-run-samples-dir"
397 description="run .obj .wsl ${transf.wsl.ext}, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
398 <antcall target="manual-test-run">
399 <param name="file.dir" value="${samples.temp.dir}"/>
400 </antcall>
401 </target>
403 <target name="init-compare">
404 <mkdir dir="${samples.temp.dir}/outputs"/>
405 </target>
407 <target name="test-m-w">
409 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
411 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
412 classname="${compiler.classname.interpreter}"
413 input="${inputfile}"
414 error="${samples.temp.dir}/outputs/${file.out}.errmj"
415 output="${samples.temp.dir}/outputs/${file.out}.outmj">
416 <arg value="${file.dir}/${file.name}.obj" />
417 </java>
419 <exec executable="${fermat.dir}/bin/wsl"
420 input="${inputfile}"
421 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
422 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
423 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
424 <env key="FermaT" path="${fermat.dir}" />
425 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
426 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
427 <arg value="${file.dir}/${file.name}.wsl"/>
428 </exec>
430 <exec executable="perl" resultproperty="ook">
431 <arg value="lib/compare-m-w.pl"/>
432 <arg value="${file.dir}/outputs"/>
433 <arg value="${file.out}"/>
434 </exec>
436 </target>
438 <target name="test-w-wt">
440 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
442 <exec executable="${fermat.dir}/bin/wsl"
443 input="${inputfile}"
444 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
445 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
446 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
447 <env key="FermaT" path="${fermat.dir}" />
448 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
449 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
450 <arg value="${file.dir}/${file.name}.wsl"/>
451 </exec>
453 <exec executable="${fermat.dir}/bin/wsl"
454 input="${inputfile}"
455 error="${samples.temp.dir}/outputs/${file.out}.errwslt"
456 output="${samples.temp.dir}/outputs/${file.out}.outwslt" >
457 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
458 <env key="FermaT" path="${fermat.dir}" />
459 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
460 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
461 <arg value="${file.dir}/${file.name}${transf.wsl.ext}"/>
462 </exec>
464 <exec executable="perl">
465 <arg value="lib/compare-w-wt.pl"/>
466 <arg value="${file.dir}/outputs"/>
467 <arg value="${file.out}"/>
468 </exec>
469 </target>
471 <target name="test-fn">
472 <basename property="file.name" file="${filename}" suffix=".obj"/>
473 <dirname property="file.dir" file="${filename}"/>
474 <foreach param="inputfile" target="test-m-w" inheritall="true">
475 <path>
476 <fileset dir='${tests.dir}'>
477 <include name="${file.name}*.txt"/>
478 </fileset>
479 </path>
480 </foreach>
481 </target>
483 <target name="test-fn-t">
484 <basename property="file.name" file="${filename}" suffix="${transf.wsl.ext}"/>
485 <dirname property="file.dir" file="${filename}"/>
486 <foreach param="inputfile" target="test-w-wt" inheritall="true">
487 <path>
488 <fileset dir='${tests.dir}'>
489 <include name="${file.name}*.txt"/>
490 </fileset>
491 </path>
492 </foreach>
493 </target>
495 <target name="test-all-m" depends="init-compare,init-time"
496 description="Run all the tests from the test directory to compare MJ and WSL" >
497 <record name="${log.file.tests.m}${time}.txt" emacsmode="true" />
498 <foreach param="filename" target="test-fn" inheritall="true">
499 <path>
500 <fileset dir='${samples.temp.dir}'>
501 <include name="*.obj"/>
502 </fileset>
503 </path>
504 </foreach>
505 <record name="${log.file.tests.m}${time}.txt" action="stop" />
506 <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
507 <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>
508 </target>
510 <target name="test-all-t" depends="init-compare,init-time"
511 description="Run all the tests from the test directory to compare WSL and transformations" >
512 <record name="${log.file.tests.t}${time}.txt" emacsmode="true" />
513 <foreach param="filename" target="test-fn-t">
514 <path>
515 <fileset dir='${samples.temp.dir}'>
516 <include name="*${transf.wsl.ext}"/>
517 </fileset>
518 </path>
519 </foreach>
520 <record name="${log.file.tests.t}${time}.txt" action="stop" />
521 <move file="${log.file.tests.t}.txt" tofile="${log.file.tests.t}-previous.txt" failonerror="false"/>
522 <copy file="${log.file.tests.t}${time}.txt" tofile="${log.file.tests.t}.txt"/>
523 </target>
525 <target name="q-test">
526 <!-- for quick tests -->
527 <antcall target="test-fn">
528 <param name="file.name" value="Rek1"/>
529 <param name="file.dir" value="${samples.temp.dir}"/>
530 </antcall>
531 </target>
534 <!-- **************************************** -->
535 <!-- metrics -->
536 <!-- **************************************** -->
538 <target name="metrics-compare-wsl">
539 <basename property="metrics.temp.name" file="${metrics.run.filename}" suffix="${transf.wsl.ext}"/>
540 <dirname property="metrics.temp.dir" file="${metrics.run.filename}"/>
541 <antcall target="wsl-run">
542 <param name="filename" value="${metrics.wsl.file}" />
543 <param name="args" value="-o ${metrics.temp.dir}/${metrics.temp.name}${metrics.extension} -c ${metrics.temp.dir}/${metrics.temp.name}.wsl ${metrics.temp.dir}/${metrics.temp.name}${transf.wsl.ext}" />
545 </antcall>
547 </target>
549 <target name="metrics-samples-compare-wsl" depends="init"
550 description="metrics on transformed wsl files (csv file)" >
552 <antcall target="wsl-run">
553 <param name="filename" value="${metrics.wsl.file}" />
554 <param name="args" value="-o ${samples.temp.dir}/0000-header${metrics.extension} -HC" />
556 </antcall>
558 <foreach param="metrics.run.filename" target="metrics-compare-wsl" parallel="true" maxthreads="${global.max.threads}">
559 <path>
560 <fileset dir='${samples.temp.dir}'>
561 <patternset refid="transformed.sources"/>
562 </fileset>
563 </path>
564 </foreach>
566 <concat destfile="${samples.temp.dir}/metrics-wsl-compare.csv">
567 <fileset dir="${samples.temp.dir}" includes="*${metrics.extension}"/>
568 </concat>
569 </target>
572 <!-- **************************************** -->
573 <!-- output serveral versions of files -->
574 <!-- **************************************** -->
576 <target name="output-all-versions"
577 description="generate variations on the translations in the 'local' folder and tar them">
578 <delete>
579 <fileset dir="local/out/"/>
580 </delete>
581 <mkdir dir="local/out"/>
582 <antcall>
583 <target name="mj-samples"/>
584 <target name="mjc2wsl-samples"/>
585 <param name="samples.temp.dir" value="local/out/headTail-proc"/>
586 <param name="mjc2wsl.options" value=""/>
587 </antcall>
588 <antcall>
589 <target name="mj-samples"/>
590 <target name="mjc2wsl-samples"/>
591 <param name="samples.temp.dir" value="local/out/headTail-inline"/>
592 <param name="mjc2wsl.options" value="--genInlinePrint"/>
593 </antcall>
594 <antcall>
595 <target name="mj-samples"/>
596 <target name="mjc2wsl-samples"/>
597 <param name="samples.temp.dir" value="local/out/popPush-inline"/>
598 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint"/>
599 </antcall>
600 <antcall>
601 <target name="mj-samples"/>
602 <target name="mjc2wsl-samples"/>
603 <param name="samples.temp.dir" value="local/out/popPush-proc"/>
604 <param name="mjc2wsl.options" value="--genPopPush"/>
605 </antcall>
606 <antcall>
607 <target name="mj-samples"/>
608 <target name="mjc2wsl-samples"/>
609 <param name="samples.temp.dir" value="local/out/popPush-glob"/>
610 <param name="mjc2wsl.options" value="--genPopPush --genGlobalVars"/>
611 </antcall>
612 <antcall>
613 <target name="mj-samples"/>
614 <target name="mjc2wsl-samples"/>
615 <param name="samples.temp.dir" value="local/out/popPush-loc-separate"/>
616 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint --genLocalsSeparate --genLocalVars"/>
617 </antcall>
618 <tar basedir="local/out" compression="gzip"
619 destfile="local/mjc2wsl-samples.tgz"
620 includes="*/*.wsl"/>
621 </target>
624 <!-- **************************************** -->
625 <!-- output a comparison Latex file and compile it -->
626 <!-- **************************************** -->
628 <target name="output-comparison-pdf-single">
629 <basename property="file.name" file="${filename}" suffix=".mj"/>
630 <echo append='true' file="${samples.temp.dir}/tex/comparison.tex">
631 \section{${file.name}}
632 \begin{paracol}{4}
633 \lstinputlisting[style=mj]{../${file.name}.mj}
634 \switchcolumn
635 \lstinputlisting[style=decoded]{../${file.name}.obj.decoded}
636 \switchcolumn
637 \lstinputlisting[style=wsl,lastline=200]{../${file.name}.wsl}
638 \switchcolumn
639 \lstinputlisting[style=wslt,lastline=200]{../${file.name}${transf.wsl.ext}}
640 \end{paracol}
641 </echo>
642 </target>
644 <target name="output-comparison-pdf"
645 description="Makes a parallel display in Latex and produces a pdf (tex dir in temp dir)" >
647 <copy file="lib/tex/comparison-start.tex" overwrite="true"
648 tofile="${samples.temp.dir}/tex/comparison.tex"/>
649 <foreach param="filename" target="output-comparison-pdf-single" inheritall="true">
650 <path>
651 <fileset dir='${samples.temp.dir}'>
652 <include name="*.mj"/>
653 </fileset>
654 </path>
655 </foreach>
656 <concat destfile="${samples.temp.dir}/tex/comparison.tex" append="true">
657 <filelist dir="lib/tex" files="comparison-end.tex"/>
658 </concat>
659 <antcall target="output-comparison-compile"/>
660 </target>
662 <target name="output-comparison-compile">
663 <exec command="pdflatex comparison.tex"
664 dir="${samples.temp.dir}/tex"/>
665 </target>
667 <!-- jedit specific flags; needs to be the first or the last 10 lines
668 :noTabs=true:
669 -->
670 </project>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner