Created
October 15, 2009 09:04
-
-
Save takai/210799 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<project name="twitty-console" default="run-spec"> | |
<!-- properties --> | |
<property file="build.properties"/> | |
<property name="build" value="build" /> | |
<property name="build.main" value="build/classes" /> | |
<property name="build.spec" value="build/spec-classes" /> | |
<property name="src.main" value="src/main/scala" /> | |
<property name="src.spec" value="src/spec/scala" /> | |
<!-- class paths --> | |
<path id="classpath.main"> | |
<pathelement location="${scala.home}/lib/scala-library.jar" /> | |
<pathelement location="${build.main}" /> | |
</path> | |
<path id="classpath.spec"> | |
<pathelement location="${scala.home}/lib/scala-library.jar" /> | |
<pathelement location="${scalatest.jar}" /> | |
<pathelement location="${build.main}" /> | |
<pathelement location="${build.spec}" /> | |
</path> | |
<!-- build process --> | |
<target name="prepare"> | |
<fail unless="scala.home" | |
message="Set scala.home proprety in build.properties file." /> | |
<fail unless="scalatest.jar" | |
message="Set scalatest.jar proprety in build.properties file." /> | |
<taskdef resource="scala/tools/ant/antlib.xml"> | |
<classpath> | |
<pathelement location="${scala.home}/lib/scala-compiler.jar" /> | |
<pathelement location="${scala.home}/lib/scala-library.jar" /> | |
</classpath> | |
</taskdef> | |
<mkdir dir="${build.main}" /> | |
<mkdir dir="${build.spec}" /> | |
</target> | |
<target name="compile-main" depends="prepare"> | |
<scalac srcdir="${src.main}" | |
destdir="${build.main}" | |
classpathref="classpath.main" > | |
<include name="**/*.scala" /> | |
</scalac> | |
</target> | |
<target name="compile-spec" depends="compile-main"> | |
<taskdef name="scalatest" | |
classname="org.scalatest.tools.ScalaTestAntTask"> | |
<classpath refid="classpath.spec"/> | |
</taskdef> | |
<scalac srcdir="${src.spec}" | |
destdir="${build.spec}" | |
classpathref="classpath.spec" > | |
<include name="**/*.scala" /> | |
</scalac> | |
</target> | |
<target name="run-spec" depends="compile-spec"> | |
<scalatest runpath="${build.spec}" /> | |
</target> | |
<target name="clean"> | |
<delete dir="${build}" /> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment