gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant - pdf output tweak, use mj files
[mjc2wsl.git] / build.xml
index f8bde04..467aacd 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -43,6 +43,7 @@
     <property name="log.file.transformations" value="${log.dir}/transformations" />
     <property name="log.file.mjc2wsl" value="${log.dir}/mjc2wsl" />
     <property name="log.file.tests.m" value="${log.dir}/tests-mj" />
     <property name="log.file.transformations" value="${log.dir}/transformations" />
     <property name="log.file.mjc2wsl" value="${log.dir}/mjc2wsl" />
     <property name="log.file.tests.m" value="${log.dir}/tests-mj" />
+    <property name="log.file.tests.t" value="${log.dir}/tests-wsl" />
 
     <description>
         Builder script for mjc2wsl and related tools, runs test
 
     <description>
         Builder script for mjc2wsl and related tools, runs test
         <exclude name="**/*${transf.wsl.ext}"/>
     </patternset>
 
         <exclude name="**/*${transf.wsl.ext}"/>
     </patternset>
 
+    <patternset id="transformed.sources">
+        <include name="**/*${transf.wsl.ext}"/>
+    </patternset>
+
     <!-- general tasks -->
 
     <target name="init" depends="init-time">
     <!-- general tasks -->
 
     <target name="init" depends="init-time">
 
     <target name="wsl-run" >
         <property name="args" value=""/>
 
     <target name="wsl-run" >
         <property name="args" value=""/>
-        <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}">
+        <property name="wslrun.workdir" value=""/>
+        <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}"
+            dir="${wslrun.workdir}" >
             <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
             <env key="FermaT" path="${fermat.dir}" />
             <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
             <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
             <env key="FermaT" path="${fermat.dir}" />
             <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
             </fileset>
             </path>
         </foreach>
             </fileset>
             </path>
         </foreach>
-        <record name="${log.file.tests}${time}.txt" action="stop" />
+        <record name="${log.file.tests.m}${time}.txt" action="stop" />
         <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
         <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>        
     </target>
 
         <move file="${log.file.tests.m}.txt" tofile="${log.file.tests.m}-previous.txt" failonerror="false"/>
         <copy file="${log.file.tests.m}${time}.txt" tofile="${log.file.tests.m}.txt"/>        
     </target>
 
-    <target name="test-all-t" depends="init-compare"
+    <target name="test-all-t" depends="init-compare,init-time"
     description="Run all the tests from the test directory to compare WSL and transformations" >
     description="Run all the tests from the test directory to compare WSL and transformations" >
+        <record name="${log.file.tests.t}${time}.txt" emacsmode="true" />
         <foreach param="filename" target="test-fn-t">
             <path>
             <fileset dir='${samples.temp.dir}'>
         <foreach param="filename" target="test-fn-t">
             <path>
             <fileset dir='${samples.temp.dir}'>
             </fileset>
             </path>
         </foreach>
             </fileset>
             </path>
         </foreach>
+        <record name="${log.file.tests.t}${time}.txt" action="stop" />
+        <move file="${log.file.tests.t}.txt" tofile="${log.file.tests.t}-previous.txt" failonerror="false"/>
+        <copy file="${log.file.tests.t}${time}.txt" tofile="${log.file.tests.t}.txt"/>
     </target>
     
     <target name="q-test">
     </target>
     
     <target name="q-test">
             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=".mj"/>
+        <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="*.mj"/>
+            </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