gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant - new tasks for making parallel code stages display in a pdf
[mjc2wsl.git] / build.xml
index c51b2ab..206065d 100644 (file)
--- a/build.xml
+++ b/build.xml
 
     <target name="mj-decode" description="decode a MJ obj file given in ${filename}">
         <echo message="${filename}" />
 
     <target name="mj-decode" description="decode a MJ obj file given in ${filename}">
         <echo message="${filename}" />
-        <java classpath="${compiler.class.dir}:${compiler.class.jar}" classname="${compiler.classname.decoder}">
+        <java classpath="${compiler.class.dir}:${compiler.class.jar}" 
+              classname="${compiler.classname.decoder}"
+              output="${filename}.decoded" >
             <arg value="${filename}" />
         </java>
     </target>
     
             <arg value="${filename}" />
         </java>
     </target>
     
-    <target name="mj-decode-samples" description="decode all of the compiled samples and save into file 'decoded.txt'">
-        <record name="${samples.temp.dir}/decoded.txt" emacsmode="true" loglevel="info"/>
+    <target name="mj-decode-samples" description="decode all of the obj files in ${samples.temp.dir}">
         <foreach param="filename" target="mj-decode">
             <path>
             <fileset dir='${samples.temp.dir}'>
         <foreach param="filename" target="mj-decode">
             <path>
             <fileset dir='${samples.temp.dir}'>
             </fileset>
             </path>
         </foreach>
             </fileset>
             </path>
         </foreach>
-        <record name="${samples.temp.dir}/decoded.txt" action="stop"/>
     </target>
     
     <target name="mj-run" description="run a MJ obj file given in ${filename} with ${inputstring}">
     </target>
     
     <target name="mj-run" description="run a MJ obj file given in ${filename} with ${inputstring}">
             includes="*/*.wsl"/>
     </target>
 
             includes="*/*.wsl"/>
     </target>
 
+
+    <!-- output a comparison Latex file and compile it -->
+
+    <target name="output-comparison-pdf-single">
+        <basename property="file.name" file="${filename}" suffix=".obj"/>
+        <echo append='true' file="${samples.temp.dir}/tex/comparison.tex">
+        \section{${file.name}}
+        \begin{paracol}{4}
+        \lstinputlisting[style=mj]{../${file.name}.mj}
+        \switchcolumn
+        \lstinputlisting[style=decoded]{../${file.name}.obj.decoded}
+        \switchcolumn
+        \lstinputlisting[style=wsl,lastline=200]{../${file.name}.wsl}
+        \switchcolumn
+        \lstinputlisting[style=wslt,lastline=200]{../${file.name}${transf.wsl.ext}}
+        \end{paracol}
+        </echo>
+    </target>
+    
+    <target name="output-comparison-pdf"
+        description="Makes a parallel display in Latex and produces a pdf (tex dir in temp dir)" >
+
+        <copy file="lib/tex/comparison-start.tex" overwrite="true" 
+            tofile="${samples.temp.dir}/tex/comparison.tex"/>
+        <foreach param="filename" target="output-comparison-pdf-single" inheritall="true">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <include name="*.obj"/>
+            </fileset>
+            </path>
+        </foreach>
+        <concat destfile="${samples.temp.dir}/tex/comparison.tex" append="true">
+            <filelist dir="lib/tex" files="comparison-end.tex"/>
+        </concat>
+        <antcall target="output-comparison-compile"/>
+    </target>
+    
+    <target name="output-comparison-compile">
+        <exec command="pdflatex comparison.tex"
+              dir="${samples.temp.dir}/tex"/>
+    </target>
+
     <!-- jedit specific flags; needs to be the first or the last 10 lines
     :noTabs=true:
     -->
     <!-- jedit specific flags; needs to be the first or the last 10 lines
     :noTabs=true:
     -->
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner