gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
minor: ant build - tabs to spaces
[mjc2wsl.git] / build.xml
index 2ac7435..4b35a7a 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,64 +1,82 @@
 <project name="mjc2wsl" default="all">
 
-       <property name="mjc2wsl.class.dir" value="bin" />
-       <property name="mjc2wsl.src.dir" value="src" />
-       <property name="mjc2wsl.options" value="" />
-       
-       <property name="compiler.class.dir" value="compiler" />
-       <property name="compiler.src.dir" value="compiler" />
+    <property name="mjc2wsl.class.dir" value="bin" />
+    <property name="mjc2wsl.src.dir" value="src" />
+    <property name="mjc2wsl.options" value="" />
+    
+    <property name="compiler.class.dir" value="compiler-bin" />
+    <property name="compiler.src.dir" value="compiler" />
 
-       <target name="help">
-               <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>
-       
-       <target name="build">
-               <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
-       </target>
+    <target name="help">
+        <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>
+    
+    <target name="init">
+        <mkdir dir="${mjc2wsl.class.dir}"/>
+        <mkdir dir="${compiler.class.dir}"/>
+    </target>
 
-       <target name="mj-build">
-               <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
-       </target>
-       
-       <target name="mj-compile">
-               <echo message="${filename}" />
-               <java classpath="${compiler.class.dir}" classname="Compiler">
-                       <arg value="${filename}" />
-               </java>
-       </target>
-       
-       <target name="mj-samples" depends="mj-build">
-               <antcall target="mj-compile">
-                       <param name="filename" value="samples/sample.mj" />
-               </antcall>
-               <antcall target="mj-compile">
-                       <param name="filename" value="samples/sample1.mj" />
-               </antcall>
-               <antcall target="mj-compile">
-                       <param name="filename" value="samples/sample0.mj" />
-               </antcall>
-       </target>
-       
-       <target name="mjc2wsl">
-               <echo message="${filename}" />
-               <java classpath="${mjc2wsl.class.dir}" classname="mjc2wsl">
-                       <arg line="${mjc2wsl.options}" />
-                       <arg value="${filename}" />
-               </java>
-       </target>
-       
-       <target name="mjc2wsl-samples" depends="build">
-               <antcall target="mjc2wsl">
-                       <param name="filename" value="samples/sample0.obj" />
-               </antcall>
-       </target>
-       
-       <target name="all" depends='mj-samples,mjc2wsl-samples'>
-       
-       </target>
+    <target name="build" depends="init">
+        <javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
+    </target>
+
+    <target name="mj-build" depends="init">
+        <javac srcdir="${compiler.src.dir}" destdir="${compiler.class.dir}" includeAntRuntime='no' />
+    </target>
+    
+    <target name="mj-compile">
+        <echo message="${filename}" />
+        <java classpath="${compiler.class.dir}" classname="Compiler">
+            <arg value="${filename}" />
+        </java>
+    </target>
+    
+    <target name="mj-samples" depends="mj-build">
+        <antcall target="mj-compile">
+            <param name="filename" value="samples/sample.mj" />
+        </antcall>
+        <antcall target="mj-compile">
+            <param name="filename" value="samples/sample1.mj" />
+        </antcall>
+        <antcall target="mj-compile">
+            <param name="filename" value="samples/sample0.mj" />
+        </antcall>
+    </target>
+    
+    <target name="mjc2wsl">
+        <echo message="${filename}" />
+        <java classpath="${mjc2wsl.class.dir}" classname="mjc2wsl">
+            <arg line="${mjc2wsl.options}" />
+            <arg value="${filename}" />
+        </java>
+    </target>
+    
+    <target name="mjc2wsl-samples" depends="build">
+        <antcall target="mjc2wsl">
+            <param name="filename" value="samples/sample0.obj" />
+        </antcall>
+    </target>
+    
+    <target name="all" depends='mj-samples,mjc2wsl-samples'>
+    
+    </target>
+    
+    <target name="clean" >
+        <delete includeemptydirs="true">
+            <fileset dir=".">
+                <include name="${mjc2wsl.class.dir}/*.class"/>
+                <include name="${compiler.class.dir}/*.class"/>
+            </fileset>
+            <dirset dir=".">
+                <include name="${mjc2wsl.class.dir}"/>
+                <include name="${compiler.class.dir}"/>
+            </dirset>
+        </delete>
+    </target>
 
 </project>
\ No newline at end of file
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner