Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
170 lines (145 sloc) 6.51 KB
~ Copyright 2009 T Jake Luciani
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
<project name="lucandra" default="lucandra.jar" basedir="."
<property name="src" location="src" />
<property name="thrift" location="thrift" />
<property name="test" location="test" />
<property name="config" location="config" />
<property name="build" location="build" />
<property name="build.classes" location="${build}/classes"/>
<property name="build.test.classes" location="${build}/test-classes"/>
<property name="lib" location="lib" />
<property name="" value=""/>
<property name="cassandra.port" value="9160"/>
<property name="cassandra.framed" value="false"/>
<!-- ivy properties -->
<property name="ivy.version" value="2.1.0" />
<property name="ivy.dir" location="${build}/ivy" />
<property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
<property name="ivy.lib.dir" location="${lib}" />
<property name="ivy_repo_url" value="${ivy.version}/ivy-${ivy.version}.jar"/>
<property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
<target name="init">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${build}/output" />
<mkdir dir="${build.classes}" />
<mkdir dir="${build.test.classes}"/>
<mkdir dir="${ivy.dir}" />
<mkdir dir="${ivy.lib.dir}" />
Allow Ivy to be disabled with "-Dnoivy=".
It is kind of a hack to pretend that we already found it,
but Ant doesn't provide an easy way of blocking dependencies
from executing or checking multiple conditions.
<condition property="ivy.found"><isset property="noivy" /></condition>
<condition property="offline"><isset property="noivy" /></condition>
<target name="ivy-download" description="To download ivy" unless="offline">
<get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
<target name="ivy-probe-antlib">
<condition property="ivy.found">
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
<target name="ivy-init-antlib" depends="ivy-download,ivy-probe-antlib" unless="ivy.found">
<typedef uri="antlib:org.apache.ivy.ant" onerror="fail"
<pathelement location="${ivy.jar}"/>
<condition >
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
You need Apache Ivy 2.0 or later from
It could not be loaded from ${ivy_repo_url}
<target name="resolve" depends="ivy-init-antlib" description="retrieve dependencies with ivy" unless="noivy">
<ivy:retrieve />
<path id="autoivy.classpath">
<fileset dir="${ivy.lib.dir}">
<include name="**/*.jar" />
<!-- =========================== -->
<path id="lucandra.classpath">
<pathelement location="${build.classes}"/>
<pathelement location="${build.test.classes}"/>
<pathelement location="${config}"/>
<fileset dir="${lib}">
<include name="**/*.jar" />
<path refid="autoivy.classpath" />
<target name="compile" depends="init,resolve">
<javac debug="true" destdir="${build.classes}">
<src path="${thrift}"/>
<src path="${src}"/>
<classpath refid="lucandra.classpath"/>
<target name="compile.tests" depends="compile">
<javac debug="true" destdir="${build.test.classes}">
<src path="${test}"/>
<classpath refid="lucandra.classpath"/>
<target name="test" depends="compile.tests">
<echo message="running tests"/>
<mkdir dir="${build}/output"/>
<junit fork="on" failureproperty="testfailed">
<classpath refid="lucandra.classpath"/>
<formatter type="xml" usefile="true"/>
<formatter type="brief" usefile="false"/>
<batchtest todir="${build}/output">
<fileset dir="${build.test.classes}" includes="**/*Test*" />
<jvmarg value="${}"/>
<jvmarg value="-Dcassandra.port=${cassandra.port}"/>
<jvmarg value="-Dcassandra.framed=${cassandra.framed}"/>
<fail if="testfailed" message="Some test(s) failed."/>
<target name="lucandra.jar" depends="compile,compile.tests">
<jar jarfile="lucandra.jar" basedir="${build.classes}" />
<jar jarfile="lucandra-tests.jar" basedir="${build.test.classes}" />
<target name="demo" depends="compile.tests">
<java classname="lucandra.demo.BookmarksDemo">
<classpath refid="lucandra.classpath"/>
<target name="clean">
<delete dir="${build}" />
<delete file="lucandra.jar" />
<delete file="lucandra-tests.jar" />