Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
547 lines (426 sloc) 18.7 KB
<?xml version="1.0"?>
<!--
~ Copyright (c) 2007-2010 Concurrent, Inc. All Rights Reserved.
~
~ Project and contact information: http://www.cascading.org/
~
~ This file is part of the Cascading project.
~
~ Cascading is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Cascading is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Cascading. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="cascading" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<dirname property="cascading.basedir" file="${ant.file.cascading}"/>
<property name="build.number" value="dev"/>
<property file="${user.home}/build.properties"/>
<property file="${cascading.basedir}/version.properties"/>
<property file="${cascading.basedir}/build.properties"/>
<property name="cascading.release.major" value="x.y"/>
<property name="cascading.release.minor" value="z"/>
<condition property="cascading.release.version" value="${cascading.release.major}"
else="${cascading.release.major}.${cascading.release.minor}">
<length string="${cascading.release.minor}" trim="true" length="0"/>
</condition>
<condition property="cascading.release.build" value="${build.number}"
else="wip-${build.number}">
<isset property="cascading.release.final"/>
</condition>
<condition property="cascading.release.full" value="${cascading.release.version}"
else="${cascading.release.version}-${cascading.release.build}">
<isset property="cascading.release.final"/>
</condition>
<property name="cascading.hadoop.compatible.version" value="current"/>
<property name="javac.debug" value="true"/>
<property name="test.haltonerror" value="true"/>
<property name="src" location="${cascading.basedir}/src"/>
<property name="src.core" location="${src}/core"/>
<property name="src.xml" location="${src}/xml"/>
<property name="src.test" location="${src}/test"/>
<property name="build" location="${cascading.basedir}/build/"/>
<property name="build.classes" location="${build}"/>
<property name="build.core" location="${build.classes}/core"/>
<property name="build.xml" location="${build.classes}/xml"/>
<property name="build.test" location="${build.classes}/test"/>
<property name="test.results" location="${build}/testresults"/>
<property name="test.showoutput" value="no"/>
<property name="test.cluster.enabled" value="true"/>
<property name="lib" location="${cascading.basedir}/lib"/>
<property name="lib.xml" location="${lib}/xml"/>
<property name="lib.test" location="${lib}/test"/>
<property name="dist" location="${cascading.basedir}/dist"/>
<property name="javadoc" location="${cascading.basedir}/javadoc"/>
<property name="log" location="${cascading.basedir}/log"/>
<property name="hadoop.home" location="${cascading.basedir}/../hadoop"/>
<property name="jar.cascading" value="cascading-${cascading.release.full}.jar"/>
<property name="jar.cascading-core" value="cascading-core-${cascading.release.full}.jar"/>
<property name="jar.cascading-xml" value="cascading-xml-${cascading.release.full}.jar"/>
<property name="jar.cascading-test" value="cascading-test-${cascading.release.full}.jar"/>
<property name="tar.cascading.prefix"
value="cascading-${cascading.release.full}-${cascading.hadoop.compatible.version}"/>
<property name="tar.cascading" value="${tar.cascading.prefix}.tgz"/>
<path id="build.class.path">
<pathelement location="${build.core}"/>
<pathelement location="${build.xml}"/>
<pathelement location="${build.test}"/>
</path>
<path id="jars.class.path">
<fileset dir="${build}" erroronmissingdir="false">
<include name="cascading-core-*.jar"/>
<include name="cascading-xml-*.jar"/>
<include name="cascading-test-*.jar"/>
</fileset>
<fileset dir="${basedir}" erroronmissingdir="false">
<include name="cascading-core-*.jar"/>
<include name="cascading-xml-*.jar"/>
<include name="cascading-test-*.jar"/>
</fileset>
</path>
<path id="deps.class.path">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.xml}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.test}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hadoop.home}">
<include name="hadoop-*-core.jar"/>
<include name="hadoop-*-test.jar"/>
</fileset>
<fileset dir="${hadoop.home}/build" erroronmissingdir="false">
<include name="hadoop-*-core.jar"/>
<include name="hadoop-*-test.jar"/>
</fileset>
<fileset dir="${hadoop.home}/lib">
<include name="**/*.jar"/>
<exclude name="**/junit*"/>
</fileset>
</path>
<path id="project.class.path">
<path refid="build.class.path"/>
<path refid="deps.class.path"/>
</path>
<path id="package.class.path">
<path refid="jars.class.path"/>
<path refid="deps.class.path"/>
</path>
<path id="project.src.path">
<pathelement location="${src.core}"/>
<pathelement location="${src.xml}"/>
<pathelement location="${src.test}"/>
</path>
<path id="javadoc.src.path">
<pathelement location="${src.core}"/>
<pathelement location="${src.xml}"/>
</path>
<!-- sets up environment -->
<target name="init">
<echo message="initializing cascading environment..."/>
<mkdir dir="${build.core}"/>
<mkdir dir="${build.xml}"/>
<mkdir dir="${build.test}"/>
<mkdir dir="${test.results}"/>
<property name="CLASSPATH" refid="project.class.path"/>
<!--<echo message="${CLASSPATH}"/>-->
</target>
<target name="echo-compile-buildnum" unless="cascading.release.final">
<echo message="build.number=${cascading.release.build}" file="${build.core}/cascading/build.number.properties"/>
</target>
<target name="compile" depends="init,echo-compile-buildnum">
<echo message="building cascading..."/>
<javac srcdir="${src.core}" destdir="${build.core}" verbose="off" debug="${javac.debug}" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.core}/cascading" file="${cascading.basedir}/version.properties"/>
<copy todir="${build.core}">
<fileset dir="${src.core}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<javac srcdir="${src.xml}" destdir="${build.xml}" verbose="off" debug="${javac.debug}" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.xml}">
<fileset dir="${src.xml}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<javac srcdir="${src.test}" destdir="${build.test}" verbose="off" debug="${javac.debug}" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.test}">
<fileset dir="${src.test}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="javadoc" depends="init">
<echo message="creating cascading javadoc..."/>
<delete dir="${javadoc}"/>
<mkdir dir="${javadoc}"/>
<javadoc sourcepathref="javadoc.src.path"
destdir="${javadoc}"
packagenames="cascading.*"
windowtitle="Cascading ${cascading.release.major}">
<classpath refid="project.class.path"/>
<link href="http://java.sun.com/javase/6/docs/api/"/>
<link href="http://dist.codehaus.org/janino/javadoc/"/>
<link href="http://hadoop.apache.org/common/docs/r0.20.2/api/"/>
<bottom><![CDATA[<i>Copyright &#169; 2007-2010 Concurrent, Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- runs JUnit tests -->
<target name="test" depends="init, compile">
<echo message="running all cascading tests..."/>
<mkdir dir="build/test/log"/>
<junit printsummary="true" showoutput="${test.showoutput}" fork="yes" haltonerror="no" haltonfailure="no" dir="."
maxmemory="756m">
<sysproperty key="test.cluster.enabled" value="${test.cluster.enabled}"/>
<sysproperty key="test.build.data" value="data"/>
<sysproperty key="hadoop.log.dir" value="build/test/log"/>
<!--<jvmarg value="-Xdebug"/>--><!--<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"/>-->
<classpath>
<path refid="project.class.path"/>
<pathelement path="${java.class.path}"/>
</classpath>
<formatter type="plain" usefile="true"/>
<test name="${testcase}" todir="${test.results}" if="testcase" haltonfailure="${test.haltonerror}"/>
<batchtest todir="${test.results}" haltonfailure="${test.haltonerror}" unless="testcase">
<fileset dir="${src.test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="run-test-package">
<echo message="running all packaged cascading tests..."/>
<mkdir dir="package-tests"/>
<untar src="${tar.cascading}" compression="gzip" dest="package-tests"/>
<!-- hack to support data files in test packages -->
<unzip src="package-tests/${tar.cascading.prefix}/${jar.cascading-test}"
dest="package-tests/${tar.cascading.prefix}/build/test">
<patternset>
<include name="data/**"/>
</patternset>
</unzip>
<ant inheritAll="false" antfile="package-tests/${tar.cascading.prefix}/build.xml"
target="test-package">
<property name="hadoop.home" value="${hadoop.home}"/>
</ant>
</target>
<target name="test-package">
<echo message="running all packaged cascading tests..."/>
<mkdir dir="tests"/>
<mkdir dir="tests/log"/>
<mkdir dir="tests/results"/>
<junit printsummary="true" showoutput="${test.showoutput}" fork="yes" haltonerror="no" haltonfailure="no" dir="."
maxmemory="756m">
<sysproperty key="test.cluster.enabled" value="${test.cluster.enabled}"/>
<sysproperty key="test.build.data" value="tests/data"/>
<sysproperty key="hadoop.log.dir" value="tests/log"/>
<!--<jvmarg value="-Xdebug"/>--><!--<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"/>-->
<classpath>
<path refid="package.class.path"/>
<pathelement path="${java.class.path}"/>
</classpath>
<formatter type="plain" usefile="true"/>
<test name="${testcase}" todir="${test.results}" if="testcase" haltonfailure="${test.haltonerror}"/>
<batchtest todir="tests/results" haltonfailure="${test.haltonerror}" unless="testcase">
<fileset dir="${src.test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- cleans up build artifacts -->
<target name="clean">
<echo message="cleaning cascading..."/>
<delete dir="${build}"/>
<delete dir="${javadoc}"/>
</target>
<!-- removes build -->
<target name="nuke">
<echo message="nuking cascading..."/>
<delete dir="${build}"/>
<delete dir="${javadoc}"/>
<delete dir="${dist}"/>
<delete dir="${log}"/>
<delete dir="package-tests"/>
<delete dir="tests"/>
<delete>
<fileset dir="." includes="cascading*.tgz"/>
<fileset dir="." includes="TEST-*"/>
<fileset dir="." includes="junit*.properties"/>
<fileset dir="." includes="**/.DS_Store"/>
</delete>
</target>
<!-- jar build -->
<target name="jar" depends="compile">
<echo message="jarring cascading..."/>
<delete file="${build}/${jar.cascading}"/>
<delete file="${build}/${jar.cascading-core}"/>
<delete file="${build}/${jar.cascading-xml}"/>
<delete file="${build}/${jar.cascading-test}"/>
<delete dir="${build.core}/lib"/>
<manifest file="${build}/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}"/>
</manifest>
<jar jarfile="${build}/${jar.cascading-core}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.core}"/>
</jar>
<jar jarfile="${build}/${jar.cascading-xml}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.xml}"/>
</jar>
<jar jarfile="${build}/${jar.cascading-test}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.test}">
<include name="cascading/**"/>
<include name="data/**"/>
<include name="log4j.properties"/>
<include name="hadoop-site.xml"/>
</fileset>
</jar>
<!-- hadoop supports jars in a lib directory -->
<mkdir dir="${build.core}/lib"/>
<copy todir="${build.core}/lib">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</copy>
<delete dir="${build.core}/META-INF"/>
<mkdir dir="${build.xml}/lib"/>
<copy todir="${build.xml}/lib">
<fileset dir="${lib.xml}">
<include name="*.jar"/>
</fileset>
</copy>
<delete dir="${build.core}/META-INF"/>
<jar jarfile="${build}/${jar.cascading}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.core}"/>
<fileset dir="${build.xml}"/>
</jar>
</target>
<target name="echo-dist-buildnum" unless="cascading.release.final">
<mkdir dir="${dist}"/>
<echo message="build.number=${cascading.release.build}" file="${dist}/build.number.properties"/>
</target>
<target name="dist" depends="jar,javadoc,echo-dist-buildnum">
<echo message="creating version: ${cascading.release.full}"/>
<mkdir dir="${dist}"/>
<copy todir="${dist}">
<fileset dir=".">
<exclude name="build.properties"/>
<exclude name="parent-build.xml"/>
<exclude name=".git*/**"/>
<exclude name="build/**"/>
<exclude name="dist/**"/>
<exclude name="tests/**"/>
<exclude name="package-tests/**"/>
<exclude name="www/**"/>
<exclude name="log/**"/>
<exclude name="**/CVS/**"/>
<exclude name="**/*.tgz"/>
<exclude name="TEST-*"/>
<exclude name="**/.DS_Store"/>
</fileset>
</copy>
<copy file="${build}/${jar.cascading}" todir="${dist}"/>
<copy file="${build}/${jar.cascading-core}" todir="${dist}"/>
<copy file="${build}/${jar.cascading-xml}" todir="${dist}"/>
<copy file="${build}/${jar.cascading-test}" todir="${dist}"/>
</target>
<target name="package" depends="nuke,dist">
<tar destfile="${tar.cascading}"
compression="gzip" longfile="gnu">
<tarfileset dir="dist/" prefix="${tar.cascading.prefix}">
<include name="**/**"/>
</tarfileset>
</tar>
</target>
<target name="s3-package" if="package.remote.bucket">
<property file="${package.aws.properties}"/>
<taskdef name="S3Upload" classname="dak.ant.taskdefs.S3Upload"/>
<S3Upload verbose="true"
accessId="${package.aws.accessId}"
secretKey="${package.aws.secretKey}"
bucket="${package.remote.bucket}"
prefix="cascading/${cascading.release.major}/"
publicRead="true">
<fileset file="${tar.cascading}"/>
</S3Upload>
<echo
message="http://${package.remote.bucket}/cascading/${cascading.release.major}/${tar.cascading} ${build.vcs.number}"
file="cascading-current.txt"/>
<property name="package.remote.port" value="22"/>
<scp file="cascading-current.txt" remoteTofile="${package.remote.path}/${cascading.release.major}/${tar.cascading}"
keyfile="${package.remote.keyfile}"
passphrase="" port="${package.remote.port}" trust="true"/>
<delete file="cascading-current.txt"/>
</target>
<target name="retrieve">
<ivy:settings id="ivy.conjars.settings" url="http://conjars.org/repo/ivysettings.xml"/>
<ivy:retrieve settingsRef="ivy.conjars.settings" conf="core"
pattern="${lib}/[artifact]-[revision].[ext]" sync="false"/>
<ivy:retrieve settingsRef="ivy.conjars.settings" conf="test,xml"
pattern="${lib}/[conf]/[artifact]-[revision].[ext]" sync="false"/>
</target>
<!--<target name="retrieve-hadoop">-->
<!--<ivy:settings id="ivy.conjars.settings" file="../repo/ivysettings.xml"/>-->
<!---->
<!--<ivy:retrieve settingsRef="ivy.conjars.settings" conf="compile"-->
<!--pattern="${build}/[conf]/[artifact]-[revision].[ext]" sync="true"/>-->
<!--</target>-->
<target name="publish" depends="jar">
<ivy:settings id="ivy.conjars.settings" url="http://conjars.org/repo/ivysettings.xml"/>
<ivy:resolve settingsRef="ivy.conjars.settings" file="ivy.xml"/>
<ivy:makepom ivyfile="ivy.xml" artifactName="cascading-core"
pomfile="${build}/cascading-core-${cascading.release.full}.pom"
conf="core,default.provided">
<ivy:mapping conf="core" scope="compile"/>
<ivy:mapping conf="default.provided" scope="provided"/>
</ivy:makepom>
<ivy:makepom ivyfile="ivy.xml" artifactName="cascading-xml"
pomfile="${build}/cascading-xml-${cascading.release.full}.pom"
conf="xml">
<dependency group="cascading" artifact="cascading-core" version="${cascading.release.full}"/>
<ivy:mapping conf="xml" scope="compile"/>
</ivy:makepom>
<ivy:makepom ivyfile="ivy.xml" artifactName="cascading-test"
pomfile="${build}/cascading-test-${cascading.release.full}.pom"
conf="test,test.provided">
<dependency group="cascading" artifact="cascading-core" version="${cascading.release.full}" scope="test"/>
<dependency group="cascading" artifact="cascading-xml" version="${cascading.release.full}" scope="test"/>
<ivy:mapping conf="test.provided" scope="provided"/>
<ivy:mapping conf="test" scope="compile"/>
</ivy:makepom>
<scp todir="repo@conjars.org:" keyfile="${repo.keyfile}" passphrase="" trust="true">
<fileset dir="${build}">
<include name="cascading-core-${cascading.release.full}.pom"/>
<include name="${jar.cascading-core}"/>
</fileset>
</scp>
<scp todir="repo@conjars.org:" keyfile="${repo.keyfile}" passphrase="" trust="true">
<fileset dir="${build}">
<include name="cascading-xml-${cascading.release.full}.pom"/>
<include name="${jar.cascading-xml}"/>
</fileset>
</scp>
<scp todir="repo@conjars.org:" keyfile="${repo.keyfile}" passphrase="" trust="true">
<fileset dir="${build}">
<include name="cascading-test-${cascading.release.full}.pom"/>
<include name="${jar.cascading-test}"/>
</fileset>
</scp>
</target>
</project>
Something went wrong with that request. Please try again.