gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
added a README file
[mjc2wsl.git] / build.xml
index cfd9ea2..090af7a 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,4 +1,15 @@
 <project name="mjc2wsl" default="all">
+    <property file="custom.properties"/>
+    
+     <condition property="fermat.dir" value="C:\fermat3">
+       <os family="windows" />
+     </condition>
+
+     <condition property="fermat.dir" value="${user.home}/fermat3">
+       <not><os family="windows" /></not>
+     </condition>
+
+    
     <property name="java.encoding" value="utf-8" />
     <taskdef resource="net/sf/antcontrib/antlib.xml"/>
     
 
     <property name="samples.main.dir" value="samples" />
     <property name="samples.temp.dir" value="samples-temp" />
-    
-    <property name="fermat.dir" value="/home/donny/d/donny/fermat3" />
-    
-    <target name="help" description="a short help text">
-        <echo>Possible options:
-        all - build the tool and the compiler and test on the samples
-        build - build the mjc2wsl tool
-        mj-build - build the mj compiler
-        mj-samples - run the mj compiler on the samples (build if needed)
-        </echo>
-    </target>
-    
+
+    <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
+    <property name="transf.wsl.ini" value="transf.ini" />
+
+    <description>
+        Builder script for mjc2wsl and related tools, runs test
+        on given samples.
+        
+        Also gives options to chain the tools on individual files.
+    </description>
+
     <target name="init">
         <mkdir dir="${mjc2wsl.class.dir}"/>
         <mkdir dir="${compiler.class.dir}"/>
@@ -34,7 +44,7 @@
         </copy>
     </target>
 
-    <target name="build" depends="init" description="build the mjv2wsl tool">
+    <target name="build" depends="init" description="build the mjc2wsl tool">
         <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
     </target>
 
@@ -49,7 +59,7 @@
         </java>
     </target>
     
-    <target name="mj-samples" depends="build" description="run the mj compiler on the samples">
+    <target name="mj-samples" depends="mj-build" description="run the mj compiler on the samples">
         <foreach param="filename" target="mj-compile">
             <path>
             <fileset dir='${samples.temp.dir}'>
@@ -80,7 +90,7 @@
         </java>
     </target>
     
-    <target name="mjc2wsl-samples" depends="build">
+    <target name="mjc2wsl-samples" depends="build" description="run the mjc2wsl tool on the samples">
         <foreach param="filename" target="mjc2wsl">
             <path>
             <fileset dir='${samples.temp.dir}'>
     </target>
     
     <target name="wsl-run" >
-        <exec executable="${fermat.dir}/bin/wsl" >
+        <exec executable="${fermat.dir}/bin/wsl" inputstring="${inputstring}">
             <env key="PATH" path="${env.PATH}:${fermat.dir}/bin"/>
             <env key="FermaT" path="${fermat.dir}" />
             <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
         </exec>
     </target>
     
-    <target name="all" depends='mj-samples,mjc2wsl-samples' description="build the tools, run them on the samples to check">
+    <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}" />
+        </antcall>
+    </target>
+    
+    <target name="wsl-transf-samples" depends="make-transf-ini-samples"
+        description="transform (simplify) the wsl files generated by mjc2wsl">
+        <antcall target="wsl-run">
+            <param name="filename" value="${transf.wsl.file}" />
+        </antcall>
+    </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>
+        </fileset>
+        <pathconvert pathsep="${line.separator}" 
+            property="generated-wsl-files" refid="generated-wsl-fileset" />
+
+        <echo file="${transf.wsl.ini}">${generated-wsl-files}</echo>
+    </target>
+    
+    <target name="all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples'
+        description="build the tools, run them on the samples to check">
     
     </target>
     
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner