gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
MJInput, move the properties file to the proper package
[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="" />
39 <property name="res.dir" value="res" />
40 <property name="dist.dir" value="dist" />
42 <property name="compiler.class.jar" value="lib/mj.jar" />
43 <property name="compiler.class.dir" value="lib/compiler-bin" />
44 <property name="compiler.src.dir" value="lib/compiler-src" />
45 <property name="compiler.classname.compiler" value="MJ.Compiler" />
46 <property name="compiler.classname.interpreter" value="MJ.Run" />
47 <property name="compiler.classname.decoder" value="MJ.Decode" />
49 <property name="samples.main.dir" value="samples" />
50 <property name="samples.temp.dir" value="temp" />
52 <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
53 <property name="transf.wsl.ini" value="transf.ini" />
54 <property name="transf.wsl.ext" value="_t.wsl" />
55 <!-- args can be used to send additional arguments to a script -->
56 <property name="transf.wsl.args" value="" />
58 <property name="metrics.wsl.file" value="src-wsl/metrics_csv.wsl" />
59 <property name="metrics.extension" value=".met" />
61 <property name="tests.dir" value="tests" />
63 <property name="log.dir" value="${basedir}/logs" />
64 <property name="log.file.transformations" value="${log.dir}/transformations" />
65 <property name="log.file.mjc2wsl" value="${log.dir}/mjc2wsl" />
66 <property name="log.file.tests.m" value="${log.dir}/tests-mj" />
67 <property name="log.file.tests.t" value="${log.dir}/tests-wsl" />
69 <property name="version.file" value="${res.dir}/com/quemaster/transformations/mjc2wsl/version.properties" />
71 <!-- **************************************** -->
72 <!-- patterns -->
73 <!-- **************************************** -->
75 <patternset id="non.transformed.sources">
76 <include name="**/*.wsl"/>
77 <exclude name="**/*${transf.wsl.ext}"/>
78 </patternset>
80 <patternset id="transformed.sources">
81 <include name="**/*${transf.wsl.ext}"/>
82 </patternset>
84 <!-- **************************************** -->
85 <!-- general tasks -->
86 <!-- **************************************** -->
88 <target name="init" depends="init-time">
89 <mkdir dir="${mjc2wsl.class.dir}"/>
90 <mkdir dir="${compiler.class.dir}"/>
91 <mkdir dir="${samples.temp.dir}"/>
92 <mkdir dir="${log.dir}"/>
93 <mkdir dir="${dist.dir}"/>
94 <copy todir="${samples.temp.dir}">
95 <fileset dir="${samples.main.dir}">
96 <include name="*.mj"/>
97 </fileset>
98 </copy>
99 </target>
101 <target name="init-time">
102 <tstamp>
103 <format property="time" pattern="yy-MM-dd--HH-mm-ss-SSS"/>
104 </tstamp>
105 </target>
107 <target name="all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples'
108 description="build the tools, run them on the samples to check">
110 </target>
112 <target name="clean" description="clean up all the generated content">
113 <delete includeemptydirs="true">
114 <fileset dir="${mjc2wsl.class.dir}"/>
115 <fileset dir="${compiler.class.dir}"/>
116 <fileset dir="${samples.temp.dir}"/>
117 <fileset dir="${log.dir}"/>
118 </delete>
119 </target>
121 <target name="pack.jar" depends="build,update-version-string"
122 description="Packs the binaries in a jar and place it in ${dist.dir}">
124 <mkdir dir="${dist.dir}"/>
125 <jar destfile="${dist.dir}/mjc2wsl.jar"
126 includes="**">
127 <manifest>
128 <attribute name="Built-By" value="${user.name}"/>
129 <attribute name="Implementation-Vendor"
130 value="Doni Pracner"/>
131 <attribute name="Implementation-Title"
132 value="MicroJava bytecode to WSL"/>
133 <attribute name="Implementation-Version" value="${version}"/>
134 <attribute name="Main-Class" value="com.quemaster.transformations.mjc2wsl.mjc2wsl"/>
135 </manifest>
136 <fileset dir="${mjc2wsl.class.dir}"/>
137 </jar>
139 </target>
141 <!-- **************************************** -->
142 <!-- version tasks
143 based on ideas by Jesper Öqvist http://llbit.se/?p=1876 -->
144 <!-- **************************************** -->
146 <!-- this target is only run if the 'version' property is undefined -->
148 <target name="update-version-string" unless="version">
149 <!-- get a new version string using git describe if possible -->
150 <echo message="Updating version string..."/>
151 <exec executable="git" outputproperty="version"
152 failifexecutionfails="false">
153 <arg value="describe"/>
154 </exec>
155 <antcall target="-store-version-string"/>
156 <!-- ensure version is defined even if git was not available -->
157 <property file="${version.file}"/>
158 </target>
160 <target name="-store-version-string" if="version">
161 <!-- store the new version string in the correct property file -->
162 <echo message="version=${version}"/>
163 <dirname file="${version.file}" property="version.file.dir"/>
164 <mkdir dir="${version.file.dir}" />
165 <propertyfile file="${version.file}">
166 <entry key="version" value="${version}"/>
167 </propertyfile>
168 <exec executable="git" failifexecutionfails="false">
169 <arg value="update-index"/>
170 <arg value="--assume-unchanged"/>
171 <arg value="${version.file}"/>
172 </exec>
173 </target>
175 <!-- **************************************** -->
176 <!-- mjc2wsl related tasks -->
177 <!-- **************************************** -->
179 <target name="build" depends="init,update-version-string" description="build the mjc2wsl tool">
180 <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
181 <copy todir="${mjc2wsl.class.dir}">
182 <fileset dir="${res.dir}"/>
183 </copy>
184 </target>
186 <target name="mjc2wsl">
187 <echo message="${filename}" />
188 <java classpath="${mjc2wsl.class.dir}:${res.dir}" classname="com.quemaster.transformations.mjc2wsl.mjc2wsl">
189 <arg line="${mjc2wsl.options}" />
190 <arg value="${filename}" />
191 </java>
192 </target>
194 <target name="mjc2wsl-samples" depends="build,init-time" description="run the mjc2wsl tool on the samples">
195 <record name="${log.file.mjc2wsl}${time}.txt" emacsmode="true" />
196 <echo>Used options:${mjc2wsl.options}</echo>
197 <foreach param="filename" target="mjc2wsl" parallel="true" maxthreads="${global.max.threads}">
198 <path>
199 <fileset dir='${samples.temp.dir}'>
200 <include name="*.obj"/>
201 </fileset>
202 </path>
203 </foreach>
204 <record name="${log.file.mjc2wsl}${time}.txt" action="stop" />
205 <copy file="${log.file.mjc2wsl}${time}.txt" tofile="${log.file.mjc2wsl}.txt"/>
206 </target>
208 <target name="mjc2wsl-samples1" depends="build">
209 <!-- simplistic version when antlib (foreach) is not available -->
210 <antcall target="mjc2wsl">
211 <param name="filename" value="samples-temp/sample0.obj" />
212 </antcall>
213 </target>
216 <!-- **************************************** -->
217 <!-- MicroJava related tasks -->
218 <!-- **************************************** -->
221 <target name="mj-build" depends="init" description="build the mj compiler">
222 <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
223 </target>
225 <target name="mj-compile" description="compile a MJ into obj file; given ${filename}">
226 <echo message="${filename}" />
227 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.compiler}">
228 <arg value="${filename}" />
229 </java>
230 </target>
232 <target name="mj-samples" description="run the mj compiler on the samples" depends="init">
233 <foreach param="filename" target="mj-compile" parallel="true" maxthreads="${global.max.threads}">
234 <path>
235 <fileset dir='${samples.temp.dir}'>
236 <include name="*.mj"/>
237 </fileset>
238 </path>
239 </foreach>
240 </target>
242 <target name="mj-decode" description="decode a MJ obj file given in ${filename}">
243 <echo message="${filename}" />
244 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
245 classname="${compiler.classname.decoder}"
246 output="${filename}.decoded" >
247 <arg value="${filename}" />
248 </java>
249 </target>
251 <target name="mj-decode-samples" description="decode all of the obj files in ${samples.temp.dir}">
252 <foreach param="filename" target="mj-decode">
253 <path>
254 <fileset dir='${samples.temp.dir}'>
255 <include name="*.obj"/>
256 </fileset>
257 </path>
258 </foreach>
259 </target>
261 <target name="mj-run" description="run a MJ obj file given in ${filename} with ${inputstring}">
262 <echo message="${filename}" />
263 <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.interpreter}" inputstring="${inputstring}">
264 <arg value="${filename}" />
265 </java>
266 </target>
268 <target name="mj-samples1" depends="mj-build">
269 <!-- simplistic version when antlib (foreach) is not available -->
270 <antcall target="mj-compile">
271 <param name="filename" value="samples-temp/sample.mj" />
272 </antcall>
273 <antcall target="mj-compile">
274 <param name="filename" value="samples-temp/sample1.mj" />
275 </antcall>
276 <antcall target="mj-compile">
277 <param name="filename" value="samples-temp/sample0.mj" />
278 </antcall>
279 </target>
282 <!-- **************************************** -->
283 <!-- wsl related tasks -->
284 <!-- **************************************** -->
286 <target name="wsl-run" >
287 <property name="args" value=""/>
288 <property name="wslrun.workdir" value=""/>
289 <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}"
290 dir="${wslrun.workdir}" >
291 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
292 <env key="FermaT" path="${fermat.dir}" />
293 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
294 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
295 <arg line="${filename} ${args}"/>
296 </exec>
297 </target>
299 <target name="wsl-transf"
300 description="transform (simplify) a single wsl file generated by mjc2wsl">
302 <antcall target="wsl-run">
303 <param name="filename" value="${transf.wsl.file}" />
304 <param name="args" value="${transf.wsl.args} ${transf.filename}" />
305 </antcall>
306 </target>
308 <target name="wsl-transf-samples" depends="init"
309 description="transform (simplify) the wsl files generated by mjc2wsl" >
310 <record name="${log.file.transformations}${time}.txt" emacsmode="true" />
311 <foreach param="transf.filename" target="wsl-transf" parallel="true" maxthreads="${global.max.threads}">
312 <path>
313 <fileset dir='${samples.temp.dir}'>
314 <patternset refid="non.transformed.sources"/>
315 <depth max="0"/>
316 </fileset>
317 </path>
318 </foreach>
319 <record name="${log.file.transformations}${time}.txt" action="stop" />
320 <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
321 </target>
323 <target name="wsl-transf-samples-ini" depends="init-time,make-transf-ini-samples"
324 description="transform (simplify) the wsl files generated by mjc2wsl - uses ini file">
325 <record name="${log.file.transformations}${time}i.txt" emacsmode="true" />
326 <antcall target="wsl-run">
327 <param name="filename" value="${transf.wsl.file}" />
328 </antcall>
329 <record name="${log.file.transformations}${time}i.txt" action="stop" />
330 <copy file="${log.file.transformations}${time}i.txt" tofile="${log.file.transformations}.txt"/>
331 </target>
333 <target name="make-transf-ini-samples">
334 <fileset dir="${samples.temp.dir}" casesensitive="no" id="generated-wsl-fileset">
335 <patternset refid="non.transformed.sources"/>
336 </fileset>
337 <pathconvert pathsep="${line.separator}"
338 property="generated-wsl-files" refid="generated-wsl-fileset" />
340 <echo file="${transf.wsl.ini}">${generated-wsl-files}</echo>
341 </target>
344 <!-- **************************************** -->
345 <!-- Testing tasks -->
346 <!-- **************************************** -->
348 <target name="manual-test-run"
349 description="run .obj .wsl ${transf.wsl.ext}, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
350 <record name="${file.dir}/${file.name}.out1" emacsmode="true" />
351 <antcall target="mj-run">
352 <param name="filename" value="${file.dir}/${file.name}.obj" />
353 <param name="inputstring" value="${inputstring}" />
354 </antcall>
355 <record name="${file.dir}/${file.name}.out1" action="stop" />
356 <record name="${file.dir}/${file.name}.out2" emacsmode="true" />
357 <antcall target="wsl-run">
358 <param name="filename" value="${file.dir}/${file.name}.wsl" />
359 <param name="inputstring" value="${inputstring}" />
360 </antcall>
361 <record name="${file.dir}/${file.name}.out2" action="stop" />
362 <record name="${file.dir}/${file.name}.out3" emacsmode="true" />
363 <antcall target="wsl-run">
364 <param name="filename" value="${file.dir}/${file.name}${transf.wsl.ext}" />
365 <param name="inputstring" value="${inputstring}" />
366 </antcall>
367 <record name="${file.dir}/${file.name}.out3" action="stop" />
368 </target>
370 <target name="manual-test-run-samples-dir"
371 description="run .obj .wsl ${transf.wsl.ext}, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
372 <antcall target="manual-test-run">
373 <param name="file.dir" value="${samples.temp.dir}"/>
374 </antcall>
375 </target>
377 <target name="init-compare">
378 <mkdir dir="${samples.temp.dir}/outputs"/>
379 </target>
381 <target name="test-m-w">
383 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
385 <java classpath="${compiler.class.dir}:${compiler.class.jar}"
386 classname="${compiler.classname.interpreter}"
387 input="${inputfile}"
388 error="${samples.temp.dir}/outputs/${file.out}.errmj"
389 output="${samples.temp.dir}/outputs/${file.out}.outmj">
390 <arg value="${file.dir}/${file.name}.obj" />
391 </java>
393 <exec executable="${fermat.dir}/bin/wsl"
394 input="${inputfile}"
395 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
396 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
397 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
398 <env key="FermaT" path="${fermat.dir}" />
399 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
400 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
401 <arg value="${file.dir}/${file.name}.wsl"/>
402 </exec>
404 <exec executable="perl" resultproperty="ook">
405 <arg value="lib/compare-m-w.pl"/>
406 <arg value="${file.dir}/outputs"/>
407 <arg value="${file.out}"/>
408 </exec>
410 </target>
412 <target name="test-w-wt">
414 <basename property="file.out" file="${inputfile}" suffix=".txt"/>
416 <exec executable="${fermat.dir}/bin/wsl"
417 input="${inputfile}"
418 error="${samples.temp.dir}/outputs/${file.out}.errwsl"
419 output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
420 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
421 <env key="FermaT" path="${fermat.dir}" />
422 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
423 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
424 <arg value="${file.dir}/${file.name}.wsl"/>
425 </exec>
427 <exec executable="${fermat.dir}/bin/wsl"
428 input="${inputfile}"
429 error="${samples.temp.dir}/outputs/${file.out}.errwslt"
430 output="${samples.temp.dir}/outputs/${file.out}.outwslt" >
431 <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
432 <env key="FermaT" path="${fermat.dir}" />
433 <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
434 <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
435 <arg value="${file.dir}/${file.name}${transf.wsl.ext}"/>
436 </exec>
438 <exec executable="perl">
439 <arg value="lib/compare-w-wt.pl"/>
440 <arg value="${file.dir}/outputs"/>
441 <arg value="${file.out}"/>
442 </exec>
443 </target>
445 <target name="test-fn">
446 <basename property="file.name" file="${filename}" suffix=".obj"/>
447 <dirname property="file.dir" file="${filename}"/>
448 <foreach param="inputfile" target="test-m-w" inheritall="true">
449 <path>
450 <fileset dir='${tests.dir}'>
451 <include name="${file.name}*.txt"/>
452 </fileset>
453 </path>
454 </foreach>
455 </target>
457 <target name="test-fn-t">
458 <basename property="file.name" file="${filename}" suffix="${transf.wsl.ext}"/>
459 <dirname property="file.dir" file="${filename}"/>
460 <foreach param="inputfile" target="test-w-wt" inheritall="true">
461 <path>
462 <fileset dir='${tests.dir}'>
463 <include name="${file.name}*.txt"/>
464 </fileset>
465 </path>
466 </foreach>
467 </target>
469 <target name="test-all-m" depends="init-compare,init-time"
470 description="Run all the tests from the test directory to compare MJ and WSL" >
471 <record name="${log.file.tests.m}${time}.txt" emacsmode="true" />
472 <foreach param="filename" target="test-fn" inheritall="true">
473 <path>
474 <fileset dir='${samples.temp.dir}'>
475 <include name="*.obj"/>
476 </fileset>
477 </path>
478 </foreach>
479 <record name="${log.file.tests.m}${time}.txt" action="stop" />
480 <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
481 <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>
482 </target>
484 <target name="test-all-t" depends="init-compare,init-time"
485 description="Run all the tests from the test directory to compare WSL and transformations" >
486 <record name="${log.file.tests.t}${time}.txt" emacsmode="true" />
487 <foreach param="filename" target="test-fn-t">
488 <path>
489 <fileset dir='${samples.temp.dir}'>
490 <include name="*${transf.wsl.ext}"/>
491 </fileset>
492 </path>
493 </foreach>
494 <record name="${log.file.tests.t}${time}.txt" action="stop" />
495 <move file="${log.file.tests.t}.txt" tofile="${log.file.tests.t}-previous.txt" failonerror="false"/>
496 <copy file="${log.file.tests.t}${time}.txt" tofile="${log.file.tests.t}.txt"/>
497 </target>
499 <target name="q-test">
500 <!-- for quick tests -->
501 <antcall target="test-fn">
502 <param name="file.name" value="Rek1"/>
503 <param name="file.dir" value="${samples.temp.dir}"/>
504 </antcall>
505 </target>
508 <!-- **************************************** -->
509 <!-- metrics -->
510 <!-- **************************************** -->
512 <target name="metrics-compare-wsl">
513 <basename property="metrics.temp.name" file="${metrics.run.filename}" suffix="${transf.wsl.ext}"/>
514 <dirname property="metrics.temp.dir" file="${metrics.run.filename}"/>
515 <antcall target="wsl-run">
516 <param name="filename" value="${metrics.wsl.file}" />
517 <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}" />
519 </antcall>
521 </target>
523 <target name="metrics-samples-compare-wsl" depends="init"
524 description="metrics on transformed wsl files (csv file)" >
526 <antcall target="wsl-run">
527 <param name="filename" value="${metrics.wsl.file}" />
528 <param name="args" value="-o ${samples.temp.dir}/0000-header${metrics.extension} -HC" />
530 </antcall>
532 <foreach param="metrics.run.filename" target="metrics-compare-wsl" parallel="true" maxthreads="${global.max.threads}">
533 <path>
534 <fileset dir='${samples.temp.dir}'>
535 <patternset refid="transformed.sources"/>
536 </fileset>
537 </path>
538 </foreach>
540 <concat destfile="${samples.temp.dir}/metrics-wsl-compare.csv">
541 <fileset dir="${samples.temp.dir}" includes="*${metrics.extension}"/>
542 </concat>
543 </target>
546 <!-- **************************************** -->
547 <!-- output serveral versions of files -->
548 <!-- **************************************** -->
550 <target name="output-all-versions"
551 description="generate variations on the translations in the 'local' folder and tar them">
552 <delete>
553 <fileset dir="local/out/"/>
554 </delete>
555 <mkdir dir="local/out"/>
556 <antcall>
557 <target name="mj-samples"/>
558 <target name="mjc2wsl-samples"/>
559 <param name="samples.temp.dir" value="local/out/headTail-proc"/>
560 <param name="mjc2wsl.options" value=""/>
561 </antcall>
562 <antcall>
563 <target name="mj-samples"/>
564 <target name="mjc2wsl-samples"/>
565 <param name="samples.temp.dir" value="local/out/headTail-inline"/>
566 <param name="mjc2wsl.options" value="--genInlinePrint"/>
567 </antcall>
568 <antcall>
569 <target name="mj-samples"/>
570 <target name="mjc2wsl-samples"/>
571 <param name="samples.temp.dir" value="local/out/popPush-inline"/>
572 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint"/>
573 </antcall>
574 <antcall>
575 <target name="mj-samples"/>
576 <target name="mjc2wsl-samples"/>
577 <param name="samples.temp.dir" value="local/out/popPush-proc"/>
578 <param name="mjc2wsl.options" value="--genPopPush"/>
579 </antcall>
580 <antcall>
581 <target name="mj-samples"/>
582 <target name="mjc2wsl-samples"/>
583 <param name="samples.temp.dir" value="local/out/popPush-glob"/>
584 <param name="mjc2wsl.options" value="--genPopPush --genGlobalVars"/>
585 </antcall>
586 <antcall>
587 <target name="mj-samples"/>
588 <target name="mjc2wsl-samples"/>
589 <param name="samples.temp.dir" value="local/out/popPush-loc-separate"/>
590 <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint --genLocalsSeparate --genLocalVars"/>
591 </antcall>
592 <tar basedir="local/out" compression="gzip"
593 destfile="local/mjc2wsl-samples.tgz"
594 includes="*/*.wsl"/>
595 </target>
598 <!-- **************************************** -->
599 <!-- output a comparison Latex file and compile it -->
600 <!-- **************************************** -->
602 <target name="output-comparison-pdf-single">
603 <basename property="file.name" file="${filename}" suffix=".mj"/>
604 <echo append='true' file="${samples.temp.dir}/tex/comparison.tex">
605 \section{${file.name}}
606 \begin{paracol}{4}
607 \lstinputlisting[style=mj]{../${file.name}.mj}
608 \switchcolumn
609 \lstinputlisting[style=decoded]{../${file.name}.obj.decoded}
610 \switchcolumn
611 \lstinputlisting[style=wsl,lastline=200]{../${file.name}.wsl}
612 \switchcolumn
613 \lstinputlisting[style=wslt,lastline=200]{../${file.name}${transf.wsl.ext}}
614 \end{paracol}
615 </echo>
616 </target>
618 <target name="output-comparison-pdf"
619 description="Makes a parallel display in Latex and produces a pdf (tex dir in temp dir)" >
621 <copy file="lib/tex/comparison-start.tex" overwrite="true"
622 tofile="${samples.temp.dir}/tex/comparison.tex"/>
623 <foreach param="filename" target="output-comparison-pdf-single" inheritall="true">
624 <path>
625 <fileset dir='${samples.temp.dir}'>
626 <include name="*.mj"/>
627 </fileset>
628 </path>
629 </foreach>
630 <concat destfile="${samples.temp.dir}/tex/comparison.tex" append="true">
631 <filelist dir="lib/tex" files="comparison-end.tex"/>
632 </concat>
633 <antcall target="output-comparison-compile"/>
634 </target>
636 <target name="output-comparison-compile">
637 <exec command="pdflatex comparison.tex"
638 dir="${samples.temp.dir}/tex"/>
639 </target>
641 <!-- jedit specific flags; needs to be the first or the last 10 lines
642 :noTabs=true:
643 -->
644 </project>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner