gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
minor: ant build jedit specific flags to remove tabs
[mjc2wsl.git] / build.xml
index 4b35a7a..cf34eae 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,5 +1,11 @@
 <project name="mjc2wsl" default="all">
 <project name="mjc2wsl" default="all">
-
+    <property name="java.encoding" value="utf-8" />
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+        <classpath>
+            <pathelement location="/usr/share/java/"/>
+        </classpath>
+    </taskdef>
+    
     <property name="mjc2wsl.class.dir" value="bin" />
     <property name="mjc2wsl.src.dir" value="src" />
     <property name="mjc2wsl.options" value="" />
     <property name="mjc2wsl.class.dir" value="bin" />
     <property name="mjc2wsl.src.dir" value="src" />
     <property name="mjc2wsl.options" value="" />
@@ -7,6 +13,9 @@
     <property name="compiler.class.dir" value="compiler-bin" />
     <property name="compiler.src.dir" value="compiler" />
 
     <property name="compiler.class.dir" value="compiler-bin" />
     <property name="compiler.src.dir" value="compiler" />
 
+    <property name="samples.main.dir" value="samples" />
+    <property name="samples.temp.dir" value="samples-temp" />
+    
     <target name="help">
         <echo>Possible options:
         all - build the tool and the compiler and test on the samples
     <target name="help">
         <echo>Possible options:
         all - build the tool and the compiler and test on the samples
     <target name="init">
         <mkdir dir="${mjc2wsl.class.dir}"/>
         <mkdir dir="${compiler.class.dir}"/>
     <target name="init">
         <mkdir dir="${mjc2wsl.class.dir}"/>
         <mkdir dir="${compiler.class.dir}"/>
+        <mkdir dir="${samples.temp.dir}"/>
+        <copy todir="${samples.temp.dir}">
+            <fileset dir="${samples.main.dir}">
+                <include name="*.mj"/>
+            </fileset>
+        </copy>
     </target>
 
     <target name="build" depends="init">
     </target>
 
     <target name="build" depends="init">
         </java>
     </target>
     
         </java>
     </target>
     
-    <target name="mj-samples" depends="mj-build">
+    <target name="mj-samples" depends="build">
+        <foreach param="filename" target="mj-compile">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <include name="*.mj"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
+
+    <target name="mj-samples1" depends="mj-build">
+    <!-- simplistic version when antlib (foreach) is not available -->
         <antcall target="mj-compile">
         <antcall target="mj-compile">
-            <param name="filename" value="samples/sample.mj" />
+            <param name="filename" value="samples-temp/sample.mj" />
         </antcall>
         <antcall target="mj-compile">
         </antcall>
         <antcall target="mj-compile">
-            <param name="filename" value="samples/sample1.mj" />
+            <param name="filename" value="samples-temp/sample1.mj" />
         </antcall>
         <antcall target="mj-compile">
         </antcall>
         <antcall target="mj-compile">
-            <param name="filename" value="samples/sample0.mj" />
+            <param name="filename" value="samples-temp/sample0.mj" />
         </antcall>
     </target>
     
         </antcall>
     </target>
     
     </target>
     
     <target name="mjc2wsl-samples" depends="build">
     </target>
     
     <target name="mjc2wsl-samples" depends="build">
+        <foreach param="filename" target="mjc2wsl">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <include name="*.obj"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
+    
+    <target name="mjc2wsl-samples1" depends="build">
+    <!-- simplistic version when antlib (foreach) is not available -->
         <antcall target="mjc2wsl">
         <antcall target="mjc2wsl">
-            <param name="filename" value="samples/sample0.obj" />
+            <param name="filename" value="samples-temp/sample0.obj" />
         </antcall>
     </target>
     
         </antcall>
     </target>
     
             <fileset dir=".">
                 <include name="${mjc2wsl.class.dir}/*.class"/>
                 <include name="${compiler.class.dir}/*.class"/>
             <fileset dir=".">
                 <include name="${mjc2wsl.class.dir}/*.class"/>
                 <include name="${compiler.class.dir}/*.class"/>
+                <include name="${samples.temp.dir}/*"/>
             </fileset>
             <dirset dir=".">
                 <include name="${mjc2wsl.class.dir}"/>
                 <include name="${compiler.class.dir}"/>
             </fileset>
             <dirset dir=".">
                 <include name="${mjc2wsl.class.dir}"/>
                 <include name="${compiler.class.dir}"/>
+                <include name="${samples.temp.dir}"/>
             </dirset>
         </delete>
     </target>
             </dirset>
         </delete>
     </target>
-
+    
+    <!-- jedit specific flags; needs to be the first or the last 10 lines
+    :noTabs=true:
+    -->
 </project>
\ No newline at end of file
 </project>
\ No newline at end of file
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner