gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant - improvements to the transf scripts to use the command line params, property...
authorDoni Pracner <quinnuendo@gmail.com>
Mon, 3 Nov 2014 20:13:07 +0000 (21:13 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Mon, 3 Nov 2014 20:13:07 +0000 (21:13 +0100)
build.xml

index 838103650f0fe1ccf68dfd0fb42cc9c67ab29e74..421377f2271b7b6a10fb5db7e983904c4263381e 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -32,6 +32,7 @@
 
     <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
     <property name="transf.wsl.ini" value="transf.ini" />
+    <property name="transf.wsl.ext" value="_t.wsl" />
     
     <property name="tests.dir" value="tests" />
 
         Also gives options to chain the tools on individual files.
     </description>
 
+    <patternset id="non.transformed.sources">
+        <include name="**/*.wsl"/>
+        <exclude name="**/*${transf.wsl.ext}"/>
+    </patternset>
+    
     <!-- general tasks -->
 
     <target name="init" depends="init-time">
     <!-- wsl related tasks -->
 
     <target name="wsl-run" >
+        <property name="args" value=""/>
         <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}">
             <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="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
-            <arg value="${filename}"/>
+            <arg line="${filename} ${args}"/>
         </exec>
     </target>
     
     <target name="wsl-transf" 
         description="transform (simplify) a single wsl file generated by mjc2wsl">
-        <delete file="${transf.wsl.ini}"/>
         
         <antcall target="wsl-run">
             <param name="filename" value="${transf.wsl.file}" />
-            <param name="inputstring" value="${transf.filename}" />
+            <param name="args" value="${transf.filename}" />
         </antcall>
     </target>
     
-    <target name="wsl-transf-samples" depends="init-time,make-transf-ini-samples"
-        description="transform (simplify) the wsl files generated by mjc2wsl">
+    <target name="wsl-transf-samples" depends="init"
+    description="transform (simplify) the wsl files generated by mjc2wsl" >
         <record name="${log.file.transformations}${time}.txt" emacsmode="true" />
+        <foreach param="transf.filename" target="wsl-transf">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <patternset refid="non.transformed.sources"/>
+            </fileset>
+            </path>
+        </foreach>
+        <record name="${log.file.transformations}${time}.txt" action="stop" />
+        <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
+    </target>
+
+    <target name="wsl-transf-samples-ini" depends="init-time,make-transf-ini-samples"
+        description="transform (simplify) the wsl files generated by mjc2wsl - uses ini file">
+        <record name="${log.file.transformations}${time}i.txt" emacsmode="true" />
         <antcall target="wsl-run">
             <param name="filename" value="${transf.wsl.file}" />
         </antcall>
-       <record name="${log.file.transformations}${time}.txt" action="stop" />
-        <copy file="${log.file.transformations}${time}.txt" tofile="${log.file.transformations}.txt"/>
+        <record name="${log.file.transformations}${time}i.txt" action="stop" />
+        <copy file="${log.file.transformations}${time}i.txt" tofile="${log.file.transformations}.txt"/>
     </target>
     
     <target name="make-transf-ini-samples">
         <fileset dir="${samples.temp.dir}" casesensitive="no" id="generated-wsl-fileset">
-                <patternset id="non.transformed.sources">
-                    <include name="**/*.wsl"/>
-                    <exclude name="**/*_t.wsl"/>
-                </patternset>
+                <patternset refid="non.transformed.sources"/>
         </fileset>
         <pathconvert pathsep="${line.separator}" 
             property="generated-wsl-files" refid="generated-wsl-fileset" />
     <!-- Testing tasks -->
     
     <target name="manual-test-run" 
-    description="run .obj .wsl _t.wsl, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
+    description="run .obj .wsl ${transf.wsl.ext}, given are ${file.dir}, ${file.name} (no extension) and an ${inputstring}">
        <record name="${file.dir}/${file.name}.out1"  emacsmode="true" />
        <antcall target="mj-run">
             <param name="filename" value="${file.dir}/${file.name}.obj" />
        <record name="${file.dir}/${file.name}.out2" action="stop" />
        <record name="${file.dir}/${file.name}.out3" emacsmode="true" />
         <antcall target="wsl-run">
-            <param name="filename" value="${file.dir}/${file.name}_t.wsl" />
+            <param name="filename" value="${file.dir}/${file.name}${transf.wsl.ext}" />
             <param name="inputstring" value="${inputstring}" />
         </antcall>
        <record name="${file.dir}/${file.name}.out3" action="stop" />
     </target>
     
     <target name="manual-test-run-samples-dir"
-    description="run .obj .wsl _t.wsl, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
+    description="run .obj .wsl ${transf.wsl.ext}, in the samples-temp directory; given ${file.name} (no extension) and an ${inputstring}">
         <antcall target="manual-test-run">
             <param name="file.dir" value="${samples.temp.dir}"/>
         </antcall>
             <env key="FermaT" path="${fermat.dir}" />
             <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
             <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
-            <arg value="${file.dir}/${file.name}_t.wsl"/>
+            <arg value="${file.dir}/${file.name}${transf.wsl.ext}"/>
         </exec>
         
         <exec executable="perl">
     </target>
     
     <target name="test-fn-t">
-        <basename property="file.name" file="${filename}" suffix="_t.wsl"/>
+        <basename property="file.name" file="${filename}" suffix="${transf.wsl.ext}"/>
         <dirname property="file.dir" file="${filename}"/>
         <foreach param="inputfile" target="test-w-wt" inheritall="true">
             <path>
         <foreach param="filename" target="test-fn-t">
             <path>
             <fileset dir='${samples.temp.dir}'>
-                <include name="*_t.wsl"/>
+                <include name="*${transf.wsl.ext}"/>
             </fileset>
             </path>
         </foreach>
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner