Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

1776 lines (1622 sloc) 67.278 kb
<?xml version="1.0" ?>
<project default="default" name="VoltDB">
<!-- GENERAL HELPER MACROS -->
<macrodef name="envdefault">
<attribute name="prop" />
<attribute name="var" />
<attribute name="default" />
<sequential>
<condition property="@{prop}" value="${env.@{var}}" else="@{default}">
<isset property="env.@{var}" />
</condition>
</sequential>
</macrodef>
<macrodef name="invoke-javac">
<attribute name="srcdir"/>
<attribute name="destdir" default="${build.prod.dir}"/>
<attribute name="excludes" default=""/>
<sequential>
<javac
target="1.6"
source="1.6"
srcdir="@{srcdir}"
destdir="@{destdir}"
excludes="@{excludes}"
encoding='UTF-8'
debug='true'>
<classpath refid="project.classpath" />
</javac>
</sequential>
</macrodef>
<!-- PATHS AND PROPERTIES -->
<!-- make environment var foo available as env.foo -->
<property environment="env"/>
<!-- allow env.VOLTBUILD to override "build" property -->
<envdefault prop="build" var="VOLTBUILD" default="release" />
<!-- allow env.VOLTPRO to override "voltpro" property -->
<condition property="voltpro" value="${env.VOLTPRO}">
<isset property="env.VOLTPRO"/>
</condition>
<!-- stub the voltpro classpath fileset so a fileset with this id always exists -->
<fileset id="voltpro.classpath" file="build.xml">
<exclude name="build.xml"/>
</fileset>
<!-- import the pro build.xml if it exists and is requested -->
<import file="${voltpro}/build.xml" optional="true"/>
<property name='base.dir' location='.' />
<property name='build.dir' location='obj/${build}' />
<property name='build.prod.dir' location='${build.dir}/prod' />
<property name='build.test.dir' location='${build.dir}/test' />
<property name='raw.dist.dir' location='${build.dir}' />
<property name='dist.dir' location='${build.dir}/dist' />
<property name='dist.examples.dir' location='${dist.dir}/examples' />
<property name='doc.dir' location='doc' />
<property name='src.gpl.dir' location='src/frontend' />
<property name='src.hsqldb.dir' location='src/hsqldb19b3' />
<property name='src.test.dir' location='tests/frontend' />
<property name='src.hsqldb.test.dir' location='tests/hsqldb' />
<property name='src.studio.dir' location='src/frontend/org/voltdb/studio' />
<property name='build.testoutput.dir' location='${build.dir}/testoutput' />
<property name='build.testobjects.dir' location='${build.dir}/testobjects' />
<property name='lib.dir' location='lib' />
<property name='vendor.lib.dir' location='third_party/java/jars' />
<property name='vendor.src.dir' location='third_party/java/src' />
<property name='src.ee.parent.dir' location='src/ee' />
<property name='src.ee.dir' location='src/ee' />
<property name='src.catalog.dir' location='src/catgen' />
<property name='m1catalog' location='${src.test.dir}/org/voltdb/catalog/catalog.txt' />
<property name='depcache' value='.depcache' />
<!-- emma build instrumentation location -->
<property name='build.instr.dir' location='${build.dir}/instr' />
<!-- Default heap size for Volt server (MB) -->
<condition property="volt.server.memory" value="2048">
<not><isset property="volt.server.memory"/></not>
</condition>
<!-- Default heap size for Volt clients+loaders (MB) -->
<condition property="volt.client.memory" value="2048">
<not><isset property="volt.client.memory"/></not>
</condition>
<!-- Overridden in the Hudson test script. -->
<property name='junit.haltonfailure' value='false' />
<property name="j2se_api" value="http://download.oracle.com/javase/6/docs/api/"/>
<path id='project.classpath'>
<pathelement location='${build.instr.dir}' />
<pathelement location='${build.prod.dir}' />
<pathelement location='${build.test.dir}' />
<fileset dir='${lib.dir}'>
<include name='*.jar' />
</fileset>
<fileset dir='${vendor.lib.dir}'>
<include name='*.jar' />
<exclude name='ant.jar' />
</fileset>
<pathelement path="${java.class.path}"/>
<fileset refid="voltpro.classpath"/>
</path>
<!-- select which set of regression suite configuration types to run -->
<condition property="regressions" value="${regressions}" else="all">
<isset property="regressions"/>
</condition>
<!-- Workload Tracer Properties -->
<condition property="workload.trace.class" value="">
<not><isset property="workload.trace.class"/></not>
</condition>
<condition property="workload.trace.path" value="">
<not><isset property="workload.trace.path"/></not>
</condition>
<condition property="workload.trace.ignore" value="">
<not><isset property="workload.trace.ignore"/></not>
</condition>
<!--
***************************************
PRIMARY ENTRY POINTS
***************************************
-->
<target name="default"
depends="compile, ee, voltdb.jar"
description="Compile Java classes and C++ JNI library."
/>
<target name="check"
depends="compile, licensecheck, voltdbipc, ee"
description="Run Java and C++ JNI testcases and test plan fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="9000000">
<arg value="eecheck" />
<arg value="junit" />
<arg value="distcheck" />
<arg value="pythonfser" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="newcheck"
depends="licensecheck,compile, voltdbipc"
description="Run Java and C++ JNI testcases and test plan fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<mkdir dir='${build.dir}/testrunner/' />
<copy todir='${build.dir}/testrunner/'>
<fileset dir="tests/testrunner">
<exclude name="**/.svn" />
</fileset>
</copy>
<exec executable="/bin/sh"
failonerror="true"
timeout="1800000"
dir="${build.dir}"
newenvironment='true'>
<arg value="testrunner/test.py" />
</exec>
</target>
<target name="check_quick"
depends="compile, voltdbipc"
description="Run a subset of Java testcases and test fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='480000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="1800000">
<arg value="licensecheck" />
<arg value="junit_quick" />
<arg value="distcheck" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="quarantine"
depends="compile, ee"
description="Run quarantined tests." >
<condition property="timeoutLength" value="${timeoutLength}" else='480000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="1800000">
<arg value="junit_quarantine" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="all"
depends="compile, ee, junit, eecheck, javadoc, jars"
description="Do all tasks."
/>
<target name="jars"
depends="voltdb.jar, voltdbfat.jar, voltdbclient.jar"
description="Create production JAR files."
/>
<target name="dist"
depends="dist_client, dist_internal, dist_voltcache, dist_voltkv"
description="Create VoltDB release packages with examples and documentation."
/>
<target name="dist_voltcache" depends="dist_internal"
description="Create VoltDB release package with VoltCache reference app.">
<refapp_macro appname="voltcache" />
</target>
<target name="dist_voltkv" depends="dist_internal"
description="Create VoltDB release package with VoltKV reference app.">
<refapp_macro appname="voltkv" />
</target>
<target name="dist_refapp" depends="dist_internal"
description="Create reference application release package with app supplied in ant invocation.">
<fail unless="appname" message="must specify an app name with -Dappname=" />
<refapp_macro appname="${appname}" />
</target>
<!--
***************************************
DISTRIBUTION
***************************************
-->
<macrodef name="voltbin-macro">
<sequential>
<mkdir dir="${build.dir}/voltbin" />
<copy todir="${build.dir}/voltbin" flatten="true">
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="nativelibs/libvoltdb*" />
<include name="prod/voltdbfat.jar" />
</fileset>
</copy>
<!-- use cp to preserve permissions -->
<exec dir="tools" executable="cp" failonerror="true">
<arg line="getmac.py"/>
<arg line="killstragglers.sh"/>
<arg line="${build.dir}/voltbin"/>
</exec>
<!-- populate the logging configuration files -->
<copy tofile="${build.dir}/voltbin/log4j.properties" file="voltdb/log4j.properties"/>
<copy tofile="${build.dir}/voltbin/log4j.xml" file="voltdb/log4j.xml"/>
</sequential>
</macrodef>
<target name="voltbin" depends="compile, ee, jars">
<voltbin-macro/>
<!-- strip the voltbin shared library (~40x size reduction) -->
<exec dir='${build.dir}/voltbin' executable='/bin/sh'>
<arg line="-c '/usr/bin/strip -x libvoltdb*'"/>
</exec>
</target>
<target name="voltbin_profile" depends="compile, ee_profile, jars">
<voltbin-macro/>
</target>
<target name="voltbin_copy" depends="compile,ee,jars">
<voltbin-macro/>
<!-- copy the voltbin contents to $HOME/voltbin -->
<exec dir="${build.dir}" executable='/bin/sh'>
<arg line="-c 'cp voltbin/* $HOME/voltbin/'"/>
</exec>
</target>
<target name="javadoc">
<!-- populate selected server/compiler javadoc documentation -->
<javadoc
destdir="doc/javadoc/procedure-api"
Public="true"
version="true"
use="true"
nodeprecated="true"
Overview='${src.gpl.dir}/overview-public.html'
Windowtitle='VoltDB Server APIs'>
<link href="${j2se_api}"/>
<classpath refid='project.classpath' />
<fileset dir="." defaultexcludes="yes">
<include name="src/frontend/org/voltdb/VoltTable.java" />
<include name="src/frontend/org/voltdb/VoltTableRow.java" />
<include name="src/frontend/org/voltdb/VoltProcedure.java" />
<include name="src/frontend/org/voltdb/SQLStmt.java" />
<include name="src/frontend/org/voltdb/VoltType.java" />
<include name="src/frontend/org/voltdb/ProcInfo.java" />
<include name="src/frontend/org/voltdb/types/TimestampType.java" />
</fileset>
</javadoc>
<!-- populate selected client javadoc documentation -->
<javadoc
destdir="doc/javadoc/java-client-api"
access="protected"
version="true"
use="true"
nodeprecated="true"
Overview='${src.gpl.dir}/overview-public.html'
Windowtitle='VoltDB Client APIs'>
<link href="${j2se_api}"/>
<classpath refid='project.classpath' />
<fileset dir="." defaultexcludes="yes">
<include name="src/frontend/org/voltdb/VoltTable.java" />
<include name="src/frontend/org/voltdb/VoltTableRow.java" />
<include name="src/frontend/org/voltdb/VoltClient.java" />
<include name="src/frontend/org/voltdb/VoltType.java" />
<include name="src/frontend/org/voltdb/client/Client.java" />
<include name="src/frontend/org/voltdb/client/NoConnectionsException.java" />
<include name="src/frontend/org/voltdb/client/ProcedureCallback.java" />
<include name="src/frontend/org/voltdb/client/ClientConfig.java" />
<include name="src/frontend/org/voltdb/client/ClientFactory.java" />
<include name="src/frontend/org/voltdb/client/SyncCallback.java" />
<include name="src/frontend/org/voltdb/client/NullCallback.java" />
<include name="src/frontend/org/voltdb/client/ProcCallException.java" />
<include name="src/frontend/org/voltdb/client/ClientStatusListener.java" />
<include name="src/frontend/org/voltdb/client/ClientStatusListenerExt.java" />
<include name="src/frontend/org/voltdb/client/ClientResponse.java" />
<include name="src/frontend/org/voltdb/client/StatsUploaderSettings.java" />
<include name="src/frontend/org/voltdb/client/exampleutils/*.java" />
<include name="src/frontend/org/voltdb/types/TimestampType.java" />
</fileset>
</javadoc>
</target>
<target name="dist_internal" depends="compile, ee, javadoc, voltdb.jar, voltdbclient.jar">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}" />
<!-- populate the doc dir -->
<copy todir="${dist.dir}/">
<fileset dir="." defaultexcludes="yes">
<include name="Click Here to Start.html"/>
<include name="README"/>
<include name="README.thirdparty"/>
<include name="LICENSE"/>
<include name="bin/**"/>
<include name="doc/**"/>
<include name="examples/**"/>
<include name="lib/**"/>
<include name="tools/demo/**"/>
<include name="tools/sqlcmd/**"/>
<include name="voltdb/**"/>
<exclude name=".gitignore"/>
</fileset>
</copy>
<antcall target="copy_pro_bin"/>
<!-- populate java and native libraries -->
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="voltdb" defaultexcludes="yes">
<include name="voltdb-${dist.version}.jar" />
<include name="voltdbclient-${dist.version}.jar" />
</fileset>
</copy>
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="nativelibs/libvoltdb*" />
</fileset>
</copy>
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="." defaultexcludes="yes">
<include name="third_party/cpp/jnilib/libjzmq*" />
</fileset>
</copy>
<!-- save the symbols from the shared library -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/objcopy --only-keep-debug libvoltdb-${dist.version}.so ${build.dir}/voltdb-${dist.version}.sym'" />
</exec>
<!-- strip the voltbin shared library (~40x size reduction) -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/strip --strip-debug --strip-unneeded libvoltdb*'"/>
</exec>
<!-- embed the path to the symbol file into the ELF binary -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/objcopy --add-gnu-debuglink=voltdb-${dist.version}.sym libvoltdb-${dist.version}.so'" />
</exec>
<!-- copy studio.web -->
<mkdir dir="${dist.dir}/tools/studio.web" />
<copy todir="${dist.dir}/tools/studio.web">
<fileset dir="${src.gpl.dir}/org/voltdb/studio" defaultexcludes="yes">
<include name="**"/>
</fileset>
</copy>
<!-- populate project generator -->
<exec dir="src/proj_gen/" executable="python">
<arg line="generator_compiler.py"/>
</exec>
<move tofile="${dist.dir}/tools/generate" file="src/proj_gen/generate" />
<!-- add the Project and Deployment file schemas to the dist -->
<copy todir="${dist.dir}/tools" file="src/frontend/org/voltdb/compiler/ProjectFileSchema.xsd"/>
<copy todir="${dist.dir}/tools" file="src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd"/>
<!-- copy license to voltdb dir -->
<copy todir="${dist.dir}/voltdb" file="LICENSE"/>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}" defaultexcludes="yes">
<include name="bin/*"/>
<include name="tools/demo/launch"/>
<include name="doc/tutorials/**/run.sh"/>
<include name="examples/**/run.sh"/>
<include name="tools/generate"/>
<include name="tools/sqlcmd/sqlcmd"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist"/>
<arg value="${raw.dist.dir}/voltdb-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-${dist.version}.tar.gz"/>
<arg value="voltdb-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-${dist.version}"/>
<arg value="${raw.dist.dir}/dist"/>
</exec>
<!-- package up studio web trivially -->
<zip destfile="${raw.dist.dir}/voltdb-studio.web-${dist.version}.zip">
<fileset dir="${src.studio.dir}" defaultexcludes="yes">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="dist_client" depends="dist_internal"
description="Hacky Java client package target">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}-client-java" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}-client-java" />
<!-- populate the dist-client-java dir from the superset dist -->
<copy todir="${dist.dir}-client-java/">
<fileset dir="${dist.dir}/" defaultexcludes="yes">
<include name="**/*"/>
<exclude name=".gitignore"/>
<exclude name="bin/"/>
<exclude name="voltdb/libvoltdb*"/>
<exclude name="voltdb/voltdb-*.jar"/>
<exclude name="voltdb/libjzmq*"/>
</fileset>
</copy>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}-client-java/" defaultexcludes="yes">
<include name="tools/demo/launch"/>
<include name="doc/tutorials/auction/run.sh"/>
<include name="doc/tutorials/helloworld/run.sh"/>
<include name="examples/voltcache/run.sh"/>
<include name="examples/voltkv/run.sh"/>
<include name="examples/voter/run.sh"/>
<include name="tools/generate"/>
<include name="tools/sqlcmd/sqlcmd"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist-client-java"/>
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}.tar.gz"/>
<arg value="voltdb-client-java-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}"/>
<arg value="${raw.dist.dir}/dist-client-java"/>
</exec>
</target>
<macrodef name="refapp_macro"
description="Build a kit that only includes a single reference app">
<attribute name="appname"/>
<sequential>
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}-@{appname}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}-@{appname}" />
<mkdir dir="${dist.dir}-@{appname}/@{appname}" />
<!-- populate the examples -->
<copy todir="${dist.dir}-@{appname}/@{appname}">
<fileset dir="${dist.dir}/examples/@{appname}" defaultexcludes="yes">
<include name="**/*"/>
<exclude name=".gitignore"/>
</fileset>
</copy>
<!-- populate the bin/lib/voltdb/etc... dirs -->
<copy todir="${dist.dir}-@{appname}" >
<fileset dir="${dist.dir}" defaultexcludes="yes">
<include name="README" />
<include name="LICENSE" />
<include name="README.thirdparty" />
<include name="voltdb/**" />
<include name="lib/**" />
<include name="bin/**" />
</fileset>
</copy>
<!-- rewrite the run.sh script's relative directories -->
<replace
file="${dist.dir}-@{appname}/@{appname}/run.sh"
token="../../"
value="../"/>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}-@{appname}" defaultexcludes="yes">
<include name="bin/*"/>
<include name="@{appname}/run.sh"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist-@{appname}"/>
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}.tar.gz"/>
<arg value="voltdb-@{appname}-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}"/>
<arg value="${raw.dist.dir}/dist-@{appname}"/>
</exec>
</sequential>
</macrodef>
<!--
***************************************
CLEANING
***************************************
-->
<target name='clean' description="Remove all compiled files." depends="cleantmp">
<exec dir='examples/voter' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='examples/voltcache' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='examples/voltkv' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='doc/tutorials/auction' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='doc/tutorials/helloworld' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec> <exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf obj/*'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf voltdb/*.jar'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf voltdb/*.so'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf src/ee/catalog/*'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf src/frontend/org/voltdb/catalog/*.java'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf *.jar'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf doc/javadoc/procedure-api/* doc/javadoc/java-client-api/*'"/>
</exec>
</target>
<target name='cleantmp' description="Remove all data files Volt generated in /tmp.">
<exec dir='.' executable='/bin/sh' failonerror='false'>
<arg line="-c 'rm -rf /tmp/myApp*.tmp *.vpt *.digest'"/>
</exec>
</target>
<!--
***************************************
JAR BUILDING
***************************************
-->
<target name="buildinfo">
<loadfile property='dist.version' srcFile='version.txt'>
<filterchain><striplinebreaks/></filterchain>
</loadfile>
<exec dir="." executable="tools/getgitinfo.py">
<arg line='${dist.version}' />
</exec>
</target>
<target name="voltdb.jar" depends="compile, buildinfo">
<jar destfile="voltdb/voltdb-${dist.version}.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/eclipse/jetty_voltpatches/**" />
<include name="javax/servlet_voltpatches/**" />
<include name="au/com/bytecode/opencsv_voltpatches/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/apache/jute_voltpatches/**" />
<include name="org/apache/zookeeper_voltpatches/**" />
</fileset>
<fileset dir="${build.test.dir}" defaultexcludes="yes" >
<include name="org/voltdb/ServerThread.class" />
<include name="org/voltdb/benchmark/*" />
<include name="org/voltdb/regressionsuites/Local*" />
<include name="org/voltdb/regressionsuites/MultiConfigSuiteBuilder.class" />
<include name="org/voltdb/regressionsuites/RegressionSuite.class" />
<include name="org/voltdb/regressionsuites/VoltServerConfig.class" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB compiler, server, and client interface libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<target name="voltdbclient.jar" depends="compile, buildinfo">
<jar destfile="voltdb/voltdbclient-${dist.version}.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/json_voltpatches/**" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB client interface libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<target name="voltdbthin.jar" depends="compile"
description="used by testability-explorer">
<jar destfile="${build.prod.dir}/voltdbthin.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
</jar>
</target>
<target name="voltdbfat.jar" depends="compile, buildinfo">
<jar destfile="${build.prod.dir}/voltdbfat.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/eclipse/jetty_voltpatches/**" />
<include name="org/opencsv_voltpatches/**" />
<include name="javax/servlet_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/apache/jute_voltpatches/**" />
<include name="org/apache/zookeeper_voltpatches/**" />
</fileset>
<fileset dir="${build.test.dir}" defaultexcludes="no" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="${src.gpl.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="${src.test.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB compiler, server, client and test libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<!--
***************************************
JAVA COMPILATION
***************************************
-->
<target name="compile" depends="catalog, compile_core, compile_pro"
description="Compile all Java source and test classes"/>
<target name="compile_core">
<mkdir dir='${build.prod.dir}' />
<mkdir dir='${build.test.dir}' />
<exec
dir='${src.gpl.dir}/org/voltdb/utils'
executable='${src.gpl.dir}/org/voltdb/utils/generate_logkeys.py'
failonerror='true' />
<depend
srcdir="${src.hsqldb.dir}:${src.hsqldb.test.dir}:${src.gpl.dir}:${src.test.dir}:${vendor.src.dir}"
destdir="${build.prod.dir}:${build.test.dir}"
cache="${depcache}">
<classpath refid="project.classpath" />
</depend>
<!-- copy resources needed for logging messages -->
<copy todir="${build.prod.dir}">
<fileset dir="${src.hsqldb.dir}" includes="**/*.properties" />
<fileset dir="${src.gpl.dir}" includes="**/*.properties"/>
<fileset dir="${src.gpl.dir}" includes="**/*.xml" />
<fileset dir="${src.gpl.dir}" includes="**/admintemplate.html" />
</copy>
<copy todir='${build.prod.dir}/org/hsqldb_voltpatches/resources'>
<fileset dir="${src.hsqldb.dir}/org/hsqldb_voltpatches/resources">
<include name="*"/>
</fileset>
</copy>
<copy todir='${build.prod.dir}/org/voltdb/studio'>
<fileset dir="${src.gpl.dir}/org/voltdb/studio">
<include name="**"/>
</fileset>
</copy>
<!-- README files we want to include in the jar -->
<copy flatten='false' todir='${build.prod.dir}'>
<fileset dir="${src.gpl.dir}">
<include name="**/*Readme.txt"/>
</fileset>
</copy>
<!-- pick src//** schemas as package resources -->
<copy flatten='false' todir="${build.prod.dir}">
<fileset dir="${src.gpl.dir}">
<include name="**/*.xsd"/>
</fileset>
</copy>
<!-- the ddl files used by tests and benchmark clients are copied
relative to the client class and found with class.getResource() -->
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/*.sql"/>
</fileset>
</copy>
<!-- Compressed resources for tests -->
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/*.tar.gz"/>
</fileset>
</copy>
<!-- copy file containing workloads for voltdbfat.jar -->
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/microbench.xml"/>
</fileset>
</copy>
<copy todir='${build.test.dir}/org/hsqldb_voltpatches'>
<fileset dir="${src.hsqldb.test.dir}/org/hsqldb_voltpatches">
<include name="*.sql"/>
</fileset>
</copy>
<!-- compile the individual source directories -->
<invoke-javac srcdir="${src.hsqldb.dir}"/>
<invoke-javac srcdir="${src.gpl.dir}:${vendor.src.dir}"/>
<!-- compile the individual test directories -->
<invoke-javac srcdir="${src.hsqldb.test.dir}" destdir='${build.test.dir}'/>
<invoke-javac srcdir="${src.test.dir}" destdir='${build.test.dir}'
excludes="org/voltdb/benchmark/tpcc/JDBCClient.java"/>
</target>
<!-- This task only executes if the voltpro.flavor property is set. -->
<target name="compile_pro" if="voltpro.flavor">
<antcall target="voltpro.compile"/>
</target>
<target name="copy_pro_bin" if="voltpro.flavor">
<copy todir="${dist.dir}/">
<fileset dir="${voltpro.basedir}" includes="bin/**"/>
</copy>
</target>
<!--
***************************************
NATIVE EE STUFF
***************************************
-->
<target name='catalog'
description="Generate catalog source code.">
<exec dir="${src.catalog.dir}" executable='python' failonerror='true'>
<arg line="catalog.py"/>
</exec>
<exec dir="${src.catalog.dir}" executable='python' failonerror='true'>
<arg line="install.py"/>
</exec>
</target>
<target name='jnicompile'
depends='compile, jnicompile_temp, uptodate_jni_h.check'
description="Build C++ JNI library."
unless='uptodate_jni_h'>
<delete file="${src.ee.dir}/org_voltdb_jni_ExecutionEngine.h" />
<delete file="${src.ee.dir}/org_voltdb_utils_DBBPool.h" />
<move
file='${build.dir}/org_voltdb_jni_ExecutionEngine.h'
todir='${src.ee.dir}'
/>
<move
file='${build.dir}/org_voltdb_utils_DBBPool.h'
todir='${src.ee.dir}'
/>
</target>
<target name='uptodate_jni_h.check' depends='jnicompile_temp'>
<condition property='uptodate_jni_h'>
<and>
<filesmatch
file1="${src.ee.dir}/org_voltdb_jni_ExecutionEngine.h"
file2="${build.dir}/org_voltdb_jni_ExecutionEngine.h"
/>
<filesmatch
file1="${src.ee.dir}/org_voltdb_utils_DBBPool.h"
file2="${build.dir}/org_voltdb_utils_DBBPool.h"
/>
</and>
</condition>
</target>
<target name='jnicompile_temp'>
<delete file="${build.dir}/org_voltdb_jni_ExecutionEngine.h"/>
<delete file="${build.dir}/org_voltdb_utils_DBBPool.h" />
<javah
classpathref="project.classpath"
force="yes"
verbose="yes"
class="org.voltdb.jni.ExecutionEngine"
destdir="${build.dir}"
/>
<javah
classpathref="project.classpath"
force="yes"
verbose="yes"
class="org.voltdb.utils.DBBPool"
destdir="${build.dir}"
/>
</target>
<target name="eecheck" depends="ee"
description="Run testcases for C++ JNI library.">
<exec dir='.' executable='python' failonerror='true'>
<env key='M1CATALOG_PATH' value='${m1catalog}' />
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<env key="EETESTSUITE" value="${eetestsuite}"/>
<arg line="build.py ${build} test" />
</exec>
</target>
<target name='voltdbipc' depends="ee"
description="Build the IPC client.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py ${build} voltdbipc" />
</exec>
</target>
<target name='ee' depends="catalog, jnicompile, buildinfo"
description="Build C++ JNI library and copy it to production folder.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py ${build}" />
</exec>
<copy todir='voltdb'>
<fileset dir="${build.dir}/nativelibs">
<include name="libvoltdb-${dist.version}.*"/>
</fileset>
</copy>
</target>
<target name='ee_profile' depends="catalog, jnicompile"
description="Build C++ JNI lib dl-ing perf tools and copy it to production folder.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py ${build} profile" />
</exec>
</target>
<target name='execplanfrag' depends="ee"
description="Create test program that loads catalog and tables and executes a plan fragment.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py EXECPLANFRAG ${build}" />
</exec>
</target>
<!--
***************************************
LICENSING
***************************************
-->
<target name='licensecheck' description="make sure all source files have approved licenses">
<exec dir='tools' executable='python' failonerror='true'>
<arg line="licensescheck.py" />
<arg line="${voltpro}"/>
</exec>
</target>
<!--
***************************************
TEST CASES
***************************************
-->
<target name="pythonfser" description="run python voltdbclient tests">
<property name="build.dir.suffix" value="" /> <!-- Default -->
<property name='classpath' refid='project.classpath' />
<property name='echoserver.command' value="java
-Djava.library.path=${build.dir}${build.dir.suffix}/nativelibs -classpath
${classpath} -server -Xmx256m -ea
org.voltdb.messaging.EchoServer" />
<exec dir='tests/scripts/' executable='python' failonerror='true'>
<arg line="Testvoltdbclient.py"/>
<arg line='"${echoserver.command}"'/>
</exec>
</target>
<target name='with.emma' description="enable code coverage analysis" >
<!-- set up emma -->
<path id="emma.lib" >
<pathelement location="${vendor.lib.dir}/emma.jar" />
<pathelement location="${vendor.lib.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<!-- enable emma -->
<property name="emma.enabled" value="true" />
<!-- instrument the code -->
<property name="emma.dir" location="${build.dir}/emma" />
<mkdir dir="${emma.dir}" />
<emma>
<!-- don't instrument build.test.dir or any non-voltdb code -->
<instr
instrpath="${build.prod.dir}/org/voltdb"
destdir="${build.instr.dir}/org/voltdb"
metadatafile="${emma.dir}/metadata.emma"
merge="true"
/>
</emma>
</target>
<!-- common junit parameters go here -->
<macrodef name='run_junit'>
<attribute name='timeout'/>
<attribute name='printsummary' default='off' />
<attribute name='showoutput' default='false' />
<element name='tests'/>
<element name='formatters'/>
<sequential>
<mkdir dir='${build.testoutput.dir}' />
<junit
fork="yes"
haltonfailure="${junit.haltonfailure}"
failureproperty="junit.failures"
printsummary="@{printsummary}"
timeout="@{timeout}"
maxmemory='1024M'
showoutput="@{showoutput}"
>
<classpath refid='project.classpath' />
<jvmarg value="-Djava.library.path=${build.dir}/nativelibs:${base.dir}/third_party/cpp/jnilib" />
<jvmarg value="-server" />
<jvmarg value="-Xcheck:jni" />
<jvmarg value="-Xmx2048m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<env key="VOLTDB_BUILD_DIR" value="${build.dir}"/>
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<env key="VOLT_REGRESSIONS" value="${regressions}" />
<!-- Following two env vars are used by Java code
when running ant check -Dbuild=memcheck
The voltdbipc client is used in concert with valgrind
for most tests (those that would normally run against
the single process JNI backend. -->
<env key="BUILD" value="${build}" />
<env key="VOLTDBIPC_PATH" value="${build.prod.dir}/voltdbipc" />
<!-- code coverage output settings, harmless if not in use -->
<jvmarg value="-Demma.coverage.out.file=${emma.dir}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<!-- junit log4j settings, generates log output of last
suite -->
<jvmarg value="-Dlog4j.configuration=file:${src.gpl.dir}/junit_log4j.properties" />
<!-- -->
<formatters/>
<batchtest todir="${build.testoutput.dir}">
<tests/>
</batchtest>
<assertions><enable/></assertions>
</junit>
</sequential>
</macrodef>
<macrodef name="junitreport-macro">
<attribute name="testoutput" />
<sequential>
<mkdir dir='@{testoutput}/report' />
<junitreport todir="@{testoutput}">
<fileset dir="@{testoutput}">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="@{testoutput}/report"/>
<report
styledir="tools"
format="noframes"
todir="@{testoutput}"
/>
</junitreport>
</sequential>
</macrodef>
<!-- A set of junit tests that only run on hudson and have an extended timeout -->
<!-- Run this before junit to pick up these tests in the reporting -->
<target name="junit-hudson">
<run_junit timeout="900000" printsummary="yes">
<formatters>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<!-- currently empty! -->
</fileset>
</tests>
</run_junit>
</target>
<target name="timeoutbakeoff" description = "Reporting for junit tests">
<run_junit timeout="600000" printsummary="no">
<formatters>
<formatter type="plain" unless="hudson"/>
<formatter
type='xml'
classname="org.voltdb.VoltJUnitFormatter"
usefile='false'
extension="none"
/>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<include name='org/voltdb/**/TestExecutionSite.class'/>
<include name='org/voltdb/**/TestRejoinEndToEnd.class'/>
<include name='org/voltdb/**/TestPartitionDetection.class'/>
<include name='org/voltdb/**/TestRestoreAgent.class'/>
</fileset>
</tests>
</run_junit>
<junitreport-macro testoutput="${build.testoutput.dir}"/>
</target>
<!-- Junit tests that run quickly -->
<target
name="junit_quick"
description="Tests and suites that run in under 3 minutes under memcheck"
>
<run_junit timeout="${timeoutLength}" printsummary="no">
<formatters>
<formatter type="plain" unless="hudson"/>
<formatter
type='xml'
classname="org.voltdb.VoltJUnitFormatter"
usefile='false'
extension="none"
/>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<include name='org/hsqldb_voltpatches/**/Test*.class'/>
<include name='org/voltdb/**/Test*.class'/>
<exclude name="**/*$*.class"/>
<exclude name="**/TestMaliciousClientSuite.class" />
<exclude name="**/TestExportSuite.class" />
<exclude name="**/TestFailuresSuite.class" />
<exclude name="**/TestFixedSQLSuite.class" />
<exclude name="**/TestPlansGroupBySuite.class" />
<exclude name="**/TestRejoin*.class" />
<exclude name="**/TestRollbackSuite.class" />
<exclude name="**/TestSaveRestoreSysprocSuite.class" />
<exclude name="**/TestSQLFeaturesSuite.class" />
<exclude name="**/TestSQLTypesSuite.class" />
<exclude name="**/TestSqlUpdateSuite.class" />
<exclude name="**/TestIndexesSuite.class" />
<exclude name="**/TestExportSuite.class" />
<exclude name="**/TestFailureDetectSuite.class" />
<exclude name="**/TestReplicationSuite.class" />
<exclude name="**/TestSqlAggregateSuite.class" />
<exclude name="**/TestOrderBySuite.class" />
<exclude name="**/TestTPCCSuite.class" />
<exclude name="**/TestCatalogUpdateSuite.class" />
<exclude name="**/TestGiantDeleteSuite.class" />
<exclude name="**/TestMultiPartitionSuite.class" />
<exclude name="**/TestReplicatedSaveRestoreSysprocSuite.class" />
<exclude name="**/TestAdminMode.class" />
<exclude name="**/TestPartitionDetection.class" />
<exclude name="**/TestSystemProcedureSuite.class" />
<exclude name="org/voltdb/quarantine/**/*.class"/>
</fileset>
</tests>
</run_junit>
<junitreport-macro testoutput="${build.testoutput.dir}"/>
<!-- Fail the build if there were any problems.
This runs all the tests before failing. -->
<fail
if="junit.failures"
unless="emma.enabled"
message="JUnit had failures"
/>
</target>
<target name="junit" description="Run testcases for Java classes.">
<!-- Run the unit tests -->
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<run_junit timeout="${timeoutLength}" printsummary="no">
<formatters>
<formatter type="plain" unless="hudson"/>
<formatter
type='xml'
classname="org.voltdb.VoltJUnitFormatter"
usefile='false'
extension="none"
/>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<include name='org/hsqldb_voltpatches/**/Test*.class'/>
<include name='org/voltdb/**/Test*.class'/>
<include name='org/voltdb/network/**/Test*.class'/>
<include name='org/voltdb/messaging/**/*Test.class'/>
<include name='org/voltdb/network/**/*Test.class'/>
<include name='org/voltdb/utils/**/*Test.class'/>
<exclude name="**/*$*.class"/>
<exclude name="**/TestMaliciousClientSuite.class" />
<exclude name="org/voltdb/quarantine/**/*.class"/>
</fileset>
</tests>
</run_junit>
<junitreport-macro testoutput="${build.testoutput.dir}"/>
<exec dir="${build.testoutput.dir}" executable='cat'>
<arg line="junit-noframes.html"/>
</exec>
<delete
dir='${build.testoutput.dir}'
includes='TEST-*.xml'
/>
<!-- Fail the build if there were any problems.
This runs all the tests before failing. -->
<fail
if="junit.failures"
unless="emma.enabled"
message="JUnit had failures"
/>
<!-- Regenerate milestoneOneCatalog/ -->
<delete dir='${build.dir}/expanded/milestoneOneCatalog' />
<mkdir dir='${build.dir}/expanded/milestoneOneCatalog' />
<unjar
src='${build.testobjects.dir}/milestoneOneCatalog.jar'
dest='${build.dir}/expanded/milestoneOneCatalog'
/>
</target>
<target name="junit_quarantine" description="Run testcases which fail unpredictably.">
<!-- Run the unit tests -->
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<run_junit timeout="${timeoutLength}" printsummary="no">
<formatters>
<formatter type="plain" unless="hudson"/>
<formatter
type='xml'
classname="org.voltdb.VoltJUnitFormatter"
usefile='false'
extension="none"
/>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<include name='org/voltdb/quarantine/**/Test*.class'/>
<exclude name="**/*$*.class"/>
</fileset>
</tests>
</run_junit>
<!-- Generate unit test reports. -->
<junitreport-macro testoutput="${build.testoutput.dir}"/>
<!-- Fail the build if there were any problems.
This runs all the tests before failing. -->
<fail
if="junit.failures"
unless="emma.enabled"
message="JUnit had failures"
/>
</target>
<target
name='emma-report'
depends='with.emma, junit'
description="Generate code coverage reports, if appropriate.">
<emma>
<report
sourcepath="${src.gpl.dir}"
sort="+name"
metrics="method:70,block:80,line:80,class:100">
<fileset dir="${emma.dir}"><include name="*.emma"/></fileset>
<xml outfile="${emma.dir}/coverage.xml" depth="method" />
<html
outfile="${emma.dir}/coverage.html"
depth="method"
columns="name,class,method,block,line"
encoding="UTF-8"
/>
</report>
</emma>
</target>
<!--
this target is intended to be called only with antcall!
set two properties beforehand or as part of the call:
lcov.dir is the directory in which to put the coverage report
lcov.target is the ant target to run under coverage
-->
<target name='with.lcov' description="Generate C++ code coverage reports.">
<property name="lcov.base.tracefile" value="lcov_base.info" />
<property name="lcov.test.tracefile" value="lcov_test.info" />
<property name="lcov.tracefile" value="lcov.info" />
<!-- Generate instrumented objects -->
<!-- Whether any work needs doing is left to the C++ makefile -->
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py ${build} coverage" />
</exec>
<mkdir dir="${lcov.dir}" />
<!-- Reset all counters -->
<exec dir="${lcov.dir}" executable='lcov' failonerror="true">
<arg line="--directory ${build.dir}-coverage/objects"/>
<arg line="--zerocounters"/>
</exec>
<!-- Get baseline coverage (zero coverage) -->
<exec dir="${lcov.dir}" executable='lcov' failonerror="true">
<arg line="--directory ${build.dir}-coverage/objects"/>
<arg line="-i --capture"/>
<arg line="--output-file ${lcov.base.tracefile}"/>
<arg line="-b ${src.ee.parent.dir}"/>
</exec>
<!-- Run the tests -->
<antcall target="lcov-unit-tests">
<param name="build.dir.suffix" value="-coverage" />
</antcall>
<antcall target="sqlcoverage">
<param name="build.dir.suffix" value="-coverage" />
</antcall>
<!-- Get test coverage -->
<exec dir="${lcov.dir}" executable='lcov' failonerror="true">
<arg line="--directory ${build.dir}-coverage/objects"/>
<arg line="--capture"/>
<arg line="--output-file ${lcov.test.tracefile}"/>
<arg line="-b ${src.ee.parent.dir}"/>
</exec>
<!-- Combine the baseline coverage and the test coverage -->
<exec dir="${lcov.dir}" executable='lcov' failonerror="true">
<arg line="-a ${lcov.base.tracefile}"/>
<arg line="-a ${lcov.test.tracefile}"/>
<arg line="-o ${lcov.tracefile}"/>
</exec>
<!-- Remove standard library and third party coverages -->
<exec dir="${lcov.dir}" executable='lcov' failonerror="true">
<arg line="-r ${lcov.tracefile}"/>
<arg line='"/usr/include/*"'/>
<arg line='"*third_party*"'/>
<arg line="-o ${lcov.tracefile}"/>
</exec>
<!-- Generate HTML report -->
<exec dir="${lcov.dir}" executable='genhtml' failonerror="true">
<arg line="${lcov.tracefile}"/>
</exec>
</target>
<target name='lcov-report' description=''>
<property name="lcov.dir" location="${build.dir}-coverage/lcov" />
<!-- <property name="lcov.target" value="sqlcoverage" /> -->
<antcall target="with.lcov" />
</target>
<target
name='lcov-unit-tests'
description="Run C++ unit tests from the coverage directory">
<exec dir='.' executable='python' failonerror='true'>
<env key='M1CATALOG_PATH' value='${m1catalog}' />
<env key="TEST_DIR" value="${build.dir}-coverage/testobjects" />
<arg line="build.py ${build} test coverage" />
</exec>
</target>
<!-- <target -->
<!-- name='lcov-unit-tests-report' -->
<!-- description="Generate C++ unit test coverage reports."> -->
<!-- <property -->
<!-- name="lcov.dir" -->
<!-- location="${build.dir}-coverage/lcov-unit-tests" -->
<!-- /> -->
<!-- <property name="lcov.target" value="lcov-unit-tests" /> -->
<!-- <antcall target="with.lcov" /> -->
<!-- </target> -->
<target
name='testability-report'
depends="voltdbthin.jar"
description="produce Google Code testability-explorer report">
<path id="testability.lib">
<pathelement
location="${vendor.lib.dir}/ant-testability-explorer.jar"
/>
<pathelement
location="${vendor.lib.dir}/testability-explorer.jar"
/>
</path>
<taskdef
name="testability"
classname="com.google.ant.TestabilityTask"
classpathref="testability.lib"
/>
<testability
resultfile="${build.dir}/testability.result.html" print="html"
errorfile="${build.dir}/testability.err.txt">
<classpath>
<fileset dir="${build.prod.dir}">
<include name="voltdbthin.jar" />
</fileset>
</classpath>
</testability>
</target>
<target name="cpd">
<taskdef
name="cpdtask"
classname="net.sourceforge.pmd.cpd.CPDTask"
classpath="${vendor.lib.dir}/pmd-4.2.5.jar"
/>
<macrodef name="cpd">
<attribute name="language"/>
<attribute name="srcdir"/>
<attribute name="format"/>
<sequential>
<echo>@{language} @{srcdir} @{format}</echo>
<cpdtask
minimumTokenCount="100"
outputFile="${build.dir}/cpd-@{language}.@{format}"
language="@{language}"
format="@{format}">
<fileset dir="@{srcdir}">
<include name="**/*.@{language}"/>
<exclude name="**/pmsg/*.@{language}"/>
</fileset>
</cpdtask>
</sequential>
</macrodef>
<cpd language="java" srcdir="${src.gpl.dir}" format="text"/>
<cpd language="java" srcdir="${src.gpl.dir}" format="xml"/>
<cpd language="cpp" srcdir="${src.ee.dir}" format="text"/>
<cpd language="cpp" srcdir="${src.ee.dir}" format="xml"/>
</target>
<!-- This target will run a junit suite. It will also run a single
suite under valgrind with -Dbuild=memcheck. NOTE: to use valgrind,
you must "cd obj/memcheck && make prod/voltdbipc" separately. -->
<target name='junitclass'
description="Run one junit suite (i.e, -Djunitclass=TestSQLFeaturesSuite)">
<condition property="timeoutLength" value="${timeoutLength}" else='900000'>
<isset property="timeoutLength"/>
</condition>
<run_junit timeout="${timeoutLength}" printsummary="yes" showoutput="yes">
<formatters>
<formatter usefile="false" type="plain"/>
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<include name="**/${junitclass}.class"/>
</fileset>
</tests>
</run_junit>
<fail if="junit.failures" message="JUnit had failures" />
</target>
<macrodef name="samplecheck">
<attribute name="app"/>
<!-- make sure example application compiles -->
<sequential>
<exec dir="${dist.examples.dir}/@{app}" executable="/usr/bin/env" failonerror='true'>
<arg value="bash" />
<arg value="run.sh" />
<arg value="srccompile" />
</exec>
</sequential>
</macrodef>
<target name="distcheck" depends='dist'
description="Verify distribution sample applications compile and run.">
<echo>checking voltcache</echo>
<samplecheck app="voltcache" />
<echo>checking voltkv</echo>
<samplecheck app="voltkv" />
<echo>checking voter</echo>
<samplecheck app="voter" />
<!-- test the generator -->
<exec dir="${dist.dir}" executable='${dist.dir}/tools/generate'>
<arg line="foo org.foo foo"/>
</exec>
<ant
dir='${dist.dir}/foo'
inheritAll='false'
inheritRefs='false'
target='main'
/>
<delete dir='${dist.dir}/foo' />
</target>
<target name='m1test_pre' depends='ee, compile'>
<mkdir dir='${build.testoutput.dir}' />
<junit fork="yes" printsummary='yes' haltonfailure="yes" showoutput='true'>
<jvmarg value="-Djava.library.path=${build.dir}/nativelibs" />
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<env key="PLANNER" value="${planner}" />
<classpath refid='project.classpath' />
<formatter type="plain" unless="hudson"/>
<formatter type="xml" if="hudson"/>
<batchtest todir="${build.testoutput.dir}">
<fileset dir='${build.test.dir}'>
<include name='org/voltdb/compiler/TestMilestoneOneCompile.class'/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
<assertions><enable/></assertions>
</junit>
<delete dir='${build.dir}/expanded/milestoneOneCatalog' />
<mkdir dir='${build.dir}/expanded/milestoneOneCatalog' />
<unjar
src='${build.testobjects.dir}/milestoneOneCatalog.jar'
dest='${build.dir}/expanded/milestoneOneCatalog'
/>
<copy
file='${build.dir}/expanded/milestoneOneCatalog/catalog.txt'
todir='${build.test.dir}/org/voltdb/catalog'
/>
<copy
file='${build.dir}/expanded/milestoneOneCatalog/catalog.txt'
todir='${build.test.dir}/org/voltdb/catalog'
/>
<copy
file='${build.dir}/expanded/milestoneOneCatalog/catalog.txt'
todir='${src.test.dir}/org/voltdb/catalog/'
/>
</target>
<target name='sqlcoverage' depends="ee,compile"
description="Run the SQL coverage tests.">
<property name="build.dir.suffix" value="" /> <!-- Default -->
<property name="test.example.dir"
location="tests/scripts/examples/sql_coverage" />
<property name="log4j.configuration" location="voltdb/log4j.properties" />
<property name="default_config" location="${test.example.dir}/config.py" />
<property name="regression_config"
location="${test.example.dir}/regression-config.py" />
<property name="sqlcov.dir" location="${build.dir}/sqlcoverage" />
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf ${sqlcov.dir}'"/>
</exec>
<mkdir dir="${sqlcov.dir}" />
<condition property="" value="${env.VOLTBUILD}" else='release'>
<isset property="env.VOLTBUILD"/>
</condition>
<condition property="seed_arg" value="-s ${sql_coverage_seed}" else="">
<isset property="sql_coverage_seed"/>
</condition>
<condition property="meta_config" value="${default_config}"
else="${regression_config}">
<isset property="sql_coverage_default"/>
</condition>
<condition property="config_arg" value="-c ${sql_coverage_config}" else="">
<isset property="sql_coverage_config"/>
</condition>
<condition property="config_verbose" value="-r" else="">
<isset property="sql_coverage_verbose"/>
</condition>
<condition property="debug_output" value="" else="quietadhoc">
<isset property="sql_coverage_verbose"/>
</condition>
<condition property="hosts" value="${sql_coverage_hosts}" else="1">
<isset property="sql_coverage_hosts"/>
</condition>
<condition property="sitesperhost" value="${sql_coverage_sites}" else="1">
<isset property="sql_coverage_sites"/>
</condition>
<condition property="replicas" value="${sql_coverage_replicas}" else="0">
<isset property="sql_coverage_replicas"/>
</condition>
<property name='classpath' refid='project.classpath' />
<property name='simpleserver.command' value='java
-Djava.library.path=${build.dir}${build.dir.suffix}/nativelibs -classpath
${classpath} -Dlog4j.configuration=file://${log4j.configuration} -server -Xmx512m -XX:+AggressiveOpts -ea
org.voltdb.sqlgenerator.SimpleServer hosts=${hosts}
sitesperhost=${sitesperhost} replicas=${replicas}
${debug_output}' />
<copy todir="${build.test.dir}/org/voltdb/sqlgenerator">
<fileset dir="${test.example.dir}">
<include name="**/*.sql"/>
</fileset>
</copy>
<copy todir="tests/scripts">
<fileset dir=".">
<include name="buildstring.txt"/>
<include name="version.txt"/>
</fileset>
</copy>
<exec dir='tests/scripts' executable='python2.6' failonerror='true'>
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<env key="VOLTDB_BUILD_DIR" value="${build.dir}"/>
<arg line='sql_coverage_test.py' />
<arg line="${seed_arg}" />
<arg line="${config_arg}" />
<arg line="${config_verbose}" />
<arg file="${meta_config}" />
<arg file="${sqlcov.dir}" />
<arg line='"${simpleserver.command}"' />
</exec>
</target>
<!--
***************************************
BENCHMARKS
***************************************
-->
<target name="benchmarkcluster"
description="Call the standard benchmark target configured to use test cluster.">
<antcall target="benchmark" inheritAll='true'>
<param name="hostcount" value="12"/>
<param name="sitesperhost" value="12"/>
<param name="clientcount" value="3"/>
<param name="processesperclient" value="1"/>
<param name="duration" value="60000" />
<param name="warehouses" value="144"/>
<param name="loadthreads" value="12" />
</antcall>
</target>
<target name="benchmarklocal"
description="Call the standard benchmark target configured to use one node of the test cluster.">
<antcall target="benchmark" inheritAll='true'>
<param name="hostcount" value="1"/>
<param name="host1" value="localhost"/>
<param name="sitesperhost" value="2"/>
<param name="clientcount" value="1"/>
<param name="clienthost1" value="localhost"/>
<param name="processesperclient" value="1"/>
<param name="warehouses" value="2"/>
<param name="local" value="true"/>
<param name="volt.server.memory" value="2048"/>
</antcall>
</target>
<target name='proccallmicrobench' depends='ee, compile'
description="Run client-server stored procedure call overhead microbenchmark. [-Dclients={# clients}]">
<java fork="true" failonerror="true"
classname="org.voltdb.ProcedureCallMicrobench" >
<arg value='${clients}' />
<jvmarg value="-Djava.library.path=${build.dir}/nativelibs" />
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<classpath refid='project.classpath' />
<assertions><disable /></assertions>
</java>
</target>
<target name='update_logging' depends='compile'
description="Invoke utility that connects to the specified VoltDB host and calls @UpdateLogging system procedure with the specified XML confiG file">
<java fork="true" failonerror="true"
classname="org.voltdb.UpdateLogging" >
<arg value='host=${host}' />
<arg value='config=${config}' />
<arg value='allHosts=${allHosts}' />
<arg value='user=${user}' />
<arg value='password=${password}' />
<classpath refid='project.classpath' />
<assertions><enable /></assertions>
</java>
</target>
<target name='tcp_throughput_sender' depends='compile'
description="Open a TCP connection and send fixed sized packets for a specified duration.">
<java fork="true" failonerror="true"
classname="org.voltdb.TCPThroughputSender" >
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<arg value='${address}' />
<arg value='${packetsize}' />
<arg value='${seconds}' />
<arg value='${numsockets}' />
<classpath refid='project.classpath' />
<assertions><enable /></assertions>
</java>
</target>
<target name='tcp_throughput_receiver' depends='compile'
description="Accept a TCP connection and log how many messages and bytes are received.">
<java fork="true" failonerror="true"
classname="org.voltdb.TCPThroughputReceiver" >
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<arg value="${respond}" />
<arg value="${responsesize}" />
<arg value="${packetsize}" />
<classpath refid='project.classpath' />
<assertions><enable /></assertions>
</java>
</target>
<!--
***************************************
JAPEX MICROBENCHMARKS
***************************************
-->
<target name='microbenchmarks' description="Run all micro-benchmarks.">
<!-- don't fail on error: jpeg generator requires sun jdk -->
<java fork="true" classname="com.sun.japex.Japex">
<jvmarg value="-server"/>
<classpath refid="project.classpath"/>
<jvmarg value="-Djapex.numberOfThreads=1"/>
<arg line="microbenchmark-config.xml"/>
</java>
</target>
<!--
***************************************
HUDSON-SPECIFIC TARGETS
***************************************
-->
<target name='copy-coverage-files'
description="Collect test results so that Hudson can display them even after an ant clean">
<copy todir=".." preservelastmodified="true">
<fileset dir="obj/release/emma" includes="coverage.html"/>
<fileset dir="obj/release/emma" includes="_files/"/>
<fileset dir="obj/release-coverage" includes="lcov-unit-tests"/>
<fileset dir="${build.dir}" includes="testability.result.html"/>
</copy>
</target>
<!--
***************************************
UTILITIES
***************************************
-->
<target name='dumper' description="Ask a running voltdb to dump state.">
<java fork="true" classname="org.voltdb.utils.DumpManager">
<jvmarg value="-server"/>
<classpath refid="project.classpath"/>
<arg value='${hostname}' />
</java>
</target>
<target name='dumpcluster' description="Ask a running voltdb on the default cluster to dump state.">
<java fork="true" classname="org.voltdb.utils.DumpManager">
<jvmarg value="-server"/>
<classpath refid="project.classpath"/>
<arg value='volt3a' />
<arg value='volt3b' />
<arg value='volt3c' />
<arg value='volt3d' />
<arg value='volt3e' />
<arg value='volt3f' />
</java>
</target>
<target name='exportsinkserver'
description="Run the Export sink test server.">
<java fork="true" failonerror="true"
classname="org.voltdb.export.ExportSinkServer">
<classpath refid='project.classpath' />
<assertions><enable/></assertions>
</java>
</target>
<!-- END PROJECT -->
</project>
Jump to Line
Something went wrong with that request. Please try again.