gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
rename main class to Mjc2wsl
[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">
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 </target>
309 <target name="wsl-transf-samples" depends="init"
310 description="transform (simplify) the wsl files generated by mjc2wsl" >
311 <record name="${log.file.transformations}${time}.txt" emacsmode="true" />
312 <foreach param="transf.filename" target="wsl-transf" parallel="true" maxthreads="${global.max.threads}">
313 <path>
314 <fileset dir='${samples.temp.dir}'>
315 <patternset refid="non.transformed.sources"/>
316 <depth max="0"/>
317 </fileset>
318 </path>
319 </foreach>
320 <record name="${log.file.transformations}${time}.txt" action="stop" />
321 <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
322 </target>
324 <target name="wsl-transf-samples-ini" depends="init-time,make-transf-ini-samples"
325 description="transform (simplify) the wsl files generated by mjc2wsl - uses ini file">
326 <record name="${log.file.transformations}${time}i.txt" emacsmode="true" />
327 <antcall target="wsl-run">
328 <param name="filename" value="${transf.wsl.file}" />
329 </antcall>
330 <record name="${log.file.transformations}${time}i.txt" action="stop" />
331 <copy file="${log.file.transformations}${time}i.txt" tofile="${log.file.transformations}.txt"/>
332 </target>
334 <target name="make-transf-ini-samples">
335 <fileset dir="${samples.temp.dir}" casesensitive="no" id="generated-wsl-fileset">
336 <patternset refid="non.transformed.sources"/>
337 </fileset>
338 <pathconvert pathsep="${line.separator}"
339 property="generated-wsl-files" refid="generated-wsl-fileset" />
341 <echo file="${transf.wsl.ini}">${generated-wsl-files}</echo>
342 </target>
345 <!-- **************************************** -->
346 <!-- Testing tasks -->
347 <!-- **************************************** -->
349 <target name="manual-test-run"
350 description="run .obj .wsl ${transf.wsl.ext}, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
351 <record name="${file.dir}/${file.name}.out1" emacsmode="true" />
352 <antcall target="mj-run">
353 <param name="filename" value="${file.dir}/${file.name}.obj" />
354 <param name="inputstring" value="${inputstring}" />
355 </antcall>
356 <record name="${file.dir}/${file.name}.out1" action="stop" />
357 <record name="${file.dir}/${file.name}.out2" emacsmode="true" />
358 <antcall target="wsl-run">
359 <param name="filename" value="${file.dir}/${file.name}.wsl" />
360 <param name="inputstring" value="${inputstring}" />
361 </antcall>
362 <record name="${file.dir}/${file.name}.out2" action="stop" />
363 <record name="${file.dir}/${file.name}.out3" emacsmode="true" />
364 <antcall target="wsl-run">
365 <param name="filename" value="${file.dir}/${file.name}${transf.wsl.ext}" />
366 <param name="inputstring" value="${inputstring}" />
367 </antcall>
368 <record name="${file.dir}/${file.name}.out3" action="stop" />
369 </target>
371 <target name="manual-test-run-samples-dir"
372 description="run .obj .wsl ${transf.wsl.ext}, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
373 <antcall target="manual-test-run">
374 <param name="file.dir" value="${samples.temp.dir}"/>
375 </antcall>
376 </target>
378 <target name="init-compare">
379 <mkdir dir="${samples.temp.dir}/outputs"/>
380 </target>
382 <target name="test-m-w">
384 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
386 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
387 classname="${compiler.classname.interpreter}"
388 input="${inputfile}"
389 error="${samples.temp.dir}/outputs/${file.out}.errmj"
390 output="${samples.temp.dir}/outputs/${file.out}.outmj">
391 <arg value="${file.dir}/${file.name}.obj" />
392 </java>
394 <exec executable="${fermat.dir}/bin/wsl"
395 input="${inputfile}"
396 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
397 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
398 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
399 <env key="FermaT" path="${fermat.dir}" />
400 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
401 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
402 <arg value="${file.dir}/${file.name}.wsl"/>
403 </exec>
405 <exec executable="perl" resultproperty="ook">
406 <arg value="lib/compare-m-w.pl"/>
407 <arg value="${file.dir}/outputs"/>
408 <arg value="${file.out}"/>
409 </exec>
411 </target>
413 <target name="test-w-wt">
415 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
417 <exec executable="${fermat.dir}/bin/wsl"
418 input="${inputfile}"
419 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
420 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
421 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
422 <env key="FermaT" path="${fermat.dir}" />
423 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
424 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
425 <arg value="${file.dir}/${file.name}.wsl"/>
426 </exec>
428 <exec executable="${fermat.dir}/bin/wsl"
429 input="${inputfile}"
430 error="${samples.temp.dir}/outputs/${file.out}.errwslt"
431 output="${samples.temp.dir}/outputs/${file.out}.outwslt" >
432 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
433 <env key="FermaT" path="${fermat.dir}" />
434 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
435 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
436 <arg value="${file.dir}/${file.name}${transf.wsl.ext}"/>
437 </exec>
439 <exec executable="perl">
440 <arg value="lib/compare-w-wt.pl"/>
441 <arg value="${file.dir}/outputs"/>
442 <arg value="${file.out}"/>
443 </exec>
444 </target>
446 <target name="test-fn">
447 <basename property="file.name" file="${filename}" suffix=".obj"/>
448 <dirname property="file.dir" file="${filename}"/>
449 <foreach param="inputfile" target="test-m-w" inheritall="true">
450 <path>
451 <fileset dir='${tests.dir}'>
452 <include name="${file.name}*.txt"/>
453 </fileset>
454 </path>
455 </foreach>
456 </target>
458 <target name="test-fn-t">
459 <basename property="file.name" file="${filename}" suffix="${transf.wsl.ext}"/>
460 <dirname property="file.dir" file="${filename}"/>
461 <foreach param="inputfile" target="test-w-wt" inheritall="true">
462 <path>
463 <fileset dir='${tests.dir}'>
464 <include name="${file.name}*.txt"/>
465 </fileset>
466 </path>
467 </foreach>
468 </target>
470 <target name="test-all-m" depends="init-compare,init-time"
471 description="Run all the tests from the test directory to compare MJ and WSL" >
472 <record name="${log.file.tests.m}${time}.txt" emacsmode="true" />
473 <foreach param="filename" target="test-fn" inheritall="true">
474 <path>
475 <fileset dir='${samples.temp.dir}'>
476 <include name="*.obj"/>
477 </fileset>
478 </path>
479 </foreach>
480 <record name="${log.file.tests.m}${time}.txt" action="stop" />
481 <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
482 <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>
483 </target>
485 <target name="test-all-t" depends="init-compare,init-time"
486 description="Run all the tests from the test directory to compare WSL and transformations" >
487 <record name="${log.file.tests.t}${time}.txt" emacsmode="true" />
488 <foreach param="filename" target="test-fn-t">
489 <path>
490 <fileset dir='${samples.temp.dir}'>
491 <include name="*${transf.wsl.ext}"/>
492 </fileset>
493 </path>
494 </foreach>
495 <record name="${log.file.tests.t}${time}.txt" action="stop" />
496 <move file="${log.file.tests.t}.txt" tofile="${log.file.tests.t}-previous.txt" failonerror="false"/>
497 <copy file="${log.file.tests.t}${time}.txt" tofile="${log.file.tests.t}.txt"/>
498 </target>
500 <target name="q-test">
501 <!-- for quick tests -->
502 <antcall target="test-fn">
503 <param name="file.name" value="Rek1"/>
504 <param name="file.dir" value="${samples.temp.dir}"/>
505 </antcall>
506 </target>
509 <!-- **************************************** -->
510 <!-- metrics -->
511 <!-- **************************************** -->
513 <target name="metrics-compare-wsl">
514 <basename property="metrics.temp.name" file="${metrics.run.filename}" suffix="${transf.wsl.ext}"/>
515 <dirname property="metrics.temp.dir" file="${metrics.run.filename}"/>
516 <antcall target="wsl-run">
517 <param name="filename" value="${metrics.wsl.file}" />
518 <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}" />
520 </antcall>
522 </target>
524 <target name="metrics-samples-compare-wsl" depends="init"
525 description="metrics on transformed wsl files (csv file)" >
527 <antcall target="wsl-run">
528 <param name="filename" value="${metrics.wsl.file}" />
529 <param name="args" value="-o ${samples.temp.dir}/0000-header${metrics.extension} -HC" />
531 </antcall>
533 <foreach param="metrics.run.filename" target="metrics-compare-wsl" parallel="true" maxthreads="${global.max.threads}">
534 <path>
535 <fileset dir='${samples.temp.dir}'>
536 <patternset refid="transformed.sources"/>
537 </fileset>
538 </path>
539 </foreach>
541 <concat destfile="${samples.temp.dir}/metrics-wsl-compare.csv">
542 <fileset dir="${samples.temp.dir}" includes="*${metrics.extension}"/>
543 </concat>
544 </target>
547 <!-- **************************************** -->
548 <!-- output serveral versions of files -->
549 <!-- **************************************** -->
551 <target name="output-all-versions"
552 description="generate variations on the translations in the 'local' folder and tar them">
553 <delete>
554 <fileset dir="local/out/"/>
555 </delete>
556 <mkdir dir="local/out"/>
557 <antcall>
558 <target name="mj-samples"/>
559 <target name="mjc2wsl-samples"/>
560 <param name="samples.temp.dir" value="local/out/headTail-proc"/>
561 <param name="mjc2wsl.options" value=""/>
562 </antcall>
563 <antcall>
564 <target name="mj-samples"/>
565 <target name="mjc2wsl-samples"/>
566 <param name="samples.temp.dir" value="local/out/headTail-inline"/>
567 <param name="mjc2wsl.options" value="--genInlinePrint"/>
568 </antcall>
569 <antcall>
570 <target name="mj-samples"/>
571 <target name="mjc2wsl-samples"/>
572 <param name="samples.temp.dir" value="local/out/popPush-inline"/>
573 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint"/>
574 </antcall>
575 <antcall>
576 <target name="mj-samples"/>
577 <target name="mjc2wsl-samples"/>
578 <param name="samples.temp.dir" value="local/out/popPush-proc"/>
579 <param name="mjc2wsl.options" value="--genPopPush"/>
580 </antcall>
581 <antcall>
582 <target name="mj-samples"/>
583 <target name="mjc2wsl-samples"/>
584 <param name="samples.temp.dir" value="local/out/popPush-glob"/>
585 <param name="mjc2wsl.options" value="--genPopPush --genGlobalVars"/>
586 </antcall>
587 <antcall>
588 <target name="mj-samples"/>
589 <target name="mjc2wsl-samples"/>
590 <param name="samples.temp.dir" value="local/out/popPush-loc-separate"/>
591 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint --genLocalsSeparate --genLocalVars"/>
592 </antcall>
593 <tar basedir="local/out" compression="gzip"
594 destfile="local/mjc2wsl-samples.tgz"
595 includes="*/*.wsl"/>
596 </target>
599 <!-- **************************************** -->
600 <!-- output a comparison Latex file and compile it -->
601 <!-- **************************************** -->
603 <target name="output-comparison-pdf-single">
604 <basename property="file.name" file="${filename}" suffix=".mj"/>
605 <echo append='true' file="${samples.temp.dir}/tex/comparison.tex">
606 \section{${file.name}}
607 \begin{paracol}{4}
608 \lstinputlisting[style=mj]{../${file.name}.mj}
609 \switchcolumn
610 \lstinputlisting[style=decoded]{../${file.name}.obj.decoded}
611 \switchcolumn
612 \lstinputlisting[style=wsl,lastline=200]{../${file.name}.wsl}
613 \switchcolumn
614 \lstinputlisting[style=wslt,lastline=200]{../${file.name}${transf.wsl.ext}}
615 \end{paracol}
616 </echo>
617 </target>
619 <target name="output-comparison-pdf"
620 description="Makes a parallel display in Latex and produces a pdf (tex dir in temp dir)" >
622 <copy file="lib/tex/comparison-start.tex" overwrite="true"
623 tofile="${samples.temp.dir}/tex/comparison.tex"/>
624 <foreach param="filename" target="output-comparison-pdf-single" inheritall="true">
625 <path>
626 <fileset dir='${samples.temp.dir}'>
627 <include name="*.mj"/>
628 </fileset>
629 </path>
630 </foreach>
631 <concat destfile="${samples.temp.dir}/tex/comparison.tex" append="true">
632 <filelist dir="lib/tex" files="comparison-end.tex"/>
633 </concat>
634 <antcall target="output-comparison-compile"/>
635 </target>
637 <target name="output-comparison-compile">
638 <exec command="pdflatex comparison.tex"
639 dir="${samples.temp.dir}/tex"/>
640 </target>
642 <!-- jedit specific flags; needs to be the first or the last 10 lines
643 :noTabs=true:
644 -->
645 </project>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner