Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (89 sloc) 3.32 KB
<!--
@author Fabio Kung (fabio.kung@gmail.com)
-->
<project name="jsr-310-ri" default="dist">
<description>
Reference Implementation for the JSR 310 - Date and Time API
</description>
<property file="build.properties" />
<macrodef name="get-dependency">
<attribute name="group" />
<attribute name="artifact" />
<attribute name="version" />
<attribute name="variant" default="" />
<attribute name="dest" />
<sequential>
<get
src="${maven.ibiblio.url}/@{group}/@{artifact}/@{version}/@{artifact}-@{version}@{variant}.jar"
dest="@{dest}/@{artifact}-@{version}@{variant}.jar"
verbose="true"
usetimestamp="true" />
</sequential>
</macrodef>
<path id="codegen.path">
<pathelement location="${build.codegen}" />
<fileset dir="lib/main">
<include name="**/*.jar" />
</fileset>
</path>
<path id="main.path">
<pathelement location="${build.main}" />
<fileset dir="lib/main">
<include name="**/*.jar" />
</fileset>
</path>
<path id="test.path">
<path refid="main.path" />
<pathelement location="${build.test}" />
<fileset dir="lib/test">
<include name="**/*.jar" />
</fileset>
</path>
<target name="resolve-deps">
<mkdir dir="${lib.main}" />
<mkdir dir="${lib.test}" />
<get-dependency group="velocity" artifact="velocity" version="1.5" dest="${lib.main}" />
<get-dependency group="commons-collections" artifact="commons-collections" version="3.1" dest="${lib.main}" />
<get-dependency group="commons-lang" artifact="commons-lang" version="2.1" dest="${lib.main}" />
<get-dependency group="oro" artifact="oro" version="2.0.8" dest="${lib.main}" />
<get-dependency group="org/testng" artifact="testng" version="5.1" variant="-jdk15" dest="${lib.test}" />
</target>
<target name="init" depends="resolve-deps">
<tstamp />
</target>
<target name="compile" depends="init" description="compile the source">
<mkdir dir="${build.main}" />
<javac srcdir="${src.main}" destdir="${build.main}" classpathref="main.path" />
</target>
<target name="compile-codegen">
<mkdir dir="${build.codegen}" />
<javac srcdir="${src.codegen}" destdir="${build.codegen}" classpathref="codegen.path" />
<copy todir="${build.codegen}">
<fileset dir="${src.codegen}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="compile-tests" depends="compile" description="compile the tests">
<mkdir dir="${build.test}" />
<javac srcdir="${src.test}" destdir="${build.test}" classpathref="test.path" />
</target>
<target name="test" depends="compile-tests" description="run the tests">
<taskdef resource="testngtasks" classpathref="test.path" />
<testng classpathref="test.path" outputDir="${build.test}" sourceDir="${src.test}" haltonfailure="true" verbose="2">
<classfileset dir="${build.test}" includes="**/Test*.class" />
</testng>
</target>
<target name="dist" depends="test" description="generate the distribution">
<mkdir dir="${dist}" />
<jar jarfile="${dist}/${ant.project.name}-${DSTAMP}.jar" basedir="${build.main}" />
</target>
<target name="clean" description="clean up">
<delete dir="${build.main}" />
<delete dir="${build.test}" />
<delete dir="${dist}" />
</target>
<target name="codegen" depends="compile-codegen">
<java classname="jsr310.codegen.CodeGen" classpathref="codegen.path" />
</target>
</project>
Something went wrong with that request. Please try again.