gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
18119785ddfec52812743a528e0b80642ed3ee86
[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" />
51 <property name="samples.temp.dir" value="temp" />
53 <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
54 <property name="transf.wsl.ini" value="transf.ini" />
55 <property name="transf.wsl.ext" value="_t.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'
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 <!-- **************************************** -->
177 <!-- mjc2wsl related tasks -->
178 <!-- **************************************** -->
180 <target name="build" depends="init,update-version-string" description="build the mjc2wsl tool">
181 <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
182 <copy todir="${mjc2wsl.class.dir}">
183 <fileset dir="${res.dir}"/>
184 </copy>
185 </target>
187 <target name="mjc2wsl">
188 <echo message="${filename}" />
189 <java classpath="${mjc2wsl.class.dir}:${res.dir}" classname="${mjc2wsl.main}">
190 <arg line="${mjc2wsl.options}" />
191 <arg value="${filename}" />
192 </java>
193 </target>
195 <target name="mjc2wsl-samples" depends="build,init-time" description="run the mjc2wsl tool on the samples">
196 <record name="${log.file.mjc2wsl}${time}.txt" emacsmode="true" />
197 <echo>Used options:${mjc2wsl.options}</echo>
198 <foreach param="filename" target="mjc2wsl" parallel="true" maxthreads="${global.max.threads}">
199 <path>
200 <fileset dir='${samples.temp.dir}'>
201 <include name="*.obj"/>
202 </fileset>
203 </path>
204 </foreach>
205 <record name="${log.file.mjc2wsl}${time}.txt" action="stop" />
206 <copy file="${log.file.mjc2wsl}${time}.txt" tofile="${log.file.mjc2wsl}.txt"/>
207 </target>
209 <target name="mjc2wsl-samples1" depends="build">
210 <!-- simplistic version when antlib (foreach) is not available -->
211 <antcall target="mjc2wsl">
212 <param name="filename" value="samples-temp/sample0.obj" />
213 </antcall>
214 </target>
217 <!-- **************************************** -->
218 <!-- MicroJava related tasks -->
219 <!-- **************************************** -->
222 <target name="mj-build" depends="init" description="build the mj compiler">
223 <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
224 </target>
226 <target name="mj-compile" description="compile a MJ into obj file; given ${filename}">
227 <echo message="${filename}" />
228 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.compiler}">
229 <arg value="${filename}" />
230 </java>
231 </target>
233 <target name="mj-samples" description="run the mj compiler on the samples" depends="init">
234 <foreach param="filename" target="mj-compile" parallel="true" maxthreads="${global.max.threads}">
235 <path>
236 <fileset dir='${samples.temp.dir}'>
237 <include name="*.mj"/>
238 </fileset>
239 </path>
240 </foreach>
241 </target>
243 <target name="mj-decode" description="decode a MJ obj file given in ${filename}">
244 <echo message="${filename}" />
245 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
246 classname="${compiler.classname.decoder}"
247 output="${filename}.decoded" >
248 <arg value="${filename}" />
249 </java>
250 </target>
252 <target name="mj-decode-samples" description="decode all of the obj files in ${samples.temp.dir}">
253 <foreach param="filename" target="mj-decode">
254 <path>
255 <fileset dir='${samples.temp.dir}'>
256 <include name="*.obj"/>
257 </fileset>
258 </path>
259 </foreach>
260 </target>
262 <target name="mj-run" description="run a MJ obj file given in ${filename} with ${inputstring}">
263 <echo message="${filename}" />
264 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.interpreter}" inputstring="${inputstring}">
265 <arg value="${filename}" />
266 </java>
267 </target>
269 <target name="mj-samples1" depends="mj-build">
270 <!-- simplistic version when antlib (foreach) is not available -->
271 <antcall target="mj-compile">
272 <param name="filename" value="samples-temp/sample.mj" />
273 </antcall>
274 <antcall target="mj-compile">
275 <param name="filename" value="samples-temp/sample1.mj" />
276 </antcall>
277 <antcall target="mj-compile">
278 <param name="filename" value="samples-temp/sample0.mj" />
279 </antcall>
280 </target>
283 <!-- **************************************** -->
284 <!-- wsl related tasks -->
285 <!-- **************************************** -->
287 <target name="wsl-run" >
288 <property name="args" value=""/>
289 <property name="wslrun.workdir" value=""/>
290 <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}"
291 dir="${wslrun.workdir}" >
292 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
293 <env key="FermaT" path="${fermat.dir}" />
294 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
295 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
296 <arg line="${filename} ${args}"/>
297 </exec>
298 </target>
300 <target name="wsl-transf"
301 description="transform (simplify) a single wsl file generated by mjc2wsl">
302 <stopwatch name="transf-${transf.filename}" action="start"/>
303 <antcall target="wsl-run">
304 <param name="filename" value="${transf.wsl.file}" />
305 <param name="args" value="${transf.wsl.args} ${transf.filename}" />
306 </antcall>
307 <record name="${transf.filename}-time.txt" action="start" emacsmode="true"/>
308 <stopwatch name="transf-${transf.filename}" action="total"/>
309 <record name="${transf.filename}-time.txt" action="stop"/>
310 </target>
312 <target name="wsl-transf-samples" depends="init"
313 description="transform (simplify) the wsl files generated by mjc2wsl" >
314 <record name="${log.file.transformations}${time}.txt" emacsmode="true" />
315 <foreach param="transf.filename" target="wsl-transf" parallel="true" maxthreads="${global.max.threads}">
316 <path>
317 <fileset dir='${samples.temp.dir}'>
318 <patternset refid="non.transformed.sources"/>
319 <depth max="0"/>
320 </fileset>
321 </path>
322 </foreach>
323 <record name="${log.file.transformations}${time}.txt" action="stop" />
324 <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
325 </target>
327 <target name="wsl-transf-samples-ini" depends="init-time,make-transf-ini-samples"
328 description="transform (simplify) the wsl files generated by mjc2wsl - uses ini file">
329 <record name="${log.file.transformations}${time}i.txt" emacsmode="true" />
330 <antcall target="wsl-run">
331 <param name="filename" value="${transf.wsl.file}" />
332 </antcall>
333 <record name="${log.file.transformations}${time}i.txt" action="stop" />
334 <copy file="${log.file.transformations}${time}i.txt" tofile="${log.file.transformations}.txt"/>
335 </target>
337 <target name="make-transf-ini-samples">
338 <fileset dir="${samples.temp.dir}" casesensitive="no" id="generated-wsl-fileset">
339 <patternset refid="non.transformed.sources"/>
340 </fileset>
341 <pathconvert pathsep="${line.separator}"
342 property="generated-wsl-files" refid="generated-wsl-fileset" />
344 <echo file="${transf.wsl.ini}">${generated-wsl-files}</echo>
345 </target>
348 <!-- **************************************** -->
349 <!-- Testing tasks -->
350 <!-- **************************************** -->
352 <target name="manual-test-run"
353 description="run .obj .wsl ${transf.wsl.ext}, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
354 <record name="${file.dir}/${file.name}.out1" emacsmode="true" />
355 <antcall target="mj-run">
356 <param name="filename" value="${file.dir}/${file.name}.obj" />
357 <param name="inputstring" value="${inputstring}" />
358 </antcall>
359 <record name="${file.dir}/${file.name}.out1" action="stop" />
360 <record name="${file.dir}/${file.name}.out2" emacsmode="true" />
361 <antcall target="wsl-run">
362 <param name="filename" value="${file.dir}/${file.name}.wsl" />
363 <param name="inputstring" value="${inputstring}" />
364 </antcall>
365 <record name="${file.dir}/${file.name}.out2" action="stop" />
366 <record name="${file.dir}/${file.name}.out3" emacsmode="true" />
367 <antcall target="wsl-run">
368 <param name="filename" value="${file.dir}/${file.name}${transf.wsl.ext}" />
369 <param name="inputstring" value="${inputstring}" />
370 </antcall>
371 <record name="${file.dir}/${file.name}.out3" action="stop" />
372 </target>
374 <target name="manual-test-run-samples-dir"
375 description="run .obj .wsl ${transf.wsl.ext}, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
376 <antcall target="manual-test-run">
377 <param name="file.dir" value="${samples.temp.dir}"/>
378 </antcall>
379 </target>
381 <target name="init-compare">
382 <mkdir dir="${samples.temp.dir}/outputs"/>
383 </target>
385 <target name="test-m-w">
387 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
389 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
390 classname="${compiler.classname.interpreter}"
391 input="${inputfile}"
392 error="${samples.temp.dir}/outputs/${file.out}.errmj"
393 output="${samples.temp.dir}/outputs/${file.out}.outmj">
394 <arg value="${file.dir}/${file.name}.obj" />
395 </java>
397 <exec executable="${fermat.dir}/bin/wsl"
398 input="${inputfile}"
399 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
400 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
401 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
402 <env key="FermaT" path="${fermat.dir}" />
403 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
404 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
405 <arg value="${file.dir}/${file.name}.wsl"/>
406 </exec>
408 <exec executable="perl" resultproperty="ook">
409 <arg value="lib/compare-m-w.pl"/>
410 <arg value="${file.dir}/outputs"/>
411 <arg value="${file.out}"/>
412 </exec>
414 </target>
416 <target name="test-w-wt">
418 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
420 <exec executable="${fermat.dir}/bin/wsl"
421 input="${inputfile}"
422 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
423 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
424 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
425 <env key="FermaT" path="${fermat.dir}" />
426 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
427 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
428 <arg value="${file.dir}/${file.name}.wsl"/>
429 </exec>
431 <exec executable="${fermat.dir}/bin/wsl"
432 input="${inputfile}"
433 error="${samples.temp.dir}/outputs/${file.out}.errwslt"
434 output="${samples.temp.dir}/outputs/${file.out}.outwslt" >
435 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
436 <env key="FermaT" path="${fermat.dir}" />
437 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
438 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
439 <arg value="${file.dir}/${file.name}${transf.wsl.ext}"/>
440 </exec>
442 <exec executable="perl">
443 <arg value="lib/compare-w-wt.pl"/>
444 <arg value="${file.dir}/outputs"/>
445 <arg value="${file.out}"/>
446 </exec>
447 </target>
449 <target name="test-fn">
450 <basename property="file.name" file="${filename}" suffix=".obj"/>
451 <dirname property="file.dir" file="${filename}"/>
452 <foreach param="inputfile" target="test-m-w" inheritall="true">
453 <path>
454 <fileset dir='${tests.dir}'>
455 <include name="${file.name}*.txt"/>
456 </fileset>
457 </path>
458 </foreach>
459 </target>
461 <target name="test-fn-t">
462 <basename property="file.name" file="${filename}" suffix="${transf.wsl.ext}"/>
463 <dirname property="file.dir" file="${filename}"/>
464 <foreach param="inputfile" target="test-w-wt" inheritall="true">
465 <path>
466 <fileset dir='${tests.dir}'>
467 <include name="${file.name}*.txt"/>
468 </fileset>
469 </path>
470 </foreach>
471 </target>
473 <target name="test-all-m" depends="init-compare,init-time"
474 description="Run all the tests from the test directory to compare MJ and WSL" >
475 <record name="${log.file.tests.m}${time}.txt" emacsmode="true" />
476 <foreach param="filename" target="test-fn" inheritall="true">
477 <path>
478 <fileset dir='${samples.temp.dir}'>
479 <include name="*.obj"/>
480 </fileset>
481 </path>
482 </foreach>
483 <record name="${log.file.tests.m}${time}.txt" action="stop" />
484 <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
485 <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>
486 </target>
488 <target name="test-all-t" depends="init-compare,init-time"
489 description="Run all the tests from the test directory to compare WSL and transformations" >
490 <record name="${log.file.tests.t}${time}.txt" emacsmode="true" />
491 <foreach param="filename" target="test-fn-t">
492 <path>
493 <fileset dir='${samples.temp.dir}'>
494 <include name="*${transf.wsl.ext}"/>
495 </fileset>
496 </path>
497 </foreach>
498 <record name="${log.file.tests.t}${time}.txt" action="stop" />
499 <move file="${log.file.tests.t}.txt" tofile="${log.file.tests.t}-previous.txt" failonerror="false"/>
500 <copy file="${log.file.tests.t}${time}.txt" tofile="${log.file.tests.t}.txt"/>
501 </target>
503 <target name="q-test">
504 <!-- for quick tests -->
505 <antcall target="test-fn">
506 <param name="file.name" value="Rek1"/>
507 <param name="file.dir" value="${samples.temp.dir}"/>
508 </antcall>
509 </target>
512 <!-- **************************************** -->
513 <!-- metrics -->
514 <!-- **************************************** -->
516 <target name="metrics-compare-wsl">
517 <basename property="metrics.temp.name" file="${metrics.run.filename}" suffix="${transf.wsl.ext}"/>
518 <dirname property="metrics.temp.dir" file="${metrics.run.filename}"/>
519 <antcall target="wsl-run">
520 <param name="filename" value="${metrics.wsl.file}" />
521 <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}" />
523 </antcall>
525 </target>
527 <target name="metrics-samples-compare-wsl" depends="init"
528 description="metrics on transformed wsl files (csv file)" >
530 <antcall target="wsl-run">
531 <param name="filename" value="${metrics.wsl.file}" />
532 <param name="args" value="-o ${samples.temp.dir}/0000-header${metrics.extension} -HC" />
534 </antcall>
536 <foreach param="metrics.run.filename" target="metrics-compare-wsl" parallel="true" maxthreads="${global.max.threads}">
537 <path>
538 <fileset dir='${samples.temp.dir}'>
539 <patternset refid="transformed.sources"/>
540 </fileset>
541 </path>
542 </foreach>
544 <concat destfile="${samples.temp.dir}/metrics-wsl-compare.csv">
545 <fileset dir="${samples.temp.dir}" includes="*${metrics.extension}"/>
546 </concat>
547 </target>
550 <!-- **************************************** -->
551 <!-- output serveral versions of files -->
552 <!-- **************************************** -->
554 <target name="output-all-versions"
555 description="generate variations on the translations in the 'local' folder and tar them">
556 <delete>
557 <fileset dir="local/out/"/>
558 </delete>
559 <mkdir dir="local/out"/>
560 <antcall>
561 <target name="mj-samples"/>
562 <target name="mjc2wsl-samples"/>
563 <param name="samples.temp.dir" value="local/out/headTail-proc"/>
564 <param name="mjc2wsl.options" value=""/>
565 </antcall>
566 <antcall>
567 <target name="mj-samples"/>
568 <target name="mjc2wsl-samples"/>
569 <param name="samples.temp.dir" value="local/out/headTail-inline"/>
570 <param name="mjc2wsl.options" value="--genInlinePrint"/>
571 </antcall>
572 <antcall>
573 <target name="mj-samples"/>
574 <target name="mjc2wsl-samples"/>
575 <param name="samples.temp.dir" value="local/out/popPush-inline"/>
576 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint"/>
577 </antcall>
578 <antcall>
579 <target name="mj-samples"/>
580 <target name="mjc2wsl-samples"/>
581 <param name="samples.temp.dir" value="local/out/popPush-proc"/>
582 <param name="mjc2wsl.options" value="--genPopPush"/>
583 </antcall>
584 <antcall>
585 <target name="mj-samples"/>
586 <target name="mjc2wsl-samples"/>
587 <param name="samples.temp.dir" value="local/out/popPush-glob"/>
588 <param name="mjc2wsl.options" value="--genPopPush --genGlobalVars"/>
589 </antcall>
590 <antcall>
591 <target name="mj-samples"/>
592 <target name="mjc2wsl-samples"/>
593 <param name="samples.temp.dir" value="local/out/popPush-loc-separate"/>
594 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint --genLocalsSeparate --genLocalVars"/>
595 </antcall>
596 <tar basedir="local/out" compression="gzip"
597 destfile="local/mjc2wsl-samples.tgz"
598 includes="*/*.wsl"/>
599 </target>
602 <!-- **************************************** -->
603 <!-- output a comparison Latex file and compile it -->
604 <!-- **************************************** -->
606 <target name="output-comparison-pdf-single">
607 <basename property="file.name" file="${filename}" suffix=".mj"/>
608 <echo append='true' file="${samples.temp.dir}/tex/comparison.tex">
609 \section{${file.name}}
610 \begin{paracol}{4}
611 \lstinputlisting[style=mj]{../${file.name}.mj}
612 \switchcolumn
613 \lstinputlisting[style=decoded]{../${file.name}.obj.decoded}
614 \switchcolumn
615 \lstinputlisting[style=wsl,lastline=200]{../${file.name}.wsl}
616 \switchcolumn
617 \lstinputlisting[style=wslt,lastline=200]{../${file.name}${transf.wsl.ext}}
618 \end{paracol}
619 </echo>
620 </target>
622 <target name="output-comparison-pdf"
623 description="Makes a parallel display in Latex and produces a pdf (tex dir in temp dir)" >
625 <copy file="lib/tex/comparison-start.tex" overwrite="true"
626 tofile="${samples.temp.dir}/tex/comparison.tex"/>
627 <foreach param="filename" target="output-comparison-pdf-single" inheritall="true">
628 <path>
629 <fileset dir='${samples.temp.dir}'>
630 <include name="*.mj"/>
631 </fileset>
632 </path>
633 </foreach>
634 <concat destfile="${samples.temp.dir}/tex/comparison.tex" append="true">
635 <filelist dir="lib/tex" files="comparison-end.tex"/>
636 </concat>
637 <antcall target="output-comparison-compile"/>
638 </target>
640 <target name="output-comparison-compile">
641 <exec command="pdflatex comparison.tex"
642 dir="${samples.temp.dir}/tex"/>
643 </target>
645 <!-- jedit specific flags; needs to be the first or the last 10 lines
646 :noTabs=true:
647 -->
648 </project>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner