Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 27b0994d7a
Fetching contributors…

Cannot retrieve contributors at this time

185 lines (151 sloc) 7.453 kB
<?xml version="1.0" encoding="UTF-8"?>
<project name="ozma" default="build">
<description>
Ozma is a language based on Scala, with extensions wrt declarative concurrency. It uses Mozart as a back-end.
</description>
<!-- ===========================================================================
END-USER TARGETS
============================================================================ -->
<target name="build" depends="build.done"
description="Builds the Ozma compiler and library. Executables are in 'bin'."/>
<target name="build-opt"
description="Builds the optimised Ozma compiler and library. Executables are in 'bin'.">
<antcall target="build">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="clean" depends="build.clean"
description="Removes binaries of compiler and library. Distributions are untouched."/>
<!-- ===========================================================================
PROPERTIES
============================================================================ -->
<property environment="env"/>
<property name="scala.home" value="${env.SCALA_HOME}"/>
<!-- Defines the repository layout -->
<property name="src.dir" value="${basedir}/src"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="bin.dir" value="${basedir}/bin"/>
<property name="build.library.dir" value="${classes.dir}/library"/>
<property name="build.compiler.dir" value="${classes.dir}/compiler"/>
<property name="build.ozastc.dir" value="${build.dir}/ozastc"/>
<property name="build.runtime.dir" value="${build.dir}/runtime"/>
<property name="build.engine.dir" value="${build.dir}/engine"/>
<property name="bin.ozc" value="ozc"/>
<property name="bin.ozastc" value="${bin.dir}/ozastc"/>
<property name="bin.ozmac" value="${bin.dir}/ozmac"/>
<property name="bin.ozma" value="${bin.dir}/ozma"/>
<!-- Loads custom properties definitions -->
<property file="${basedir}/build.properties"/>
<!-- Additional command line arguments for scalac. They are added to all build targets -->
<property name="scalac.args" value=""/>
<property name="javac.args" value=""/>
<property name="copyright.string" value="Copyright 2011, Sébastien Doeraene"/>
<property name="scala-library.jar"
value="${scala.home}/lib/scala-library.jar"/>
<property name="scala-compiler.jar"
value="${scala.home}/lib/scala-compiler.jar"/>
<path id="build.classpath">
<pathelement location="${scala-library.jar}"/>
<pathelement location="${scala-compiler.jar}"/>
</path>
<!-- if ANT_OPTS is already set by the environment, it will be unaltered,
but if it is unset it will take this default value. -->
<property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC" />
<property name="scalacfork.jvmargs" value="${env.ANT_OPTS} ${jvm.opts}"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
<target name="init">
<!-- scalac.args.optimise is selectively overridden in certain antcall tasks. -->
<property name="scalac.args.optimise" value=""/>
<property name="scalac.args.all" value="${scalac.args} ${scalac.args.optimise}"/>
<!-- Setting-up Scala-specific tasks -->
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala.home}/lib/scala-compiler.jar"/>
<pathelement location="${scala-library.jar}"/>
</classpath>
</taskdef>
<!-- This is the start time for the distribution -->
<tstamp prefix="time">
<format property="human" pattern="d MMMM yyyy, HH:mm:ss"/>
<format property="short" pattern="yyyyMMddHHmmss"/>
</tstamp>
</target>
<!-- ===========================================================================
ACTUAL TASKS
============================================================================ -->
<target name="build.library" depends="init">
<mkdir dir="${build.library.dir}"/>
<scalac srcdir="${src.dir}/library" destdir="${build.library.dir}"
classpathref="build.classpath"
addparams="${scalac.args.all}">
<include name="**/*.scala"/>
</scalac>
</target>
<target name="build.compiler" depends="init,build.library">
<mkdir dir="${build.compiler.dir}"/>
<scalac srcdir="${src.dir}/compiler" destdir="${build.compiler.dir}"
classpathref="build.classpath"
addparams="${scalac.args.all}">
<include name="**/*.scala"/>
</scalac>
</target>
<target name="build.ozastc" depends="init">
<mkdir dir="${build.ozastc.dir}"/>
<apply executable="${bin.ozc}" dest="${build.ozastc.dir}" parallel="false"
failonerror="true">
<globmapper from="*.oz" to="*.ozf"/>
<arg value="-c"/> <srcfile/> <arg value="-o"/> <targetfile/>
<fileset dir="${src.dir}/ozastc" includes="*.oz" excludes="ASTPatch.oz"/>
</apply>
</target>
<target name="build.runtime" depends="build.compiler,build.ozastc">
<!-- ozc does not like when its destination dir does not exist -->
<mkdir dir="${build.runtime.dir}/java/lang"/>
<mkdir dir="${build.runtime.dir}/scala/runtime"/>
<!-- compile native functors -->
<apply executable="${bin.ozc}" dest="${build.runtime.dir}" parallel="false"
failonerror="true">
<globmapper from="*.oz" to="*.ozf"/>
<arg value="-c"/> <srcfile/> <arg value="-o"/> <targetfile/>
<fileset dir="${src.dir}/javalib" includes="**/*.oz"/>
<fileset dir="${src.dir}/scalalib" includes="**/*.oz"/>
</apply>
<!-- compile classes written in Ozma (part 1) -->
<apply executable="${bin.ozmac}" dest="${build.runtime.dir}"
parallel="false" failonerror="true">
<globmapper from="*.scala" to="*.ozf"/>
<env key="JAVA_OPTS" value="${env.ANT_OPTS}"/>
<arg value="-d"/> <arg path="${build.runtime.dir}"/> <srcfile/>
<fileset dir="${src.dir}/scalalib" includes="scala/runtime/BoxedUnit.scala"/>
</apply>
<!-- compile classes written in Ozma (part 2) -->
<apply executable="${bin.ozmac}" dest="${build.runtime.dir}"
parallel="true" failonerror="true">
<globmapper from="*.scala" to="*.ozf"/>
<env key="JAVA_OPTS" value="${env.ANT_OPTS}"/>
<arg value="-d"/> <arg path="${build.runtime.dir}"/> <srcfile/>
<fileset dir="${src.dir}/javalib" includes="**/*.scala"/>
<fileset dir="${src.dir}/scalalib" includes="**/*.scala"
excludes="scala/runtime/BoxedUnit.scala"/>
<fileset dir="${src.dir}/library" includes="**/*.scala"/>
</apply>
</target>
<target name="build.engine" depends="init">
<mkdir dir="${build.engine.dir}"/>
<apply executable="${bin.ozc}" dest="${build.engine.dir}" parallel="false"
failonerror="true">
<globmapper from="*.oz" to="*.ozf"/>
<arg value="-c"/> <srcfile/> <arg value="-o"/> <targetfile/>
<fileset dir="${src.dir}/engine" includes="*.oz"/>
</apply>
</target>
<target name="build.done" depends="build.library,build.compiler,build.ozastc,build.runtime,build.engine"/>
<target name="build.clean" depends="init">
<delete includeemptydirs="true">
<fileset dir="${build.dir}" includes="**/*"/>
</delete>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.