forked from stevej/naggati
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build system and move to scala 272.
- Loading branch information
Robey Pointer
committed
Nov 29, 2008
1 parent
5dc5e4b
commit 1a193ea
Showing
9 changed files
with
464 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,71 @@ | ||
<project xmlns:ivy="antlib:org.apache.ivy.ant"> | ||
|
||
<!-- defaults for all projects --> | ||
<!-- PROJECT MUST DEFINE: project.package, project.test.classname --> | ||
<!-- optional: "project.jar.classname" to build an executable jar --> | ||
<!-- optional: "skip.download" "skip.tests" --> | ||
<property name="source.dir" value="${basedir}/src/main/scala" /> | ||
<property name="test.source.dir" value="${basedir}/src/test/scala" /> | ||
<property name="target.dir" value="${basedir}/target/classes" /> | ||
<property name="test.target.dir" value="${basedir}/target/test-classes" /> | ||
<!-- defaults for all projects --> | ||
<property name="source.dir" value="${basedir}/src/main" /> | ||
<property name="test.source.dir" value="${basedir}/src/test" /> | ||
<property name="target.dir" value="${basedir}/target" /> | ||
|
||
<property environment="env" /> | ||
<property environment="env" /> | ||
|
||
<property name="ivy.install.version" value="2.0.0-beta2" /> | ||
<property name="ivy.jar.dir" value="${user.home}/.ivy2" /> | ||
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" /> | ||
<property name="jsch.install.version" value="0.1.29" /> | ||
<property name="jsch.jar.file" value="${ivy.jar.dir}/jsch-${jsch.install.version}.jar" /> | ||
<property name="ivy.install.version" value="2.0.0-rc1" /> | ||
<property name="ivy.jar.dir" value="${user.home}/.ivy2" /> | ||
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" /> | ||
<property name="jsch.install.version" value="0.1.29" /> | ||
<property name="jsch.jar.file" value="${ivy.jar.dir}/jsch-${jsch.install.version}.jar" /> | ||
|
||
<!-- override some ivy config --> | ||
<property name="ivy.distrib.dir" value="${dist.dir}" /> | ||
<property name="ivy.deliver.ivy.pattern" value="${dist.dir}/[artifact]-[revision].[ext]" /> | ||
|
||
<!-- | ||
download ivy from the web site so that it can be used without being | ||
installed. if the file has already been downloaded, we use a rename | ||
trick to avoid hitting the website again. (that would be annoying | ||
when building offline.) | ||
--> | ||
<target name="download-ivy" unless="skip.download"> | ||
<mkdir dir="${ivy.jar.dir}"/> | ||
<condition property="ivy.url" value="file:${ivy.jar.file}"> | ||
<available file="${ivy.jar.file}" /> | ||
</condition> | ||
<property name="ivy.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" /> | ||
<get src="${ivy.url}" dest="${ivy.jar.file}.download" usetimestamp="true" /> | ||
<move file="${ivy.jar.file}.download" tofile="${ivy.jar.file}" /> | ||
<!-- | ||
download ivy from the web site so that it can be used without being | ||
installed. if the file has already been downloaded, we use a rename | ||
trick to avoid hitting the website again. (that would be annoying | ||
when building offline.) | ||
--> | ||
<target name="download-ivy" unless="skip.download"> | ||
<mkdir dir="${ivy.jar.dir}"/> | ||
<condition property="ivy.url" value="file:${ivy.jar.file}"> | ||
<available file="${ivy.jar.file}" /> | ||
</condition> | ||
<property name="ivy.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" /> | ||
<get src="${ivy.url}" dest="${ivy.jar.file}.download" usetimestamp="true" /> | ||
<move file="${ivy.jar.file}.download" tofile="${ivy.jar.file}" /> | ||
|
||
<condition property="jsch.url" value="file:${jsch.jar.file}"> | ||
<available file="${jsch.jar.file}" /> | ||
</condition> | ||
<property name="jsch.url" value="http://repo1.maven.org/maven2/jsch/jsch/${jsch.install.version}/jsch-${jsch.install.version}.jar" /> | ||
<get src="${jsch.url}" dest="${jsch.jar.file}.download" usetimestamp="true" /> | ||
<move file="${jsch.jar.file}.download" tofile="${jsch.jar.file}" /> | ||
</target> | ||
<condition property="jsch.url" value="file:${jsch.jar.file}"> | ||
<available file="${jsch.jar.file}" /> | ||
</condition> | ||
<property name="jsch.url" value="http://repo1.maven.org/maven2/jsch/jsch/${jsch.install.version}/jsch-${jsch.install.version}.jar" /> | ||
<get src="${jsch.url}" dest="${jsch.jar.file}.download" usetimestamp="true" /> | ||
<move file="${jsch.jar.file}.download" tofile="${jsch.jar.file}" /> | ||
</target> | ||
|
||
<!-- import ivy's ant tasks --> | ||
<target name="install-ivy" depends="download-ivy"> | ||
<path id="ivy.lib.path"> | ||
<fileset dir="${ivy.jar.dir}" includes="*.jar"/> | ||
</path> | ||
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> | ||
</target> | ||
<!-- import ivy's ant tasks --> | ||
<target name="install-ivy" depends="download-ivy"> | ||
<path id="ivy.lib.path"> | ||
<fileset dir="${ivy.jar.dir}" includes="*.jar"/> | ||
</path> | ||
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> | ||
</target> | ||
|
||
<!-- define filename-friendly names for the OS variants --> | ||
<condition property="os.libsname" value="osx"> | ||
<os name="Mac OS X" /> | ||
</condition> | ||
<condition property="os.libsname" value="linux"> | ||
<os name="Linux" /> | ||
</condition> | ||
<!-- define filename-friendly names for the OS variants --> | ||
<condition property="os.libsname" value="osx"> | ||
<os name="Mac OS X" /> | ||
</condition> | ||
<condition property="os.jni.ext" value="jnilib"> | ||
<os name="Mac OS X" /> | ||
</condition> | ||
<condition property="os.libsname" value="linux"> | ||
<os name="Linux" /> | ||
</condition> | ||
<condition property="os.jni.ext" value="so"> | ||
<os name="Linux" /> | ||
</condition> | ||
|
||
<import file="base_rules.xml" /> | ||
<!-- where to look for the ivy config --> | ||
<property name="ivy.dep.file" value="${basedir}/ivy/ivy.xml" /> | ||
<property name="ivy.settings.file" value="${basedir}/ivy/ivysettings.xml" /> | ||
|
||
<import file="clean.xml" /> | ||
<import file="prepare.xml" /> | ||
<import file="compile.xml" /> | ||
<import file="test.xml" /> | ||
<import file="docs.xml" /> | ||
<import file="package.xml" /> | ||
</project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<project xmlns:ivy="antlib:org.apache.ivy.ant"> | ||
|
||
<target name="clean" depends="init" description="erase built files and targets"> | ||
<delete dir="${target.dir}" /> | ||
<delete dir="${dist.dir}" /> | ||
<!-- i dont think this is really a good idea: --> | ||
<!-- delete dir="${ivy.jar.dir}/cache/${ivy.organisation}" /--> | ||
</target> | ||
|
||
<target name="clean-ivy" depends="prepare" description="erase ivy cache of downloaded packages"> | ||
<ivy:cleancache /> | ||
</target> | ||
|
||
<target name="clean-jni" depends="prepare" description="clean out any built jni targets" if="build.jni"> | ||
<ant dir="src/main/jni" target="clean" /> | ||
</target> | ||
|
||
<target name="distclean" depends="clean, clean-jni, clean-ivy" /> | ||
|
||
</project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
<project xmlns:ivy="antlib:org.apache.ivy.ant"> | ||
|
||
<property name="thrift.source.dir" value="${source.dir}/thrift" /> | ||
<property name="thrift.target.dir" value="${target.dir}/gen-java" /> | ||
|
||
|
||
<!-- generate thrift stubs if necessary --> | ||
|
||
<macrodef name="generate-thrift"> | ||
<sequential> | ||
<pathconvert property="thrift.gen.path"> | ||
<path location="${ivy.extra.thriftpackage}" /> | ||
<unpackagemapper from="${basedir}/*" to="${thrift.target.dir}/*" /> | ||
</pathconvert> | ||
<mkdir dir="${thrift.target.dir}" /> | ||
<apply executable="thrift" dest="${thrift.gen.path}" failonerror="true" | ||
skipemptyfilesets="true" verbose="true"> | ||
<arg value="--gen" /> | ||
<arg value="java" /> | ||
<arg value="-o" /> | ||
<arg value="${target.dir}" /> | ||
<arg value="" /> | ||
<fileset dir="${thrift.source.dir}" includes="**/*.thrift" /> | ||
<globmapper from="*.thrift" to="*.java" /> | ||
</apply> | ||
</sequential> | ||
</macrodef> | ||
|
||
<macrodef name="compile-generated-thrift"> | ||
<sequential> | ||
<javac srcdir="${thrift.target.dir}" destdir="${target.dir}/classes" deprecation="on"> | ||
<classpath> | ||
<path refid="deps.path" /> | ||
</classpath> | ||
<include name="**/*.java" /> | ||
</javac> | ||
</sequential> | ||
</macrodef> | ||
|
||
<target name="compile-thrift" if="ivy.extra.thriftpackage"> | ||
<generate-thrift /> | ||
<compile-generated-thrift /> | ||
</target> | ||
|
||
|
||
<!-- if there's any jni, compile it --> | ||
|
||
<target name="check-jni-source" if="build.jni"> | ||
<!-- tricksy. remove any target files if any non-target files are newer. --> | ||
<dependset> | ||
<srcfileset dir="src/main/jni" excludes="**/target/*.${os.jni.ext} **/target/*.jar" /> | ||
<targetfileset dir="src/main/jni" includes="**/target/*.${os.jni.ext} **/target/*.jar" /> | ||
</dependset> | ||
<!-- and then only set build.jni.ok if those targets are "older" than build.xml (ie missing) --> | ||
<uptodate property="build.jni.ok" targetfile="src/main/jni/build.xml"> | ||
<srcfiles dir="src/main/jni" includes="**/target/*.${os.jni.ext} **/target/*.jar" /> | ||
</uptodate> | ||
</target> | ||
|
||
<target name="compile-jni" depends="check-jni-source" if="build.jni.ok"> | ||
<ant dir="src/main/jni" target="compile" inheritAll="false" /> | ||
<copy todir="${dist.dir}" flatten="true"> | ||
<fileset dir="src/main/jni" includes="**/target/*.${os.jni.ext}" /> | ||
<fileset dir="src/main/jni" includes="**/target/*.jar" /> | ||
</copy> | ||
</target> | ||
|
||
|
||
<!-- compile old-skool java --> | ||
|
||
<target name="compile-java" if="build.java"> | ||
<javac srcdir="${source.dir}/java" destdir="${target.dir}/classes" deprecation="on"> | ||
<classpath> | ||
<path refid="deps.path" /> | ||
</classpath> | ||
<include name="**/*.java" /> | ||
</javac> | ||
</target> | ||
|
||
|
||
<!-- compile scala --> | ||
|
||
<target name="compile-scala" if="build.scala"> | ||
<scalac srcdir="${source.dir}/scala" destdir="${target.dir}/classes" force="changed" deprecation="on"> | ||
<classpath> | ||
<path refid="deps.path" /> | ||
</classpath> | ||
<include name="**/*.scala" /> | ||
</scalac> | ||
</target> | ||
|
||
|
||
<!-- create properties file with build info --> | ||
|
||
<target name="write-build-info" depends="init" if="ivy.extra.buildpackage"> | ||
<tstamp> | ||
<format property="build.timestamp" pattern="yyyyMMdd-HHmmss" /> | ||
</tstamp> | ||
<pathconvert property="build.properties.path"> | ||
<path location="${ivy.extra.buildpackage}" /> | ||
<unpackagemapper from="${basedir}/*" to="${target.dir}/classes/*" /> | ||
</pathconvert> | ||
<propertyfile file="${build.properties.path}/build.properties"> | ||
<entry key="name" value="${ivy.module}" /> | ||
<entry key="version" value="${ivy.revision}" /> | ||
<entry key="build_name" value="${build.timestamp}" /> | ||
</propertyfile> | ||
</target> | ||
|
||
|
||
<!-- copy resources needed by tests and jar --> | ||
|
||
<target name="copy-resources"> | ||
<copy todir="${dist.dir}/libs" flatten="true"> | ||
<path refid="deps.path" /> | ||
</copy> | ||
<pathconvert refid="deps.path" pathsep=" " property="deps.path.jar-format"> | ||
<chainedmapper> | ||
<flattenmapper /> | ||
<globmapper from="*" to="libs/*" /> | ||
</chainedmapper> | ||
</pathconvert> | ||
|
||
<copy todir="${target.dir}/test-classes/resources" failonerror="false"> | ||
<fileset dir="${test.source.dir}/resources" /> | ||
</copy> | ||
<copy todir="${dist.dir}/resources" overwrite="true" failonerror="false"> | ||
<fileset dir="${source.dir}/resources" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="copy-config" if="copy.config"> | ||
<copy todir="${dist.dir}/config"> | ||
<fileset dir="${basedir}/config" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="copy-extra-config" if="config.extra"> | ||
<copy todir="${dist.dir}/config"> | ||
<fileset dir="${config.extra}" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="copy-extra-libs" if="libs.extra"> | ||
<copy todir="${dist.dir}/libs"> | ||
<path refid="libs.extra" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="copy-extra-dist" if="dist.extra"> | ||
<copy todir="${dist.dir}"> | ||
<path refid="dist.extra" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="copy-extra" depends="copy-resources, copy-config, copy-extra-config, copy-extra-libs, copy-extra-dist" /> | ||
|
||
|
||
<target name="compile" depends="prepare, find-source, compile-thrift, check-jni-source, compile-jni, | ||
compile-java, compile-scala, write-build-info, copy-extra" | ||
description="compile java and scala code" /> | ||
|
||
</project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<project xmlns:ivy="antlib:org.apache.ivy.ant"> | ||
|
||
<target name="vscaladoc" depends="prepare" unless="skip.docs"> | ||
<delete dir="${docs.target.dir}/scaladoc" /> | ||
<mkdir dir="${docs.target.dir}/scaladoc" /> | ||
<pathconvert property="doc.sources" pathsep=" "> | ||
<fileset dir="${source.dir}" includes="**/*.scala" /> | ||
</pathconvert> | ||
<echo message="Building vscaladoc..." /> | ||
<java classname="org.scala_tools.vscaladoc.Main" fork="true" failonerror="true"> | ||
<classpath> | ||
<path refid="bootstrap.path" /> | ||
</classpath> | ||
<arg value="-classpath" /> | ||
<arg pathref="bootstrap.path" /> | ||
<arg value="-d" /> | ||
<arg value="${docs.target.dir}/scaladoc" /> | ||
<arg value="-sourcepath" /> | ||
<arg value="${source.dir}/scala" /> | ||
<arg value="-windowtitle" /> | ||
<arg value="${ivy.module} ${ivy.revision}" /> | ||
<arg value="-doctitle" /> | ||
<arg value="${ivy.module} ${ivy.revision}" /> | ||
<arg value="-linksource" /> | ||
<arg line="${doc.sources}" /> | ||
</java> | ||
</target> | ||
|
||
<target name="docs" depends="prepare,vscaladoc" unless="skip.docs" description="build source documentation" /> | ||
|
||
</project> |
Oops, something went wrong.