mirror of https://github.com/apache/cassandra
2143 lines
101 KiB
XML
2143 lines
101 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
<!--
|
|
~ 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
|
|
~
|
|
~ https://www.apache.org/licenses/LICENSE-2.0
|
|
~
|
|
~ Unless required by applicable law or agreed to in writing,
|
|
~ software distributed under the License is distributed on an
|
|
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
~ KIND, either express or implied. See the License for the
|
|
~ specific language governing permissions and limitations
|
|
~ under the License.
|
|
-->
|
|
<project basedir="." default="jar" name="apache-cassandra"
|
|
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
|
|
<property environment="env"/>
|
|
<property file="build.properties" />
|
|
<property file="build.properties.default" />
|
|
<property name="debuglevel" value="source,lines,vars"/>
|
|
|
|
<!-- default version and SCM information -->
|
|
<property name="base.version" value="2.2.17"/>
|
|
<property name="scm.connection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>
|
|
<property name="scm.developerConnection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>
|
|
<property name="scm.url" value="https://gitbox.apache.org/repos/asf?p=cassandra.git;a=tree"/>
|
|
|
|
<!-- directory details -->
|
|
<property name="basedir" value="."/>
|
|
<property name="build.src" value="${basedir}/src"/>
|
|
<property name="build.src.java" value="${basedir}/src/java"/>
|
|
<property name="build.src.jdkoverride" value="${basedir}/src/jdkoverride" />
|
|
<property name="build.src.resources" value="${basedir}/src/resources"/>
|
|
<property name="build.src.gen-java" value="${basedir}/src/gen-java"/>
|
|
<property name="build.lib" value="${basedir}/lib"/>
|
|
<property name="build.dir" value="${basedir}/build"/>
|
|
<property name="build.dir.lib" value="${basedir}/build/lib"/>
|
|
<property name="build.test.dir" value="${build.dir}/test"/>
|
|
<property name="build.classes" value="${build.dir}/classes"/>
|
|
<property name="build.classes.main" value="${build.classes}/main" />
|
|
<property name="build.classes.thrift" value="${build.classes}/thrift" />
|
|
<property name="javadoc.dir" value="${build.dir}/javadoc"/>
|
|
<property name="javadoc.jars.dir" value="${build.dir}/javadocs"/>
|
|
<property name="interface.dir" value="${basedir}/interface"/>
|
|
<property name="interface.thrift.dir" value="${interface.dir}/thrift"/>
|
|
<property name="interface.thrift.gen-java" value="${interface.thrift.dir}/gen-java"/>
|
|
<property name="test.dir" value="${basedir}/test"/>
|
|
<property name="test.resources" value="${test.dir}/resources"/>
|
|
<property name="test.lib" value="${build.dir}/test/lib"/>
|
|
<property name="test.classes" value="${build.dir}/test/classes"/>
|
|
<property name="test.conf" value="${test.dir}/conf"/>
|
|
<property name="test.data" value="${test.dir}/data"/>
|
|
<property name="test.name" value="*Test"/>
|
|
<property name="test.classlistfile" value="testlist.txt"/>
|
|
<property name="test.classlistprefix" value="unit"/>
|
|
<property name="benchmark.name" value=""/>
|
|
<property name="test.methods" value=""/>
|
|
<property name="test.runners" value="1"/>
|
|
<property name="test.unit.src" value="${test.dir}/unit"/>
|
|
<property name="test.long.src" value="${test.dir}/long"/>
|
|
<property name="test.burn.src" value="${test.dir}/burn"/>
|
|
<property name="test.microbench.src" value="${test.dir}/microbench"/>
|
|
<property name="test.pig.src" value="${test.dir}/pig"/>
|
|
<property name="test.distributed.src" value="${test.dir}/distributed"/>
|
|
<property name="test.distributed.listfile" value = "ant-jvm-dtest-list"/>
|
|
<property name="dist.dir" value="${build.dir}/dist"/>
|
|
<property name="tmp.dir" value="${java.io.tmpdir}"/>
|
|
|
|
<property name="source.version" value="1.8"/>
|
|
<property name="source.test.version" value="1.8"/>
|
|
<property name="target.version" value="1.8"/>
|
|
<property name="target.test.version" value="1.8"/>
|
|
|
|
<condition property="version" value="${base.version}">
|
|
<isset property="release"/>
|
|
</condition>
|
|
<property name="version" value="${base.version}-SNAPSHOT"/>
|
|
<property name="version.properties.dir"
|
|
value="${build.src.resources}/org/apache/cassandra/config/" />
|
|
<property name="final.name" value="${ant.project.name}-${version}"/>
|
|
|
|
<!-- details of what version of Maven ANT Tasks to fetch -->
|
|
<property name="maven-ant-tasks.version" value="2.1.3" />
|
|
<property name="maven-ant-tasks.local" value="${user.home}/.m2/repository/org/apache/maven/maven-ant-tasks"/>
|
|
<property name="maven-ant-tasks.url"
|
|
value="https://repo.maven.apache.org/maven2/org/apache/maven/maven-ant-tasks" />
|
|
<!-- details of how and which Maven repository we publish to -->
|
|
<property name="maven.version" value="3.0.3" />
|
|
<condition property="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2">
|
|
<isset property="release"/>
|
|
</condition>
|
|
<condition property="maven-repository-id" value="apache.releases.https">
|
|
<isset property="release"/>
|
|
</condition>
|
|
<property name="maven-repository-url" value="https://repository.apache.org/content/repositories/snapshots"/>
|
|
<property name="maven-repository-id" value="apache.snapshots.https"/>
|
|
|
|
<property name="test.timeout" value="240000" />
|
|
<property name="test.long.timeout" value="600000" />
|
|
<property name="test.burn.timeout" value="60000000" />
|
|
<property name="test.distributed.timeout" value="360000" />
|
|
|
|
<!-- default for cql tests. Can be override by -Dcassandra.test.use_prepared=false -->
|
|
<property name="cassandra.test.use_prepared" value="true" />
|
|
|
|
<!-- https://cobertura.sourceforge.net/ -->
|
|
<property name="cobertura.version" value="2.0.3"/>
|
|
<property name="cobertura.build.dir" value="${build.dir}/cobertura"/>
|
|
<property name="cobertura.report.dir" value="${cobertura.build.dir}/report"/>
|
|
<property name="cobertura.classes.dir" value="${cobertura.build.dir}/classes"/>
|
|
<property name="cobertura.datafile" value="${cobertura.build.dir}/cobertura.ser"/>
|
|
|
|
<!-- https://www.eclemma.org/jacoco/ -->
|
|
<property name="jacoco.export.dir" value="${build.dir}/jacoco/" />
|
|
<property name="jacoco.partials.dir" value="${jacoco.export.dir}/partials" />
|
|
<property name="jacoco.partialexecfile" value="${jacoco.partials.dir}/partial.exec" />
|
|
<property name="jacoco.finalexecfile" value="${jacoco.export.dir}/jacoco.exec" />
|
|
<property name="jacoco.version" value="0.7.5.201505241946"/>
|
|
|
|
<property name="byteman.version" value="3.0.3"/>
|
|
<property name="bytebuddy.version" value="1.10.10"/>
|
|
|
|
<property name="ecj.version" value="4.4.2"/>
|
|
|
|
<condition property="maven-ant-tasks.jar.exists">
|
|
<available file="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
|
|
</condition>
|
|
|
|
<condition property="maven-ant-tasks.jar.local">
|
|
<available file="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
|
|
</condition>
|
|
|
|
<condition property="is.source.artifact">
|
|
<available file="${build.src.java}" type="dir" />
|
|
</condition>
|
|
|
|
<tstamp>
|
|
<format property="YEAR" pattern="yyyy"/>
|
|
</tstamp>
|
|
|
|
<!--
|
|
Add all the dependencies.
|
|
-->
|
|
<path id="maven-ant-tasks.classpath" path="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" />
|
|
<path id="cassandra.classpath">
|
|
<pathelement location="${cobertura.classes.dir}"/>
|
|
<pathelement location="${build.classes.main}" />
|
|
<pathelement location="${build.classes.thrift}" />
|
|
<fileset dir="${build.lib}">
|
|
<include name="**/*.jar" />
|
|
<exclude name="**/*-sources.jar"/>
|
|
<exclude name="**/ant-*.jar"/>
|
|
</fileset>
|
|
<fileset dir="${build.dir.lib}">
|
|
<include name="**/*.jar" />
|
|
<exclude name="**/*-sources.jar"/>
|
|
<exclude name="**/ant-*.jar"/>
|
|
</fileset>
|
|
</path>
|
|
|
|
<path id="cobertura.classpath">
|
|
<pathelement location="${cobertura.classes.dir}"/>
|
|
</path>
|
|
|
|
<macrodef name="create-javadoc">
|
|
<attribute name="destdir"/>
|
|
<element name="filesets"/>
|
|
<sequential>
|
|
<javadoc destdir="@{destdir}" author="true" version="true" use="true"
|
|
windowtitle="${ant.project.name} API" classpathref="cassandra.classpath"
|
|
bottom="Copyright &copy; ${YEAR} The Apache Software Foundation"
|
|
useexternalfile="yes"
|
|
maxmemory="256m">
|
|
<filesets/>
|
|
</javadoc>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!--
|
|
Setup the output directories.
|
|
-->
|
|
<target name="init">
|
|
<fail unless="is.source.artifact"
|
|
message="Not a source artifact, stopping here." />
|
|
<mkdir dir="${build.classes.main}"/>
|
|
<mkdir dir="${build.classes.thrift}"/>
|
|
<mkdir dir="${test.lib}"/>
|
|
<mkdir dir="${test.classes}"/>
|
|
<mkdir dir="${build.src.gen-java}"/>
|
|
<mkdir dir="${build.dir.lib}"/>
|
|
<mkdir dir="${jacoco.export.dir}"/>
|
|
<mkdir dir="${jacoco.partials.dir}"/>
|
|
</target>
|
|
|
|
<target name="clean" description="Remove all locally created artifacts">
|
|
<delete dir="${build.test.dir}" />
|
|
<delete dir="${build.classes}" />
|
|
<delete dir="${cobertura.classes.dir}" />
|
|
<delete dir="${build.src.gen-java}" />
|
|
<delete dir="${version.properties.dir}" />
|
|
<delete dir="${jacoco.export.dir}" />
|
|
<delete dir="${jacoco.partials.dir}"/>
|
|
</target>
|
|
<target depends="clean" name="cleanall"/>
|
|
|
|
<target name="realclean" depends="clean" description="Remove the entire build directory and all downloaded artifacts">
|
|
<delete dir="${build.dir}" />
|
|
</target>
|
|
|
|
<!--
|
|
This generates the CQL grammar files from Cql.g
|
|
-->
|
|
<target name="check-gen-cql3-grammar">
|
|
<uptodate property="cql3current"
|
|
srcfile="${build.src.java}/org/apache/cassandra/cql3/Cql.g"
|
|
targetfile="${build.src.gen-java}/org/apache/cassandra/cql3/Cql.tokens"/>
|
|
</target>
|
|
|
|
<target name="gen-cql3-grammar" depends="check-gen-cql3-grammar" unless="cql3current">
|
|
<echo>Building Grammar ${build.src.java}/org/apache/cassandra/cql3/Cql.g ...</echo>
|
|
<java classname="org.antlr.Tool"
|
|
classpath="${build.dir.lib}/jars/antlr-3.5.2.jar;${build.lib}/antlr-runtime-3.5.2.jar;${build.lib}/ST4-4.0.8.jar"
|
|
fork="true"
|
|
failonerror="true">
|
|
<jvmarg value="-Xmx512M" />
|
|
<arg value="-Xconversiontimeout" />
|
|
<arg value="10000" />
|
|
<arg value="${build.src.java}/org/apache/cassandra/cql3/Cql.g" />
|
|
<arg value="-fo" />
|
|
<arg value="${build.src.gen-java}/org/apache/cassandra/cql3/" />
|
|
<arg value="-Xmaxinlinedfastates"/>
|
|
<arg value="10"/> <!-- default is 60 -->
|
|
</java>
|
|
</target>
|
|
|
|
<target name="generate-cql-html" depends="maven-ant-tasks-init" description="Generate HTML from textile source">
|
|
<artifact:dependencies pathId="wikitext.classpath">
|
|
<dependency groupId="com.datastax.wikitext" artifactId="wikitext-core-ant" version="1.3"/>
|
|
<dependency groupId="org.fusesource.wikitext" artifactId="textile-core" version="1.3"/>
|
|
<remoteRepository refid="central"/>
|
|
<remoteRepository refid="apache"/>
|
|
</artifact:dependencies>
|
|
<taskdef classpathref="wikitext.classpath" resource="wikitexttasks.properties" />
|
|
<wikitext-to-html markupLanguage="Textile">
|
|
<fileset dir="${basedir}">
|
|
<include name="doc/cql3/*.textile"/>
|
|
</fileset>
|
|
</wikitext-to-html>
|
|
</target>
|
|
|
|
<!--
|
|
Fetch Maven Ant Tasks and Cassandra's dependencies
|
|
These targets are intentionally free of dependencies so that they
|
|
can be run stand-alone from a binary release artifact.
|
|
-->
|
|
<target name="maven-ant-tasks-localrepo" unless="maven-ant-tasks.jar.exists" if="maven-ant-tasks.jar.local"
|
|
depends="init" description="Fetch Maven ANT Tasks from Maven Local Repository">
|
|
<copy file="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
|
|
tofile="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
|
|
<property name="maven-ant-tasks.jar.exists" value="true"/>
|
|
</target>
|
|
|
|
<target name="maven-ant-tasks-download" depends="init,maven-ant-tasks-localrepo" unless="maven-ant-tasks.jar.exists"
|
|
description="Fetch Maven ANT Tasks from Maven Central Repositroy">
|
|
<echo>Downloading Maven ANT Tasks...</echo>
|
|
<get src="${maven-ant-tasks.url}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
|
|
dest="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar" usetimestamp="true" />
|
|
<copy file="${build.dir}/maven-ant-tasks-${maven-ant-tasks.version}.jar"
|
|
tofile="${maven-ant-tasks.local}/${maven-ant-tasks.version}/maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
|
|
</target>
|
|
|
|
<target name="maven-ant-tasks-init" depends="init,maven-ant-tasks-download" unless="maven-ant-tasks.initialized"
|
|
description="Initialize Maven ANT Tasks">
|
|
<typedef uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
|
|
|
|
<!-- define the remote repositories we use -->
|
|
<artifact:remoteRepository id="central" url="${artifact.remoteRepository.central}"/>
|
|
<artifact:remoteRepository id="apache" url="${artifact.remoteRepository.apache}"/>
|
|
|
|
<macrodef name="install">
|
|
<attribute name="pomFile"/>
|
|
<attribute name="file"/>
|
|
<attribute name="classifier" default=""/>
|
|
<attribute name="packaging" default="jar"/>
|
|
<sequential>
|
|
<artifact:mvn mavenVersion="${maven.version}" fork="true" failonerror="true">
|
|
<arg value="org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file" />
|
|
<arg value="-DpomFile=@{pomFile}" />
|
|
<arg value="-Dfile=@{file}" />
|
|
<arg value="-Dclassifier=@{classifier}" />
|
|
<arg value="-Dpackaging=@{packaging}" />
|
|
</artifact:mvn>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="deploy">
|
|
<attribute name="pomFile"/>
|
|
<attribute name="file"/>
|
|
<attribute name="classifier" default=""/>
|
|
<attribute name="packaging" default="jar"/>
|
|
<sequential>
|
|
<artifact:mvn mavenVersion="${maven.version}" fork="true" failonerror="true">
|
|
<jvmarg value="-Xmx512m"/>
|
|
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file" />
|
|
<arg value="-DretryFailedDeploymentCount=5" />
|
|
<arg value="-Durl=${maven-repository-url}" />
|
|
<arg value="-DrepositoryId=${maven-repository-id}" />
|
|
<arg value="-DpomFile=@{pomFile}" />
|
|
<arg value="-Dfile=@{file}" />
|
|
<arg value="-Dclassifier=@{classifier}" />
|
|
<arg value="-Dpackaging=@{packaging}" />
|
|
</artifact:mvn>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="sign-dist">
|
|
<attribute name="file"/>
|
|
<sequential>
|
|
<echo message="gpg signing @{file}" />
|
|
<artifact:mvn mavenVersion="${maven.version}" fork="true" failonerror="true">
|
|
<jvmarg value="-Xmx512m"/>
|
|
<arg value="-q" />
|
|
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file" />
|
|
<arg value="-Dfile=@{file}" />
|
|
<arg value="-DgroupId=org.apache.cassandra" />
|
|
<arg value="-DartifactId=cassandra-parent" />
|
|
<arg value="-Dversion=${version}" />
|
|
<!-- intentionally dummy out the deploy step -->
|
|
<arg value="-Durl=file:///tmp/" />
|
|
<arg value="-DrepositoryId=tmp" />
|
|
</artifact:mvn>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<property name="maven-ant-tasks.initialized" value="true"/>
|
|
</target>
|
|
|
|
<!-- this task defines the dependencies that will be fetched by Maven ANT Tasks
|
|
the dependencies are re-used for publishing artifacts to Maven Central
|
|
in order to keep everything consistent -->
|
|
<target name="maven-declare-dependencies" depends="maven-ant-tasks-init"
|
|
description="Define dependencies and dependency versions">
|
|
<!-- The parent pom defines the versions of all dependencies -->
|
|
<artifact:pom id="parent-pom"
|
|
groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
packaging="pom"
|
|
version="${version}"
|
|
url="https://cassandra.apache.org"
|
|
name="Apache Cassandra"
|
|
inceptionYear="2009"
|
|
description="The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.">
|
|
|
|
<!-- Inherit from the ASF template pom file, ref http://maven.apache.org/pom/asf/ -->
|
|
<parent groupId="org.apache" artifactId="apache" version="22"/>
|
|
<license name="The Apache Software License, Version 2.0" url="https://www.apache.org/licenses/LICENSE-2.0.txt"/>
|
|
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
|
|
<dependencyManagement>
|
|
<dependency groupId="org.xerial.snappy" artifactId="snappy-java" version="1.1.1.7"/>
|
|
<dependency groupId="net.jpountz.lz4" artifactId="lz4" version="1.3.0"/>
|
|
<dependency groupId="com.ning" artifactId="compress-lzf" version="0.8.4"/>
|
|
<dependency groupId="com.google.guava" artifactId="guava" version="16.0"/>
|
|
<dependency groupId="commons-cli" artifactId="commons-cli" version="1.1"/>
|
|
<dependency groupId="commons-codec" artifactId="commons-codec" version="1.2"/>
|
|
<dependency groupId="org.apache.commons" artifactId="commons-lang3" version="3.1"/>
|
|
<dependency groupId="org.apache.commons" artifactId="commons-math3" version="3.2"/>
|
|
<dependency groupId="com.googlecode.concurrentlinkedhashmap" artifactId="concurrentlinkedhashmap-lru" version="1.4"/>
|
|
<dependency groupId="org.antlr" artifactId="antlr" version="3.5.2">
|
|
<exclusion groupId="org.antlr" artifactId="stringtemplate"/>
|
|
</dependency>
|
|
<dependency groupId="org.antlr" artifactId="antlr-runtime" version="3.5.2">
|
|
<exclusion groupId="org.antlr" artifactId="stringtemplate"/>
|
|
</dependency>
|
|
<dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.7.7"/>
|
|
<dependency groupId="org.slf4j" artifactId="log4j-over-slf4j" version="1.7.7"/>
|
|
<dependency groupId="org.slf4j" artifactId="jcl-over-slf4j" version="1.7.7" />
|
|
<dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.1.3"/>
|
|
<dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.1.3"/>
|
|
<dependency groupId="org.codehaus.jackson" artifactId="jackson-core-asl" version="1.9.2"/>
|
|
<dependency groupId="org.codehaus.jackson" artifactId="jackson-mapper-asl" version="1.9.2"/>
|
|
<dependency groupId="com.googlecode.json-simple" artifactId="json-simple" version="1.1"/>
|
|
<dependency groupId="com.boundary" artifactId="high-scale-lib" version="1.0.6"/>
|
|
<dependency groupId="com.github.jbellis" artifactId="jamm" version="0.3.0"/>
|
|
<dependency groupId="com.github.tjake" artifactId="crc32ex" version="0.1.1"/>
|
|
<dependency groupId="com.thinkaurelius.thrift" artifactId="thrift-server" version="0.3.7">
|
|
<exclusion groupId="org.slf4j" artifactId="slf4j-log4j12"/>
|
|
</dependency>
|
|
<dependency groupId="org.yaml" artifactId="snakeyaml" version="1.11"/>
|
|
<dependency groupId="org.apache.thrift" artifactId="libthrift" version="0.9.2">
|
|
<exclusion groupId="commons-logging" artifactId="commons-logging"/>
|
|
</dependency>
|
|
<dependency groupId="junit" artifactId="junit" version="4.6" />
|
|
<dependency groupId="org.mockito" artifactId="mockito-core" version="3.2.4" />
|
|
<dependency groupId="org.apache.cassandra" artifactId="dtest-api" version="0.0.3" />
|
|
<dependency groupId="org.apache.rat" artifactId="apache-rat" version="0.10">
|
|
<exclusion groupId="commons-lang" artifactId="commons-lang"/>
|
|
</dependency>
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core" version="1.0.3">
|
|
<exclusion groupId="org.mortbay.jetty" artifactId="servlet-api"/>
|
|
<exclusion groupId="commons-logging" artifactId="commons-logging"/>
|
|
<exclusion groupId="org.eclipse.jdt" artifactId="core"/>
|
|
<exclusion groupId="ant" artifactId="ant"/>
|
|
</dependency>
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster" version="1.0.3">
|
|
<exclusion groupId="asm" artifactId="asm"/> <!-- this is the outdated version 3.1 -->
|
|
</dependency>
|
|
<dependency groupId="org.apache.pig" artifactId="pig" version="0.12.1">
|
|
<exclusion groupId="org.mortbay.jetty" artifactId="jetty"/>
|
|
<exclusion groupId="hsqldb" artifactId="hsqldb"/> <!-- outdated version -->
|
|
<exclusion groupId="antlr" artifactId="antlr"/> <!-- outdated version -->
|
|
</dependency>
|
|
<dependency groupId="net.java.dev.jna" artifactId="jna" version="4.0.0"/>
|
|
|
|
<dependency groupId="net.sourceforge.cobertura" artifactId="cobertura" version="${cobertura.version}">
|
|
<exclusion groupId="xerces" artifactId="xercesImpl"/>
|
|
<exclusion groupId="org.mortbay.jetty" artifactId="jetty"/> <!-- older version, also via hadoop-core + pig -->
|
|
<exclusion groupId="org.mortbay.jetty" artifactId="jetty-util"/> <!-- older version, also via hadoop-core + pig -->
|
|
<exclusion groupId="org.apache.ant" artifactId="ant"/> <!-- older version 1.8.3 -->
|
|
</dependency>
|
|
<dependency groupId="org.jacoco" artifactId="org.jacoco.agent" version="${jacoco.version}"/>
|
|
<dependency groupId="org.jacoco" artifactId="org.jacoco.ant" version="${jacoco.version}"/>
|
|
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-install" version="${byteman.version}" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman" version="${byteman.version}" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-submit" version="${byteman.version}" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-bmunit" version="${byteman.version}" scope="test"/>
|
|
|
|
<dependency groupId="net.bytebuddy" artifactId="byte-buddy" version="${bytebuddy.version}" />
|
|
<dependency groupId="net.bytebuddy" artifactId="byte-buddy-agent" version="${bytebuddy.version}" />
|
|
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-core" version="1.1.1"/>
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-generator-annprocess" version="1.1.1"/>
|
|
|
|
<dependency groupId="org.apache.cassandra" artifactId="cassandra-all" version="${version}" />
|
|
<dependency groupId="org.apache.cassandra" artifactId="cassandra-thrift" version="${version}" />
|
|
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-core" version="3.1.0" />
|
|
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-jvm" version="3.1.0" />
|
|
<dependency groupId="com.addthis.metrics" artifactId="reporter-config3" version="3.0.0" />
|
|
<dependency groupId="org.mindrot" artifactId="jbcrypt" version="0.3m" />
|
|
<dependency groupId="io.airlift" artifactId="airline" version="0.6" />
|
|
<dependency groupId="io.netty" artifactId="netty-all" version="4.0.44.Final" />
|
|
<dependency groupId="com.google.code.findbugs" artifactId="jsr305" version="2.0.2" />
|
|
<dependency groupId="com.clearspring.analytics" artifactId="stream" version="2.5.2" />
|
|
<!-- TODO CASSANDRA-9543
|
|
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" version="2.1.5" classifier="shaded" />
|
|
-->
|
|
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj" version="4.4.2" />
|
|
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core" version="0.3.4" />
|
|
<dependency groupId="net.sf.supercsv" artifactId="super-csv" version="2.1.0" />
|
|
<dependency groupId="net.ju-n.compile-command-annotations" artifactId="compile-command-annotations" version="1.2.0" />
|
|
<dependency groupId="org.fusesource" artifactId="sigar" version="1.6.4">
|
|
<exclusion groupId="log4j" artifactId="log4j"/>
|
|
</dependency>
|
|
<dependency groupId="joda-time" artifactId="joda-time" version="2.4" />
|
|
|
|
</dependencyManagement>
|
|
<developer id="adelapena" name="Andres de la Peña"/>
|
|
<developer id="alakshman" name="Avinash Lakshman"/>
|
|
<developer id="aleksey" name="Aleksey Yeschenko"/>
|
|
<developer id="amorton" name="Aaron Morton"/>
|
|
<developer id="aweisberg" name="Ariel Weisberg"/>
|
|
<developer id="bdeggleston" name="Blake Eggleston"/>
|
|
<developer id="benedict" name="Benedict Elliott Smith"/>
|
|
<developer id="benjamin" name="Benjamin Lerer"/>
|
|
<developer id="blambov" name="Branimir Lambov"/>
|
|
<developer id="brandonwilliams" name="Brandon Williams"/>
|
|
<developer id="carl" name="Carl Yeksigian"/>
|
|
<developer id="dbrosius" name="David Brosiusd"/>
|
|
<developer id="dikang" name="Dikang Gu"/>
|
|
<developer id="eevans" name="Eric Evans"/>
|
|
<developer id="gdusbabek" name="Gary Dusbabek"/>
|
|
<developer id="goffinet" name="Chris Goffinet"/>
|
|
<developer id="ifesdjeen" name="Alex Petrov"/>
|
|
<developer id="jaakko" name="Laine Jaakko Olavi"/>
|
|
<developer id="jake" name="T Jake Luciani"/>
|
|
<developer id="jasonbrown" name="Jason Brown"/>
|
|
<developer id="jbellis" name="Jonathan Ellis"/>
|
|
<developer id="jfarrell" name="Jake Farrell"/>
|
|
<developer id="jjirsa" name="Jeff Jirsa"/>
|
|
<developer id="jkni" name="Joel Knighton"/>
|
|
<developer id="jmckenzie" name="Josh McKenzie"/>
|
|
<developer id="johan" name="Johan Oskarsson"/>
|
|
<developer id="junrao" name="Jun Rao"/>
|
|
<developer id="kohlisankalp" name="Sankalp Kohli"/>
|
|
<developer id="marcuse" name="Marcus Eriksson"/>
|
|
<developer id="mck" name="Michael Semb Wever"/>
|
|
<developer id="mishail" name="Mikhail Stepura"/>
|
|
<developer id="mshuler" name="Michael Shuler"/>
|
|
<developer id="paulo" name="Paulo Motta"/>
|
|
<developer id="pmalik" name="Prashant Malik"/>
|
|
<developer id="rstupp" name="Robert Stupp"/>
|
|
<developer id="scode" name="Peter Schuller"/>
|
|
<developer id="slebresne" name="Sylvain Lebresne"/>
|
|
<developer id="stefania" name="Stefania Alborghetti"/>
|
|
<developer id="tylerhobbs" name="Tyler Hobbs"/>
|
|
<developer id="vijay" name="Vijay Parthasarathy"/>
|
|
<developer id="xedin" name="Pavel Yaskevich"/>
|
|
<developer id="yukim" name="Yuki Morishita"/>
|
|
<developer id="zznate" name="Nate McCall"/>
|
|
</artifact:pom>
|
|
|
|
<!-- each dependency set then defines the subset of the dependencies for that dependency set -->
|
|
<artifact:pom id="build-deps-pom"
|
|
artifactId="cassandra-build-deps">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<dependency groupId="junit" artifactId="junit"/>
|
|
<dependency groupId="org.mockito" artifactId="mockito-core" />
|
|
<dependency groupId="org.apache.cassandra" artifactId="dtest-api" />
|
|
<dependency groupId="org.apache.rat" artifactId="apache-rat"/>
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core"/>
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster"/>
|
|
<dependency groupId="org.apache.pig" artifactId="pig"/>
|
|
<dependency groupId="com.google.code.findbugs" artifactId="jsr305"/>
|
|
<dependency groupId="org.antlr" artifactId="antlr"/>
|
|
<!-- TODO CASSANDRA-9543
|
|
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" classifier="shaded"/>
|
|
-->
|
|
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj"/>
|
|
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core"/>
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-core"/>
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-generator-annprocess"/>
|
|
<dependency groupId="net.ju-n.compile-command-annotations" artifactId="compile-command-annotations"/>
|
|
<dependency groupId="org.apache.ant" artifactId="ant-junit" version="1.9.4" />
|
|
</artifact:pom>
|
|
<!-- this build-deps-pom-sources "artifact" is the same as build-deps-pom but only with those
|
|
artifacts that have "-source.jar" files -->
|
|
<artifact:pom id="build-deps-pom-sources"
|
|
artifactId="cassandra-build-deps">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<dependency groupId="junit" artifactId="junit"/>
|
|
<dependency groupId="org.mockito" artifactId="mockito-core" />
|
|
<dependency groupId="org.apache.pig" artifactId="pig">
|
|
<exclusion groupId="xmlenc" artifactId="xmlenc"/>
|
|
<exclusion groupId="tomcat" artifactId="jasper-runtime"/>
|
|
<exclusion groupId="tomcat" artifactId="jasper-compiler"/>
|
|
<exclusion groupId="org.eclipse.jdt" artifactId="core"/>
|
|
<exclusion groupId="net.sf.kosmosfs" artifactId="kfs"/>
|
|
<exclusion groupId="hsqldb" artifactId="hsqldb"/>
|
|
<exclusion groupId="antlr" artifactId="antlr"/>
|
|
</dependency>
|
|
<!-- TODO CASSANDRA-9543
|
|
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" classifier="shaded"/>
|
|
-->
|
|
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj"/>
|
|
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core"/>
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-core"/>
|
|
<dependency groupId="org.openjdk.jmh" artifactId="jmh-generator-annprocess"/>
|
|
<dependency groupId="net.ju-n.compile-command-annotations" artifactId="compile-command-annotations"/>
|
|
<dependency groupId="org.apache.ant" artifactId="ant-junit" version="1.9.4" />
|
|
</artifact:pom>
|
|
|
|
<artifact:pom id="coverage-deps-pom"
|
|
artifactId="cassandra-coverage-deps">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<dependency groupId="net.sourceforge.cobertura" artifactId="cobertura"/>
|
|
<dependency groupId="org.jacoco" artifactId="org.jacoco.agent"/>
|
|
<dependency groupId="org.jacoco" artifactId="org.jacoco.ant"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-install" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-submit" scope="test"/>
|
|
<dependency groupId="org.jboss.byteman" artifactId="byteman-bmunit" scope="test"/>
|
|
</artifact:pom>
|
|
|
|
<artifact:pom id="test-deps-pom"
|
|
artifactId="cassandra-test-deps">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<!-- do NOT remove this, it breaks pig-test -->
|
|
<dependency groupId="joda-time" artifactId="joda-time"/>
|
|
</artifact:pom>
|
|
|
|
<!-- now the pom's for artifacts being deployed to Maven Central -->
|
|
|
|
<artifact:pom id="all-pom"
|
|
artifactId="cassandra-all"
|
|
url="https://cassandra.apache.org"
|
|
name="Apache Cassandra">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
|
|
<dependency groupId="org.xerial.snappy" artifactId="snappy-java"/>
|
|
<dependency groupId="net.jpountz.lz4" artifactId="lz4"/>
|
|
<dependency groupId="com.ning" artifactId="compress-lzf"/>
|
|
<dependency groupId="com.google.guava" artifactId="guava"/>
|
|
<dependency groupId="commons-cli" artifactId="commons-cli"/>
|
|
<dependency groupId="commons-codec" artifactId="commons-codec"/>
|
|
<dependency groupId="org.apache.commons" artifactId="commons-lang3"/>
|
|
<dependency groupId="org.apache.commons" artifactId="commons-math3"/>
|
|
<dependency groupId="com.googlecode.concurrentlinkedhashmap" artifactId="concurrentlinkedhashmap-lru"/>
|
|
<dependency groupId="org.antlr" artifactId="antlr"/>
|
|
<dependency groupId="org.antlr" artifactId="antlr-runtime"/>
|
|
<dependency groupId="org.slf4j" artifactId="slf4j-api"/>
|
|
<dependency groupId="org.slf4j" artifactId="log4j-over-slf4j"/>
|
|
<dependency groupId="org.slf4j" artifactId="jcl-over-slf4j"/>
|
|
<dependency groupId="org.codehaus.jackson" artifactId="jackson-core-asl"/>
|
|
<dependency groupId="org.codehaus.jackson" artifactId="jackson-mapper-asl"/>
|
|
<dependency groupId="com.googlecode.json-simple" artifactId="json-simple"/>
|
|
<dependency groupId="com.boundary" artifactId="high-scale-lib"/>
|
|
<dependency groupId="org.yaml" artifactId="snakeyaml"/>
|
|
<dependency groupId="org.mindrot" artifactId="jbcrypt"/>
|
|
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-core"/>
|
|
<dependency groupId="io.dropwizard.metrics" artifactId="metrics-jvm"/>
|
|
<dependency groupId="com.addthis.metrics" artifactId="reporter-config3"/>
|
|
<dependency groupId="com.thinkaurelius.thrift" artifactId="thrift-server"/>
|
|
<dependency groupId="com.clearspring.analytics" artifactId="stream"/>
|
|
<dependency groupId="net.sf.supercsv" artifactId="super-csv"/>
|
|
|
|
<dependency groupId="ch.qos.logback" artifactId="logback-core"/>
|
|
<dependency groupId="ch.qos.logback" artifactId="logback-classic"/>
|
|
|
|
<dependency groupId="org.apache.thrift" artifactId="libthrift"/>
|
|
<dependency groupId="org.apache.cassandra" artifactId="cassandra-thrift"/>
|
|
|
|
<!-- don't need hadoop classes to run, but if you use the hadoop stuff -->
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core" optional="true"/>
|
|
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster" optional="true"/>
|
|
<dependency groupId="org.apache.pig" artifactId="pig" optional="true"/>
|
|
<!-- TODO CASSANDRA-9543
|
|
<dependency groupId="com.datastax.cassandra" artifactId="cassandra-driver-core" classifier="shaded" optional="true"/>
|
|
-->
|
|
|
|
<!-- don't need jna to run, but nice to have -->
|
|
<dependency groupId="net.java.dev.jna" artifactId="jna"/>
|
|
|
|
<!-- don't need jamm unless running a server in which case it needs to be a -javagent to be used anyway -->
|
|
<dependency groupId="com.github.jbellis" artifactId="jamm"/>
|
|
<dependency groupId="com.github.tjake" artifactId="crc32ex"/>
|
|
<dependency groupId="io.netty" artifactId="netty-all"/>
|
|
|
|
<dependency groupId="joda-time" artifactId="joda-time"/>
|
|
|
|
<dependency groupId="org.fusesource" artifactId="sigar"/>
|
|
|
|
<dependency groupId="org.eclipse.jdt.core.compiler" artifactId="ecj"/>
|
|
<dependency groupId="org.caffinitas.ohc" artifactId="ohc-core"/>
|
|
</artifact:pom>
|
|
<artifact:pom id="thrift-pom"
|
|
artifactId="cassandra-thrift"
|
|
url="https://cassandra.apache.org"
|
|
name="Apache Cassandra">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
|
|
<dependency groupId="org.apache.commons" artifactId="commons-lang3"/>
|
|
<dependency groupId="org.slf4j" artifactId="slf4j-api"/>
|
|
<dependency groupId="org.slf4j" artifactId="log4j-over-slf4j"/>
|
|
<dependency groupId="org.slf4j" artifactId="jcl-over-slf4j"/>
|
|
<dependency groupId="org.apache.thrift" artifactId="libthrift"/>
|
|
</artifact:pom>
|
|
<artifact:pom id="clientutil-pom"
|
|
artifactId="cassandra-clientutil"
|
|
url="https://cassandra.apache.org"
|
|
name="Apache Cassandra">
|
|
<parent groupId="org.apache.cassandra"
|
|
artifactId="cassandra-parent"
|
|
version="${version}"/>
|
|
<scm connection="${scm.connection}" developerConnection="${scm.developerConnection}" url="${scm.url}"/>
|
|
<dependency groupId="com.google.guava" artifactId="guava"/>
|
|
</artifact:pom>
|
|
|
|
</target>
|
|
|
|
<target name="maven-ant-tasks-retrieve-build" depends="maven-declare-dependencies" unless="without.maven">
|
|
<!-- retrieve artifacts -->
|
|
<artifact:dependencies pomRefId="build-deps-pom"
|
|
filesetId="build-dependency-jars"
|
|
cacheDependencyRefs="true"
|
|
dependencyRefsBuildFile="${build.dir}/build-dependencies.xml">
|
|
<remoteRepository refid="central"/>
|
|
<remoteRepository refid="apache"/>
|
|
</artifact:dependencies>
|
|
<!-- retrieve -source.jar artifacts using the reference-pom with the artifacts that have these -->
|
|
<artifact:dependencies pomRefId="build-deps-pom-sources"
|
|
sourcesFilesetId="build-dependency-sources"
|
|
cacheDependencyRefs="true"
|
|
dependencyRefsBuildFile="${build.dir}/build-dependencies-sources.xml">
|
|
<remoteRepository refid="central"/>
|
|
<remoteRepository refid="apache"/>
|
|
</artifact:dependencies>
|
|
<copy todir="${build.dir.lib}/jars">
|
|
<fileset refid="build-dependency-jars"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
<copy todir="${build.dir.lib}/sources">
|
|
<fileset refid="build-dependency-sources"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
<!-- code coverage tools -->
|
|
<artifact:dependencies pomRefId="coverage-deps-pom"
|
|
filesetId="coverage-dependency-jars"
|
|
pathId="cobertura.classpath">
|
|
<remoteRepository refid="central"/>
|
|
</artifact:dependencies>
|
|
<copy todir="${build.dir.lib}/jars">
|
|
<fileset refid="coverage-dependency-jars"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
<!-- jacoco agent jar comes wrapped in a jar -->
|
|
<unzip src="${build.dir.lib}/jars/org.jacoco.agent-${jacoco.version}.jar" dest="${build.dir.lib}/jars">
|
|
<patternset>
|
|
<include name="*.jar"/>
|
|
</patternset>
|
|
<mapper type="flatten"/>
|
|
</unzip>
|
|
</target>
|
|
|
|
<target name="maven-ant-tasks-retrieve-test" depends="maven-ant-tasks-init">
|
|
<artifact:dependencies pomRefId="test-deps-pom"
|
|
filesetId="test-dependency-jars"
|
|
sourcesFilesetId="test-dependency-sources"
|
|
cacheDependencyRefs="true"
|
|
dependencyRefsBuildFile="${build.dir}/test-dependencies.xml">
|
|
<remoteRepository refid="apache"/>
|
|
<remoteRepository refid="central"/>
|
|
</artifact:dependencies>
|
|
<copy todir="${test.lib}/jars">
|
|
<fileset refid="test-dependency-jars"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
<copy todir="${test.lib}/sources">
|
|
<fileset refid="test-dependency-sources"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="maven-ant-tasks-retrieve-pig-test" depends="maven-ant-tasks-init">
|
|
<artifact:dependencies pomRefId="test-deps-pom"
|
|
filesetId="test-dependency-jars"
|
|
sourcesFilesetId="test-dependency-sources"
|
|
cacheDependencyRefs="true"
|
|
dependencyRefsBuildFile="${build.dir}/test-dependencies.xml">
|
|
<remoteRepository refid="apache"/>
|
|
<remoteRepository refid="central"/>
|
|
</artifact:dependencies>
|
|
<copy todir="${build.dir.lib}/jars">
|
|
<fileset refid="test-dependency-jars"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
<copy todir="${build.dir.lib}/sources">
|
|
<fileset refid="test-dependency-sources"/>
|
|
<mapper type="flatten"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<!--
|
|
Generate thrift code. We have targets to build java because
|
|
Cassandra depends on it, and python because that is what the system
|
|
tests run.
|
|
-->
|
|
<target name="check-gen-thrift-java">
|
|
<uptodate property="thriftUpToDate" srcfile="${interface.dir}/cassandra.thrift"
|
|
targetfile="${interface.thrift.gen-java}/org/apache/cassandra/thrift/Cassandra.java" />
|
|
</target>
|
|
<target name="gen-thrift-java" unless="thriftUpToDate" depends="check-gen-thrift-java"
|
|
description="Generate Thrift Java artifacts">
|
|
<echo>Generating Thrift Java code from ${basedir}/interface/cassandra.thrift...</echo>
|
|
<exec executable="thrift" dir="${basedir}/interface" failonerror="true">
|
|
<arg line="--gen java:hashcode" />
|
|
<arg line="-o ${interface.thrift.dir}" />
|
|
<arg line="cassandra.thrift" />
|
|
</exec>
|
|
<antcall target="write-java-license-headers" />
|
|
</target>
|
|
|
|
<target name="_write-java-license-headers" depends="rat-init">
|
|
<java classname="org.apache.rat.Report" fork="true"
|
|
output="${build.dir}/rat-report.log">
|
|
<classpath refid="rat.classpath" />
|
|
<arg value="-a" />
|
|
<arg value="--force" />
|
|
<arg value="interface/thrift" />
|
|
</java>
|
|
</target>
|
|
|
|
<target name="write-java-license-headers" unless="without.rat" description="Add missing java license headers">
|
|
<antcall target="_write-java-license-headers" />
|
|
</target>
|
|
|
|
<target name="gen-thrift-py" description="Generate Thrift Python artifacts">
|
|
<echo>Generating Thrift Python code from ${basedir}/interface/cassandra.thrift...</echo>
|
|
<exec executable="thrift" dir="${basedir}/interface" failonerror="true">
|
|
<arg line="--gen py" />
|
|
<arg line="-o ${interface.thrift.dir}" />
|
|
<arg line="cassandra.thrift" />
|
|
</exec>
|
|
<exec executable="thrift" dir="${basedir}/interface" failonerror="true">
|
|
<arg line="--gen py:twisted" />
|
|
<arg line="-o ${interface.thrift.dir}" />
|
|
<arg line="cassandra.thrift" />
|
|
</exec>
|
|
</target>
|
|
|
|
<!-- create properties file with C version -->
|
|
<target name="createVersionPropFile">
|
|
<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"/>
|
|
<mkdir dir="${version.properties.dir}"/>
|
|
<propertyfile file="${version.properties.dir}/version.properties">
|
|
<entry key="CassandraVersion" value="${version}"/>
|
|
</propertyfile>
|
|
</target>
|
|
|
|
<target name="test-run" depends="build"
|
|
description="Run in test mode. Not for production use!">
|
|
<java classname="org.apache.cassandra.service.CassandraDaemon" fork="true">
|
|
<classpath>
|
|
<path refid="cassandra.classpath"/>
|
|
<pathelement location="${test.conf}"/>
|
|
</classpath>
|
|
<jvmarg value="-Dstorage-config=${test.conf}"/>
|
|
<jvmarg value="-javaagent:${basedir}/lib/jamm-0.3.0.jar" />
|
|
<jvmarg value="-ea"/>
|
|
</java>
|
|
</target>
|
|
|
|
<!--
|
|
The build target builds all the .class files
|
|
-->
|
|
<target name="build"
|
|
depends="maven-ant-tasks-retrieve-build,build-project" description="Compile Cassandra classes"/>
|
|
<target name="codecoverage" depends="jacoco-run,jacoco-report" description="Create code coverage report"/>
|
|
|
|
<target depends="init,gen-cql3-grammar,generate-cql-html"
|
|
name="build-project">
|
|
<echo message="${ant.project.name}: ${ant.file}"/>
|
|
<!-- Order matters! -->
|
|
<javac fork="true"
|
|
debug="true" debuglevel="${debuglevel}"
|
|
encoding="utf-8"
|
|
destdir="${build.classes.thrift}" includeantruntime="false" source="${source.version}" target="${target.version}"
|
|
memorymaximumsize="512M">
|
|
<src path="${interface.thrift.dir}/gen-java"/>
|
|
<classpath refid="cassandra.classpath"/>
|
|
</javac>
|
|
<javac fork="true"
|
|
debug="true" debuglevel="${debuglevel}"
|
|
encoding="utf-8"
|
|
destdir="${build.classes.main}" includeantruntime="false" source="${source.version}" target="${target.version}"
|
|
memorymaximumsize="512M">
|
|
<src path="${build.src.java}"/>
|
|
<src path="${build.src.gen-java}"/>
|
|
<compilerarg value="-XDignore.symbol.file"/>
|
|
<compilerarg value="-Xbootclasspath/p:${build.src.jdkoverride}"/>
|
|
<classpath refid="cassandra.classpath"/>
|
|
</javac>
|
|
<antcall target="createVersionPropFile"/>
|
|
<copy todir="${build.classes.main}">
|
|
<fileset dir="${build.src.resources}" />
|
|
</copy>
|
|
<copy todir="${basedir}/conf" file="${build.classes.main}/META-INF/hotspot_compiler"/>
|
|
</target>
|
|
|
|
<!-- Stress build file -->
|
|
<property name="stress.build.src" value="${basedir}/tools/stress/src" />
|
|
<property name="stress.build.classes" value="${build.classes}/stress" />
|
|
<property name="stress.manifest" value="${stress.build.classes}/MANIFEST.MF" />
|
|
<path id="cassandra.classes">
|
|
<pathelement location="${basedir}/build/classes/main" />
|
|
<pathelement location="${basedir}/build/classes/thrift" />
|
|
</path>
|
|
<target name="stress-build" depends="build" description="build stress tool">
|
|
<mkdir dir="${stress.build.classes}" />
|
|
<javac debug="true" debuglevel="${debuglevel}" encoding="utf-8" destdir="${stress.build.classes}" includeantruntime="true" source="${source.version}" target="${target.version}">
|
|
<src path="${stress.build.src}" />
|
|
<classpath>
|
|
<path refid="cassandra.classes" />
|
|
<path>
|
|
<fileset dir="${build.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</path>
|
|
</classpath>
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="_write-poms" depends="maven-declare-dependencies">
|
|
<artifact:writepom pomRefId="parent-pom" file="${build.dir}/${final.name}-parent.pom"/>
|
|
<artifact:writepom pomRefId="thrift-pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}.pom"/>
|
|
<artifact:writepom pomRefId="all-pom" file="${build.dir}/${final.name}.pom"/>
|
|
<artifact:writepom pomRefId="clientutil-pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}.pom"/>
|
|
</target>
|
|
|
|
<target name="write-poms" unless="without.maven">
|
|
<antcall target="_write-poms" />
|
|
</target>
|
|
|
|
<!--
|
|
The jar target makes cassandra.jar output.
|
|
-->
|
|
<target name="jar"
|
|
depends="build, build-test, stress-build, write-poms"
|
|
description="Assemble Cassandra JAR files">
|
|
<mkdir dir="${build.classes.main}/META-INF" />
|
|
<mkdir dir="${build.classes.thrift}/META-INF" />
|
|
<copy file="LICENSE.txt"
|
|
tofile="${build.classes.main}/META-INF/LICENSE.txt"/>
|
|
<copy file="LICENSE.txt"
|
|
tofile="${build.classes.thrift}/META-INF/LICENSE.txt"/>
|
|
<copy file="NOTICE.txt"
|
|
tofile="${build.classes.main}/META-INF/NOTICE.txt"/>
|
|
<copy file="NOTICE.txt"
|
|
tofile="${build.classes.thrift}/META-INF/NOTICE.txt"/>
|
|
|
|
<!-- Thrift Jar -->
|
|
<jar jarfile="${build.dir}/${ant.project.name}-thrift-${version}.jar"
|
|
basedir="${build.classes.thrift}">
|
|
<fileset dir="${build.classes.main}">
|
|
<include name="org/apache/cassandra/thrift/ITransportFactory*.class" />
|
|
<include name="org/apache/cassandra/thrift/TFramedTransportFactory*.class" />
|
|
</fileset>
|
|
<manifest>
|
|
<attribute name="Implementation-Title" value="Cassandra"/>
|
|
<attribute name="Implementation-Version" value="${version}"/>
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
</manifest>
|
|
</jar>
|
|
|
|
<!-- Main Jar -->
|
|
<jar jarfile="${build.dir}/${final.name}.jar">
|
|
<fileset dir="${build.classes.main}">
|
|
<exclude name="org/apache/cassandra/thrift/ITransportFactory*.class" />
|
|
<exclude name="org/apache/cassandra/thrift/TFramedTransportFactory*.class" />
|
|
</fileset>
|
|
<manifest>
|
|
<!-- <section name="org/apache/cassandra/infrastructure"> -->
|
|
<attribute name="Implementation-Title" value="Cassandra"/>
|
|
<attribute name="Implementation-Version" value="${version}"/>
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
<attribute name="Premain-Class"
|
|
value="org.apache.cassandra.infrastructure.continuations.CAgent"/>
|
|
<attribute name="Class-Path"
|
|
value="${ant.project.name}-clientutil-${version}.jar ${ant.project.name}-thrift-${version}.jar" />
|
|
<!-- </section> -->
|
|
</manifest>
|
|
</jar>
|
|
|
|
<!-- Test Jar -->
|
|
<jar jarfile="${build.dir}/${ant.project.name}-test-${version}.jar">
|
|
<fileset dir="${test.classes}"/>
|
|
<manifest>
|
|
<attribute name="Implementation-Title" value="Cassandra"/>
|
|
<attribute name="Implementation-Version" value="${version}"/>
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
</manifest>
|
|
</jar>
|
|
|
|
<!-- Clientutil Jar -->
|
|
<!-- TODO: write maven pom here -->
|
|
<jar jarfile="${build.dir}/${ant.project.name}-clientutil-${version}.jar">
|
|
<fileset dir="${build.classes.main}">
|
|
<include name="org/apache/cassandra/serializers/*" />
|
|
<include name="org/apache/cassandra/utils/ByteBufferUtil*.class" />
|
|
<include name="org/apache/cassandra/utils/Hex.class" />
|
|
<include name="org/apache/cassandra/utils/UUIDGen*.class" />
|
|
<include name="org/apache/cassandra/utils/FBUtilities*.class" />
|
|
<include name="org/apache/cassandra/exceptions/*.class" />
|
|
<include name="org/apache/cassandra/utils/CloseableIterator.class" />
|
|
<include name="org/apache/cassandra/io/util/*.class" />
|
|
<include name="org/apache/cassandra/utils/SigarLibrary.class" />
|
|
</fileset>
|
|
<manifest>
|
|
<attribute name="Implementation-Title" value="Cassandra"/>
|
|
<attribute name="Implementation-Version" value="${version}"/>
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
</manifest>
|
|
</jar>
|
|
|
|
<!-- Stress jar -->
|
|
<manifest file="${stress.manifest}">
|
|
<attribute name="Built-By" value="Pavel Yaskevich"/>
|
|
<attribute name="Main-Class" value="org.apache.cassandra.stress.Stress"/>
|
|
</manifest>
|
|
<mkdir dir="${stress.build.classes}/META-INF" />
|
|
<mkdir dir="${build.dir}/tools/lib/" />
|
|
<jar destfile="${build.dir}/tools/lib/stress.jar" manifest="${stress.manifest}">
|
|
<fileset dir="${stress.build.classes}"/>
|
|
</jar>
|
|
</target>
|
|
|
|
<!--
|
|
The javadoc-jar target makes cassandra-javadoc.jar output required for publishing to Maven central repository.
|
|
-->
|
|
<target name="javadoc-jar" description="Assemble Cassandra JavaDoc JAR file">
|
|
<mkdir dir="${javadoc.jars.dir}"/>
|
|
<create-javadoc destdir="${javadoc.jars.dir}/thrift">
|
|
<filesets>
|
|
<fileset dir="${interface.thrift.dir}/gen-java" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
</filesets>
|
|
</create-javadoc>
|
|
<jar jarfile="${build.dir}/${ant.project.name}-thrift-${version}-javadoc.jar"
|
|
basedir="${javadoc.jars.dir}/thrift"/>
|
|
|
|
<create-javadoc destdir="${javadoc.jars.dir}/main">
|
|
<filesets>
|
|
<fileset dir="${build.src.java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
<fileset dir="${build.src.gen-java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
</filesets>
|
|
</create-javadoc>
|
|
<jar jarfile="${build.dir}/${final.name}-javadoc.jar"
|
|
basedir="${javadoc.jars.dir}/main"/>
|
|
|
|
<create-javadoc destdir="${javadoc.jars.dir}/clientutil">
|
|
<filesets>
|
|
<fileset dir="${build.src.java}" defaultexcludes="yes">
|
|
<include name="org/apache/cassandra/serializers/*" />
|
|
<include name="org/apache/cassandra/utils/ByteBufferUtil*.java" />
|
|
<include name="org/apache/cassandra/utils/Hex.java" />
|
|
<include name="org/apache/cassandra/utils/UUIDGen*.java" />
|
|
</fileset>
|
|
</filesets>
|
|
</create-javadoc>
|
|
<jar jarfile="${build.dir}/${ant.project.name}-clientutil-${version}-javadoc.jar"
|
|
basedir="${javadoc.jars.dir}/clientutil"/>
|
|
<!-- javadoc task always rebuilds so might as well remove the generated docs to prevent
|
|
being pulled into the distribution by accident -->
|
|
<delete quiet="true" dir="${javadoc.jars.dir}"/>
|
|
</target>
|
|
|
|
<!--
|
|
The sources-jar target makes cassandra-sources.jar output required for publishing to Maven central repository.
|
|
-->
|
|
<target name="sources-jar" depends="init" description="Assemble Cassandra Sources JAR file">
|
|
<jar jarfile="${build.dir}/${ant.project.name}-thrift-${version}-sources.jar">
|
|
<fileset dir="${interface.thrift.dir}/gen-java" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
</jar>
|
|
<jar jarfile="${build.dir}/${final.name}-sources.jar">
|
|
<fileset dir="${build.src.java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
<fileset dir="${build.src.gen-java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
</jar>
|
|
<jar jarfile="${build.dir}/${ant.project.name}-clientutil-${version}-sources.jar">
|
|
<fileset dir="${build.src.java}" defaultexcludes="yes">
|
|
<include name="org/apache/cassandra/serializers/*" />
|
|
<include name="org/apache/cassandra/utils/ByteBufferUtil*.java" />
|
|
<include name="org/apache/cassandra/utils/Hex.java" />
|
|
<include name="org/apache/cassandra/utils/UUIDGen*.java" />
|
|
</fileset>
|
|
</jar>
|
|
</target>
|
|
|
|
<!-- creates release tarballs -->
|
|
<target name="artifacts" depends="jar,javadoc"
|
|
description="Create Cassandra release artifacts">
|
|
<mkdir dir="${dist.dir}"/>
|
|
<!-- fix the control linefeed so that builds on windows works on linux -->
|
|
<fixcrlf srcdir="bin" includes="**/*" excludes="**/*.bat, **/*.ps1" eol="lf" eof="remove" />
|
|
<fixcrlf srcdir="conf" includes="**/*" excludes="**/*.bat, **/*.ps1" eol="lf" eof="remove" />
|
|
<fixcrlf srcdir="tools/bin" includes="**/*" excludes="**/*.bat, **/*.ps1" eol="lf" eof="remove" />
|
|
<copy todir="${dist.dir}/lib">
|
|
<fileset dir="${build.lib}"/>
|
|
<fileset dir="${build.dir}">
|
|
<include name="${final.name}.jar" />
|
|
<include name="${ant.project.name}-thrift-${version}.jar" />
|
|
<include name="${ant.project.name}-clientutil-${version}.jar" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/javadoc">
|
|
<fileset dir="${javadoc.dir}"/>
|
|
</copy>
|
|
<copy todir="${dist.dir}/doc">
|
|
<fileset dir="doc">
|
|
<exclude name="cql3/CQL.textile"/>
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/bin">
|
|
<fileset dir="bin"/>
|
|
</copy>
|
|
<copy todir="${dist.dir}/conf">
|
|
<fileset dir="conf"/>
|
|
</copy>
|
|
<copy todir="${dist.dir}/interface">
|
|
<fileset dir="interface">
|
|
<include name="**/*.thrift" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/pylib">
|
|
<fileset dir="pylib">
|
|
<include name="**" />
|
|
<exclude name="**/*.pyc" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/">
|
|
<fileset dir="${basedir}">
|
|
<include name="*.txt" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/tools/bin">
|
|
<fileset dir="${basedir}/tools/bin"/>
|
|
</copy>
|
|
<copy todir="${dist.dir}/tools/">
|
|
<fileset dir="${basedir}/tools/">
|
|
<include name="*.yaml"/>
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${dist.dir}/tools/lib">
|
|
<fileset dir="${build.dir}/tools/lib/">
|
|
<include name="*.jar" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<tar compression="gzip" longfile="gnu"
|
|
destfile="${build.dir}/${final.name}-bin.tar.gz">
|
|
|
|
<!-- Everything but bin/ (default mode) -->
|
|
<tarfileset dir="${dist.dir}" prefix="${final.name}">
|
|
<include name="**"/>
|
|
<exclude name="bin/*" />
|
|
<exclude name="tools/bin/*"/>
|
|
</tarfileset>
|
|
<!-- Shell includes in bin/ (default mode) -->
|
|
<tarfileset dir="${dist.dir}" prefix="${final.name}">
|
|
<include name="bin/*.in.sh" />
|
|
</tarfileset>
|
|
<!-- Executable scripts in bin/ -->
|
|
<tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755">
|
|
<include name="bin/*"/>
|
|
<include name="tools/bin/*"/>
|
|
<not>
|
|
<filename name="bin/*.in.sh" />
|
|
</not>
|
|
</tarfileset>
|
|
</tar>
|
|
|
|
<tar compression="gzip" longfile="gnu"
|
|
destfile="${build.dir}/${final.name}-src.tar.gz">
|
|
|
|
<tarfileset dir="${basedir}"
|
|
prefix="${final.name}-src">
|
|
<include name="**"/>
|
|
<exclude name="build/**" />
|
|
<exclude name="src/gen-java/**" />
|
|
<exclude name=".git/**" />
|
|
<exclude name="venv/**" />
|
|
<exclude name="src/resources/org/apache/cassandra/config/version.properties" />
|
|
<exclude name="conf/hotspot_compiler" />
|
|
<exclude name="doc/cql3/CQL.html" />
|
|
<exclude name="bin/*" /> <!-- handled separately below -->
|
|
<!-- exclude Eclipse files -->
|
|
<exclude name=".project" />
|
|
<exclude name=".classpath" />
|
|
<exclude name=".settings/**" />
|
|
<exclude name=".externalToolBuilders/**" />
|
|
</tarfileset>
|
|
|
|
<!-- Shell includes and batch files in bin/ -->
|
|
<tarfileset dir="${basedir}" prefix="${final.name}-src">
|
|
<include name="bin/*.in.sh" />
|
|
<include name="bin/*.bat" />
|
|
</tarfileset>
|
|
<!-- Everything else (assumed to be scripts), is executable -->
|
|
<tarfileset dir="${basedir}" prefix="${final.name}-src" mode="755">
|
|
<include name="bin/*"/>
|
|
<exclude name="bin/*.in.sh" />
|
|
<exclude name="bin/*.bat" />
|
|
</tarfileset>
|
|
</tar>
|
|
|
|
<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha256" algorithm="SHA-256">
|
|
<fileset dir="${build.dir}">
|
|
<include name="${final.name}-bin.tar.gz" />
|
|
<include name="${final.name}-src.tar.gz" />
|
|
</fileset>
|
|
</checksum>
|
|
<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha512" algorithm="SHA-512">
|
|
<fileset dir="${build.dir}">
|
|
<include name="${final.name}-bin.tar.gz" />
|
|
<include name="${final.name}-src.tar.gz" />
|
|
</fileset>
|
|
</checksum>
|
|
</target>
|
|
|
|
<target name="rat" depends="rat-init" description="License checks on artifacts">
|
|
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
|
|
reportFile="${build.dir}/${final.name}-bin.rat.txt">
|
|
<tarfileset>
|
|
<gzipresource>
|
|
<file file="${build.dir}/${final.name}-bin.tar.gz" />
|
|
</gzipresource>
|
|
</tarfileset>
|
|
</rat:report>
|
|
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
|
|
reportFile="${build.dir}/${final.name}-src.rat.txt">
|
|
<tarfileset>
|
|
<gzipresource>
|
|
<file file="${build.dir}/${final.name}-src.tar.gz" />
|
|
</gzipresource>
|
|
</tarfileset>
|
|
</rat:report>
|
|
</target>
|
|
|
|
<target name="build-test" depends="build" description="Compile test classes">
|
|
<javac
|
|
debug="true"
|
|
debuglevel="${debuglevel}"
|
|
encoding="utf-8"
|
|
destdir="${test.classes}"
|
|
includeantruntime="true"
|
|
source="${source.test.version}"
|
|
target="${target.test.version}">
|
|
<classpath>
|
|
<path refid="cassandra.classpath"/>
|
|
</classpath>
|
|
<compilerarg value="-XDignore.symbol.file"/>
|
|
<src path="${test.unit.src}"/>
|
|
<src path="${test.long.src}"/>
|
|
<src path="${test.burn.src}"/>
|
|
<src path="${test.pig.src}"/>
|
|
<src path="${test.microbench.src}"/>
|
|
<src path="${test.distributed.src}"/>
|
|
</javac>
|
|
|
|
<!-- Non-java resources needed by the test suite -->
|
|
<copy todir="${test.classes}">
|
|
<fileset dir="${test.resources}"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<!-- Defines how to run a set of tests. If you change the defaults for attributes
|
|
you should also update them in testmacro.,
|
|
The two are split because the helper doesn't generate
|
|
a junit report or fail on errors, since this is called in parallel to run tests
|
|
when we choose to run tests in parallel -->
|
|
<macrodef name="testmacrohelper">
|
|
<attribute name="inputdir" />
|
|
<attribute name="timeout" default="${test.timeout}" />
|
|
<attribute name="forkmode" default="perTest"/>
|
|
<element name="optjvmargs" implicit="true" optional="true" />
|
|
<attribute name="filter" default="**/${test.name}.java"/>
|
|
<attribute name="exclude" default="" />
|
|
<attribute name="filelist" default="" />
|
|
<attribute name="poffset" default="0"/>
|
|
<attribute name="testtag" default=""/>
|
|
|
|
<attribute name="usejacoco" default="no"/>
|
|
<attribute name="showoutput" default="false"/>
|
|
<sequential>
|
|
<condition property="additionalagent"
|
|
value="-javaagent:${build.dir.lib}/jars/jacocoagent.jar=destfile=${jacoco.partialexecfile}"
|
|
else="">
|
|
<istrue value="${usejacoco}"/>
|
|
</condition>
|
|
<mkdir dir="${build.test.dir}/cassandra"/>
|
|
<mkdir dir="${build.test.dir}/output"/>
|
|
<mkdir dir="${build.test.dir}/output/@{testtag}"/>
|
|
<junit fork="on" forkmode="@{forkmode}" failureproperty="testfailed" maxmemory="1024m" timeout="@{timeout}" showoutput="@{showoutput}">
|
|
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}"/>
|
|
<formatter classname="org.apache.cassandra.CassandraXMLJUnitResultFormatter" extension=".xml" usefile="true"/>
|
|
<formatter classname="org.apache.cassandra.CassandraBriefJUnitResultFormatter" usefile="false"/>
|
|
<jvmarg value="-Dstorage-config=${test.conf}"/>
|
|
<jvmarg value="-Djava.awt.headless=true"/>
|
|
<!-- Cassandra 3.0+ needs <jvmarg line="... ${additionalagent}" /> here! (not value=) -->
|
|
<jvmarg line="-javaagent:${basedir}/lib/jamm-0.3.0.jar ${additionalagent}" />
|
|
<jvmarg value="-ea"/>
|
|
<jvmarg value="-Djava.io.tmpdir=${tmp.dir}"/>
|
|
<jvmarg value="-Dcassandra.debugrefcount=true"/>
|
|
<jvmarg value="-Xss256k"/>
|
|
<!-- When we do classloader manipulation SoftReferences can cause memory leaks
|
|
that can OOM our test runs. The next two settings informs our GC
|
|
algorithm to limit the metaspace size and clean up SoftReferences
|
|
more aggressively rather than waiting. See CASSANDRA-14922 for more details.
|
|
-->
|
|
<jvmarg value="-XX:MaxMetaspaceSize=256M" />
|
|
<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
|
|
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
|
|
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
|
|
<jvmarg value="-Dcassandra.test.offsetseed=@{poffset}"/>
|
|
<jvmarg value="-Dcassandra.test.sstableformatdevelopment=true"/>
|
|
<jvmarg value="-Dcassandra.testtag=@{testtag}"/>
|
|
<!-- The first time SecureRandom initializes can be slow if it blocks on /dev/random -->
|
|
<jvmarg value="-Djava.security.egd=file:/dev/urandom" />
|
|
<optjvmargs/>
|
|
<classpath>
|
|
<path refid="cassandra.classpath" />
|
|
<pathelement location="${test.classes}"/>
|
|
<path refid="cobertura.classpath"/>
|
|
<pathelement location="${test.conf}"/>
|
|
<fileset dir="${test.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
<batchtest todir="${build.test.dir}/output/@{testtag}">
|
|
<fileset dir="@{inputdir}" includes="@{filter}" excludes="@{exclude}"/>
|
|
<filelist dir="@{inputdir}" files="@{filelist}"/>
|
|
</batchtest>
|
|
</junit>
|
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/commitlog:@{poffset}"/>
|
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/data:@{poffset}"/>
|
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/saved_caches:@{poffset}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!--
|
|
This test target is a bit different. It's purpose is to exercise the
|
|
clientutil jar in order to expose any new dependencies. For that
|
|
reason we use the classes from the jar, and a carefully constructed
|
|
classpath which only contains what we expect users to need.
|
|
-->
|
|
<target name="test-clientutil-jar" depends="build-test,jar" description="Test clientutil jar">
|
|
<mkdir dir="${build.test.dir}/output"/>
|
|
<junit fork="on" forkmode="perTest" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">
|
|
<!-- Note that the test pass without that next line, but it prints an ugly error message -->
|
|
<jvmarg value="-Djava.library.path=${build.lib}/sigar-bin"/>
|
|
<test name="org.apache.cassandra.serializers.ClientUtilsTest" todir="${build.test.dir}/output"/>
|
|
<formatter type="brief" usefile="false" />
|
|
<formatter type="xml" usefile="true"/>
|
|
<classpath>
|
|
<pathelement location="${test.classes}" />
|
|
<pathelement location="${build.dir}/${ant.project.name}-clientutil-${version}.jar" />
|
|
<pathelement location="${build.dir}/${ant.project.name}-thrift-${version}.jar" />
|
|
<pathelement location="${build.lib}/libthrift-0.9.0.jar" />
|
|
<pathelement location="${build.lib}/slf4j-api-1.7.7.jar" />
|
|
<pathelement location="${build.lib}/log4j-over-slf4j.jar" />
|
|
<pathelement location="${build.lib}/logback-core-1.1.3.jar" />
|
|
<pathelement location="${build.lib}/logback-classic-1.1.3.jar" />
|
|
<pathelement location="${build.lib}/jackson-core-asl-1.9.2.jar" />
|
|
<pathelement location="${build.lib}/jackson-mapper-asl-1.9.2.jar" />
|
|
<pathelement location="${build.lib}/sigar-1.6.4.jar" />
|
|
<fileset dir="${build.dir.lib}">
|
|
<include name="**/junit*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
</junit>
|
|
<fail message="Clientutil test(s) failed.">
|
|
<condition>
|
|
<and>
|
|
<isset property="testfailed"/>
|
|
<not>
|
|
<isset property="ant.test.failure.ignore"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</target>
|
|
|
|
<target name="testold" depends="build-test" description="Execute unit tests">
|
|
<testmacro inputdir="${test.unit.src}" exclude="**/pig/*.java" timeout="${test.timeout}">
|
|
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
|
|
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
|
|
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
|
|
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
</testmacro>
|
|
<fileset dir="${test.unit.src}">
|
|
<exclude name="**/pig/*.java" />
|
|
</fileset>
|
|
</target>
|
|
|
|
<!-- Will not generate a junit report or fail on error since it is called in parallel for test-compression
|
|
That is taken care of by testparallel -->
|
|
<macrodef name="testlist">
|
|
<attribute name="test.file.list"/>
|
|
<attribute name="testlist.offset"/>
|
|
<sequential>
|
|
<testmacrohelper inputdir="${test.dir}/${test.classlistprefix}" filelist="@{test.file.list}" poffset="@{testlist.offset}" exclude="**/*.java" timeout="${test.timeout}">
|
|
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
|
|
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
|
|
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
|
|
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
</testmacrohelper>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!-- Will not generate a junit report or fail on error since it is called in parallel for test-compression
|
|
That is taken care of by testparallel -->
|
|
<macrodef name="testlist-compression">
|
|
<attribute name="test.file.list" />
|
|
<attribute name="testlist.offset" />
|
|
<sequential>
|
|
<property name="compressed_yaml" value="${build.test.dir}/cassandra.compressed.yaml"/>
|
|
<concat destfile="${compressed_yaml}">
|
|
<fileset file="${test.conf}/cassandra.yaml"/>
|
|
<fileset file="${test.conf}/commitlog_compression.yaml"/>
|
|
</concat>
|
|
<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}" poffset="@{testlist.offset}"
|
|
exclude="**/*.java" timeout="${test.timeout}" testtag="compression">
|
|
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
|
|
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
|
|
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
|
|
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
|
<jvmarg value="-Dcassandra.test.compression=true"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
|
|
</testmacrohelper>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!--
|
|
Run named ant task with jacoco, such as "ant jacoco-run -Dtaskname=pig-test"
|
|
the target run must enable the jacoco agent if usejacoco is 'yes' -->
|
|
<target name="jacoco-run" description="run named task with jacoco instrumentation">
|
|
<condition property="runtask" value="${taskname}" else="test">
|
|
<isset property="taskname"/>
|
|
</condition>
|
|
<antcall target="${runtask}">
|
|
<param name="usejacoco" value="yes"/>
|
|
</antcall>
|
|
</target>
|
|
|
|
<!-- Use this with an FQDN for test class, and a csv list of methods like this:
|
|
ant testsome -Dtest.name=org.apache.cassandra.service.StorageServiceServerTest -Dtest.methods=testRegularMode,testGetAllRangesEmpty
|
|
-->
|
|
<target name="testsome" depends="build-test" description="Execute specific unit tests" >
|
|
<testmacro inputdir="${test.unit.src}" exclude="**/pig/*.java" timeout="${test.timeout}">
|
|
<test name="${test.name}" methods="${test.methods}" outfile="build/test/output/TEST-${test.name}-${test.methods}"/>
|
|
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
|
|
<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>
|
|
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
|
|
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="test-compression" depends="build-test" description="Execute unit tests with sstable compression enabled">
|
|
<property name="compressed_yaml" value="${build.test.dir}/cassandra.compressed.yaml"/>
|
|
<concat destfile="${compressed_yaml}">
|
|
<fileset file="${test.conf}/cassandra.yaml"/>
|
|
<fileset file="${test.conf}/commitlog_compression.yaml"/>
|
|
</concat>
|
|
<path id="all-test-classes-path">
|
|
<fileset dir="${test.unit.src}" excludes="**/pig/*.java" includes="**/${test.name}.java" />
|
|
<fileset dir="${test.distributed.src}" includes="**/${test.name}.java" />
|
|
</path>
|
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
|
<testparallel testdelegate="testlist-compression" />
|
|
</target>
|
|
|
|
<target name="msg-ser-gen-test" depends="build-test" description="Generates message serializations">
|
|
<testmacro inputdir="${test.unit.src}"
|
|
timeout="${test.timeout}" filter="**/SerializationsTest.java">
|
|
<jvmarg value="-Dcassandra.test-serialization-writes=True"/>
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="msg-ser-test" depends="build-test" description="Tests message serializations">
|
|
<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}"
|
|
filter="**/SerializationsTest.java"/>
|
|
</target>
|
|
|
|
<target name="msg-ser-test-7" depends="build-test" description="Generates message serializations">
|
|
<testmacro inputdir="${test.unit.src}"
|
|
timeout="${test.timeout}" filter="**/SerializationsTest.java">
|
|
<jvmarg value="-Dcassandra.version=0.7"/>
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="msg-ser-test-10" depends="build-test" description="Tests message serializations on 1.0 messages">
|
|
<testmacro inputdir="${test.unit.src}"
|
|
timeout="${test.timeout}" filter="**/SerializationsTest.java">
|
|
<jvmarg value="-Dcassandra.version=1.0"/>
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="test-burn" depends="build-test" description="Execute functional tests">
|
|
<testmacro inputdir="${test.burn.src}"
|
|
timeout="${test.burn.timeout}">
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="long-test" depends="build-test" description="Execute functional tests">
|
|
<testmacro inputdir="${test.long.src}"
|
|
timeout="${test.long.timeout}">
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
</testmacro>
|
|
</target>
|
|
|
|
<target name="cql-test" depends="build-test" description="Execute CQL tests">
|
|
<sequential>
|
|
<echo message="running CQL tests"/>
|
|
<mkdir dir="${build.test.dir}/cassandra"/>
|
|
<mkdir dir="${build.test.dir}/output"/>
|
|
<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">
|
|
<formatter type="brief" usefile="false"/>
|
|
<jvmarg value="-Dstorage-config=${test.conf}"/>
|
|
<jvmarg value="-Djava.awt.headless=true"/>
|
|
<jvmarg value="-javaagent:${basedir}/lib/jamm-0.3.0.jar" />
|
|
<jvmarg value="-ea"/>
|
|
<jvmarg value="-Xss256k"/>
|
|
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
|
|
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
<classpath>
|
|
<path refid="cassandra.classpath" />
|
|
<pathelement location="${test.classes}"/>
|
|
<path refid="cobertura.classpath"/>
|
|
<pathelement location="${test.conf}"/>
|
|
<fileset dir="${test.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
<batchtest todir="${build.test.dir}/output">
|
|
<fileset dir="${test.unit.src}" includes="**/cql3/*Test.java">
|
|
<contains text="CQLTester" casesensitive="yes"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
<fail message="Some CQL test(s) failed.">
|
|
<condition>
|
|
<and>
|
|
<isset property="testfailed"/>
|
|
<not>
|
|
<isset property="ant.test.failure.ignore"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="cql-test-some" depends="build-test" description="Execute specific CQL tests" >
|
|
<sequential>
|
|
<echo message="running ${test.methods} tests from ${test.name}"/>
|
|
<mkdir dir="${build.test.dir}/cassandra"/>
|
|
<mkdir dir="${build.test.dir}/output"/>
|
|
<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">
|
|
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<jvmarg value="-Dstorage-config=${test.conf}"/>
|
|
<jvmarg value="-Djava.awt.headless=true"/>
|
|
<jvmarg value="-javaagent:${basedir}/lib/jamm-0.3.0.jar" />
|
|
<jvmarg value="-ea"/>
|
|
<jvmarg value="-Xss256k"/>
|
|
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
|
|
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
<classpath>
|
|
<path refid="cassandra.classpath" />
|
|
<pathelement location="${test.classes}"/>
|
|
<path refid="cobertura.classpath"/>
|
|
<pathelement location="${test.conf}"/>
|
|
<fileset dir="${test.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
<test name="org.apache.cassandra.cql3.${test.name}" methods="${test.methods}" todir="${build.test.dir}/output"/>
|
|
</junit>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="pig-test" depends="build-test,maven-ant-tasks-retrieve-pig-test" description="Excute Pig tests">
|
|
<testmacro inputdir="${test.pig.src}"
|
|
timeout="1200000">
|
|
</testmacro>
|
|
</target>
|
|
|
|
<!-- Use JaCoCo ant extension without needing externally saved lib -->
|
|
<target name="jacoco-init" depends="maven-ant-tasks-init">
|
|
<artifact:dependencies pathId="jacocoant.classpath">
|
|
<dependency groupId="org.jacoco" artifactId="org.jacoco.ant" version="${jacoco.version}" />
|
|
</artifact:dependencies>
|
|
<typedef uri="antlib:org.jacoco.ant" classpathref="jacocoant.classpath"/>
|
|
</target>
|
|
|
|
<target name="jacoco-merge" depends="jacoco-init">
|
|
<jacoco:merge destfile="${jacoco.finalexecfile}" xmlns:jacoco="antlib:org.jacoco.ant">
|
|
<fileset dir="${jacoco.export.dir}" includes="*.exec,**/*.exec"/>
|
|
</jacoco:merge>
|
|
</target>
|
|
|
|
<target name="jacoco-report" depends="jacoco-merge">
|
|
<jacoco:report xmlns:jacoco="antlib:org.jacoco.ant">
|
|
<executiondata>
|
|
<file file="${jacoco.finalexecfile}" />
|
|
</executiondata>
|
|
<structure name="JaCoCo Cassandara Coverage Report">
|
|
<classfiles>
|
|
<fileset dir="${build.classes.main}">
|
|
<include name="**/*.class"/>
|
|
</fileset>
|
|
</classfiles>
|
|
<sourcefiles encoding="UTF-8">
|
|
<dirset dir="${build.src}">
|
|
<include name="java"/>
|
|
<include name="gen-java"/>
|
|
</dirset>
|
|
</sourcefiles>
|
|
</structure>
|
|
<!-- to produce reports in different formats. -->
|
|
<html destdir="${jacoco.export.dir}" />
|
|
<csv destfile="${jacoco.export.dir}/report.csv" />
|
|
<xml destfile="${jacoco.export.dir}/report.xml" />
|
|
</jacoco:report>
|
|
</target>
|
|
|
|
<target name="jacoco-cleanup" description="Destroy JaCoCo exec data and reports">
|
|
<delete file="${jacoco.partialexecfile}"/>
|
|
<delete dir="${jacoco.export.dir}"/>
|
|
</target>
|
|
|
|
<!-- instruments the classes to later create code coverage reports -->
|
|
<target name="cobertura-instrument" depends="build,build-test">
|
|
<taskdef resource="tasks.properties">
|
|
<classpath refid="cobertura.classpath"/>
|
|
<classpath refid="cassandra.classpath"/>
|
|
</taskdef>
|
|
|
|
<delete file="${cobertura.datafile}"/>
|
|
|
|
<cobertura-instrument todir="${cobertura.classes.dir}" datafile="${cobertura.datafile}">
|
|
<ignore regex="ch.qos.logback.*"/>
|
|
|
|
<fileset dir="${build.classes.main}">
|
|
<include name="**/*.class"/>
|
|
<exclude name="**/*Test.class"/>
|
|
<exclude name="**/*TestCase.class"/>
|
|
<exclude name="**/test/*.class"/>
|
|
<!-- cobertura modifies the serialVersionUID of classes. Some of our unit tests rely on backward
|
|
wire compatability of these classes. It was easier to exlude them from instrumentation than to
|
|
force their serialVersionUIDs. -->
|
|
<exclude name="**/*Token.class"/>
|
|
<exclude name="${cobertura.excludes}"/>
|
|
</fileset>
|
|
|
|
</cobertura-instrument>
|
|
</target>
|
|
|
|
<!-- create both html and xml code coverage reports -->
|
|
<target name="cobertura-report">
|
|
<cobertura-report format="html" destdir="${cobertura.report.dir}" srcdir="${build.src.java}"
|
|
datafile="${cobertura.datafile}"/>
|
|
<cobertura-report format="xml" destdir="${cobertura.report.dir}" srcdir="${build.src.java}"
|
|
datafile="${cobertura.datafile}"/>
|
|
</target>
|
|
|
|
<!--
|
|
License audit tool
|
|
-->
|
|
<target name="rat-init" depends="maven-ant-tasks-init">
|
|
<artifact:dependencies pathId="rat.classpath">
|
|
<dependency groupId="org.apache.rat" artifactId="apache-rat-tasks" version="0.6" />
|
|
</artifact:dependencies>
|
|
<typedef uri="antlib:org.apache.rat.anttasks" classpathref="rat.classpath"/>
|
|
</target>
|
|
|
|
<target name="rat-check" depends="rat-init">
|
|
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
|
|
reportFile="${build.dir}/rat-report.log">
|
|
<fileset dir="." excludesfile=".rat-excludes" />
|
|
</rat:report>
|
|
<condition property="rat.passed">
|
|
<isfileselected file="${build.dir}/rat-report.log">
|
|
<containsregexp expression="^0 Unknown Licenses"/>
|
|
</isfileselected>
|
|
</condition>
|
|
<fail unless="rat.passed">Unknown licenses: See build/rat-report.log.</fail>
|
|
</target>
|
|
|
|
<target name="rat-write" depends="rat-init">
|
|
<echo>RAT: invoking addLicense to write missing headers</echo>
|
|
<java classname="org.apache.rat.Report" fork="true"
|
|
output="${build.dir}/rat-report.log">
|
|
<classpath refid="rat.classpath" />
|
|
<arg value="-a" />
|
|
<arg value="--force" />
|
|
<arg value="." />
|
|
</java>
|
|
</target>
|
|
|
|
<target name="javadoc" depends="init" description="Create javadoc" unless="no-javadoc">
|
|
<create-javadoc destdir="${javadoc.dir}">
|
|
<filesets>
|
|
<fileset dir="${build.src.java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
<fileset dir="${interface.thrift.gen-java}" defaultexcludes="yes">
|
|
<include name="org/apache/**/*.java"/>
|
|
</fileset>
|
|
</filesets>
|
|
</create-javadoc>
|
|
</target>
|
|
|
|
<!-- Run tests not in parallel and reports errors and generates a junit report after -->
|
|
<macrodef name="testmacro">
|
|
<attribute name="inputdir" />
|
|
<attribute name="timeout" default="${test.timeout}" />
|
|
<attribute name="forkmode" default="perTest"/>
|
|
<attribute name="showoutput" default="true"/>
|
|
<element name="optjvmargs" implicit="true" optional="true" />
|
|
<attribute name="filter" default="**/${test.name}.java"/>
|
|
<attribute name="exclude" default="" />
|
|
<attribute name="filelist" default="" />
|
|
<attribute name="poffset" default="0"/>
|
|
<attribute name="testtag" default=""/>
|
|
|
|
<sequential>
|
|
<testmacrohelper inputdir="@{inputdir}" timeout="@{timeout}"
|
|
forkmode="@{forkmode}" filter="@{filter}"
|
|
exclude="@{exclude}" filelist="@{filelist}" poffset="@{poffset}"
|
|
testtag="@{testtag}" showoutput="false" >
|
|
<optjvmargs/>
|
|
</testmacrohelper>
|
|
<junitreport todir="${build.test.dir}">
|
|
<fileset dir="${build.test.dir}/output">
|
|
<include name="**/TEST-*.xml"/>
|
|
</fileset>
|
|
<report format="frames" todir="${build.test.dir}/junitreport"/>
|
|
</junitreport>
|
|
<fail message="Some test(s) failed.">
|
|
<condition>
|
|
<and>
|
|
<isset property="testfailed"/>
|
|
<not>
|
|
<isset property="ant.test.failure.ignore"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!-- Run tests in parallel and report errors after and generate a junit report -->
|
|
<macrodef name="testparallel">
|
|
<attribute name="testdelegate"/>
|
|
<sequential>
|
|
<testparallelhelper testdelegate="@{testdelegate}"/>
|
|
<junitreport todir="${build.test.dir}">
|
|
<fileset dir="${build.test.dir}/output">
|
|
<include name="**/TEST-*.xml"/>
|
|
</fileset>
|
|
<report format="frames" todir="${build.test.dir}/junitreport"/>
|
|
</junitreport>
|
|
<fail message="Some test(s) failed.">
|
|
<condition>
|
|
<and>
|
|
<isset property="testfailed"/>
|
|
<not>
|
|
<isset property="ant.test.failure.ignore"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!-- Run multiple junit tasks in parallel, but don't track errors or generate a report after
|
|
If a test fails the testfailed property will be set. All the tests are run using te testdelegate
|
|
macro that is specified as an attribute and they will be run concurrently in this ant process -->
|
|
<scriptdef name="testparallelhelper" language="javascript">
|
|
<attribute name="testdelegate"/>
|
|
<![CDATA[
|
|
var Integer = java.lang.Integer;
|
|
sep = project.getProperty("path.separator");
|
|
all = project.getProperty("all-test-classes").split(sep);
|
|
dir = project.getProperty("test.unit.src");
|
|
|
|
numRunners = parseInt(project.getProperty("test.runners"));
|
|
|
|
var p = project.createTask('parallel');
|
|
p.setThreadCount(numRunners);
|
|
|
|
for (i = 0; i < all.length; i++) {
|
|
|
|
if (all[i] == undefined) continue;
|
|
|
|
task = project.createTask( attributes.get("testdelegate") );
|
|
|
|
task.setDynamicAttribute( "test.file.list", "" + all[i]);
|
|
|
|
task.setDynamicAttribute( "testlist.offset", "" + i );
|
|
|
|
p.addTask(task);
|
|
}
|
|
|
|
p.perform();
|
|
]]>
|
|
</scriptdef>
|
|
|
|
<target name="test" depends="eclipse-warnings,build-test" description="Parallel Test Runner">
|
|
<path id="all-test-classes-path">
|
|
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/pig/*.java **/distributed/test/UpgradeTest*.java" />
|
|
</path>
|
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
|
<testparallel testdelegate="testlist"/>
|
|
</target>
|
|
|
|
<!-- run a list of tests as provided in -Dtest.classlistfile (or default of 'testnames.txt')
|
|
The class list file should be one test class per line, with the path starting after test/unit
|
|
e.g. org/apache/cassandra/hints/HintMessageTest.java -->
|
|
<target name="testclasslist" depends="build-test" description="Parallel-run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
|
<path id="all-test-classes-path">
|
|
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
|
</path>
|
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
|
<testparallel testdelegate="testlist"/>
|
|
</target>
|
|
<target name="testclasslist-compression" depends="build-test" description="Parallel-run compression tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
|
<path id="all-test-classes-path">
|
|
<fileset dir="${test.unit.src}" includesfile="${test.classlistfile}"/>
|
|
</path>
|
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
|
<testparallel testdelegate="testlist-compression"/>
|
|
</target>
|
|
|
|
<target name="test-distributed" depends="build-test" description="Execute unit tests">
|
|
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/test/*Test.java">
|
|
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
<jvmarg value="-XX:MaxMetaspaceSize=256M" />
|
|
<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
|
|
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
|
|
<jvmarg value="-XX:HeapDumpPath=build/test/oom.hprof" />
|
|
</testmacro>
|
|
</target>
|
|
|
|
<!-- In-JVM dtest targets -->
|
|
<target name="list-jvm-dtests" depends="build-test">
|
|
<java classname="org.apache.cassandra.distributed.test.TestLocator" fork="no">
|
|
<classpath>
|
|
<path refid="cassandra.classpath"/>
|
|
<pathelement location="${test.classes}"/>
|
|
<pathelement location="${test.conf}"/>
|
|
<fileset dir="${test.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
<arg value="${test.distributed.listfile}"/>
|
|
</java>
|
|
</target>
|
|
|
|
<target name="test-jvm-dtest-forking" depends="list-jvm-dtests" description="Execute In-JVM 'distributed' tests" >
|
|
<chmod file="${test.distributed.listfile}" perm="+x"/>
|
|
<exec executable="./${test.distributed.listfile}" failonerror="true"/>
|
|
<delete file="${test.distributed.listfile}"/>
|
|
</target>
|
|
|
|
<target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
|
|
<jar jarfile="${build.dir}/dtest-${base.version}.jar">
|
|
<zipgroupfileset dir="${build.lib}" includes="*.jar" excludes="META-INF/*.SF"/>
|
|
<fileset dir="${build.classes.main}"/>
|
|
<fileset dir="${test.classes}"/>
|
|
<fileset dir="${test.conf}" />
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="test-jvm-dtest" depends="build-test" description="Execute in-jvm dtests">
|
|
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/test/*Test.java">
|
|
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
</testmacro>
|
|
</target>
|
|
|
|
<!-- Use this with an FQDN for test class, and a csv list of methods like this:
|
|
ant test-jvm-dtest-some -Dtest.name=org.apache.cassandra.distributed.test.ResourceLeakTest -Dtest.methods=looperTest
|
|
-->
|
|
<target name="test-jvm-dtest-some" depends="build-test" description="Execute some in-jvm dtests">
|
|
<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true">
|
|
<test name="${test.name}" methods="${test.methods}" outfile="build/test/output/TEST-${test.name}-${test.methods}"/>
|
|
<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>
|
|
<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>
|
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
|
</testmacro>
|
|
</target>
|
|
|
|
<!-- run microbenchmarks suite -->
|
|
<target name="microbench" depends="build-test">
|
|
<java classname="org.openjdk.jmh.Main"
|
|
fork="true"
|
|
failonerror="true">
|
|
<classpath>
|
|
<path refid="cassandra.classpath" />
|
|
<pathelement location="${test.classes}"/>
|
|
<path refid="cobertura.classpath"/>
|
|
<pathelement location="${test.conf}"/>
|
|
<fileset dir="${test.lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</classpath>
|
|
<arg value=".*microbench.*${benchmark.name}"/>
|
|
</java>
|
|
</target>
|
|
|
|
<!-- Generate IDEA project description files -->
|
|
<target name="generate-idea-files" depends="build-test" description="Generate IDEA files">
|
|
<mkdir dir=".idea"/>
|
|
<mkdir dir=".idea/libraries"/>
|
|
<copy todir=".idea">
|
|
<fileset dir="ide/idea"/>
|
|
</copy>
|
|
<copy tofile="${eclipse.project.name}.iml" file="ide/idea-iml-file.xml"/>
|
|
<echo file=".idea/.name">Apache Cassandra ${eclipse.project.name}</echo>
|
|
<echo file=".idea/modules.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
|
<project version="4">
|
|
<component name="ProjectModuleManager">
|
|
<modules>
|
|
<module fileurl="file://$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" filepath="$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" />
|
|
</modules>
|
|
</component>
|
|
</project>]]></echo>
|
|
</target>
|
|
|
|
<!-- Generate Eclipse project description files -->
|
|
<target name="generate-eclipse-files" depends="build-test" description="Generate eclipse files">
|
|
<echo file=".project"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
|
<projectDescription>
|
|
<name>${eclipse.project.name}</name>
|
|
<comment></comment>
|
|
<projects>
|
|
</projects>
|
|
<buildSpec>
|
|
<buildCommand>
|
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
</buildCommand>
|
|
</buildSpec>
|
|
<natures>
|
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
</natures>
|
|
</projectDescription>]]>
|
|
</echo>
|
|
<echo file=".classpath"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
|
<classpath>
|
|
<classpathentry kind="src" path="src/java"/>
|
|
<classpathentry kind="src" path="src/resources"/>
|
|
<classpathentry kind="src" path="src/gen-java"/>
|
|
<classpathentry kind="src" path="interface/thrift/gen-java"/>
|
|
<classpathentry kind="src" output="build/test/classes" path="test/unit"/>
|
|
<classpathentry kind="src" output="build/test/classes" path="test/long"/>
|
|
<classpathentry kind="src" output="build/test/classes" path="test/pig"/>
|
|
<classpathentry kind="src" output="build/test/classes" path="test/distributed"/>
|
|
<classpathentry kind="src" output="build/test/classes" path="test/resources" />
|
|
<classpathentry kind="src" path="tools/stress/src"/>
|
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
|
<classpathentry kind="output" path="build/classes/main"/>
|
|
<classpathentry kind="lib" path="build/classes/thrift" sourcepath="interface/thrift/gen-java/"/>
|
|
<classpathentry kind="lib" path="test/conf"/>
|
|
]]>
|
|
</echo>
|
|
<path id="eclipse-project-libs-path">
|
|
<fileset dir="lib">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
<fileset dir="build/lib/jars">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</path>
|
|
<property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>
|
|
<script language="javascript" classpathref="cassandra.classpath"> <![CDATA[
|
|
var File = java.io.File;
|
|
var FilenameUtils = Packages.org.apache.commons.io.FilenameUtils;
|
|
jars = project.getProperty("eclipse-project-libs").split(project.getProperty("path.separator"));
|
|
|
|
cp = "";
|
|
for (i=0; i< jars.length; i++) {
|
|
srcjar = FilenameUtils.getBaseName(jars[i]) + '-sources.jar';
|
|
srcdir = FilenameUtils.concat(project.getProperty("build.dir.lib"), 'sources');
|
|
srcfile = new File(FilenameUtils.concat(srcdir, srcjar));
|
|
|
|
cp += ' <classpathentry kind="lib" path="' + jars[i] + '"';
|
|
if (srcfile.exists()) {
|
|
cp += ' sourcepath="' + srcfile.getAbsolutePath() + '"';
|
|
}
|
|
cp += '/>\n';
|
|
}
|
|
|
|
cp += '</classpath>';
|
|
|
|
echo = project.createTask("echo");
|
|
echo.setMessage(cp);
|
|
echo.setFile(new File(".classpath"));
|
|
echo.setAppend(true);
|
|
echo.perform();
|
|
]]> </script>
|
|
<mkdir dir=".settings" />
|
|
</target>
|
|
|
|
<pathconvert property="eclipse.project.name">
|
|
<path path="${basedir}" />
|
|
<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes" />
|
|
</pathconvert>
|
|
|
|
<!-- Clean Eclipse project description files -->
|
|
<target name="clean-eclipse-files">
|
|
<delete file=".project" />
|
|
<delete file=".classpath" />
|
|
<delete dir=".settings" />
|
|
<delete dir=".externalToolBuilders" />
|
|
<delete dir="build/eclipse-classes" />
|
|
</target>
|
|
|
|
|
|
<target name="eclipse-warnings" depends="build" description="Run eclipse compiler code analysis">
|
|
<property name="ecj.log.dir" value="${build.dir}/ecj" />
|
|
<property name="ecj.warnings.file" value="${ecj.log.dir}/eclipse_compiler_checks.txt"/>
|
|
<delete dir="${ecj.log.dir}" />
|
|
<mkdir dir="${ecj.log.dir}" />
|
|
|
|
<property name="ecj.properties" value="${basedir}/eclipse_compiler.properties" />
|
|
|
|
<echo message="Running Eclipse Code Analysis. Output logged to ${ecj.warnings.file}" />
|
|
|
|
<java
|
|
jar="${build.dir.lib}/jars/ecj-${ecj.version}.jar"
|
|
fork="true"
|
|
failonerror="true"
|
|
maxmemory="512m">
|
|
<arg value="-source"/>
|
|
<arg value="${source.version}" />
|
|
<arg value="-target"/>
|
|
<arg value="${target.version}" />
|
|
<arg value="-d" />
|
|
<arg value="none" />
|
|
<arg value="-proc:none" />
|
|
<arg value="-log" />
|
|
<arg value="${ecj.warnings.file}" />
|
|
<arg value="-properties" />
|
|
<arg value="${ecj.properties}" />
|
|
<arg value="-cp" />
|
|
<arg value="${toString:cassandra.classpath}" />
|
|
<arg value="${build.src.java}" />
|
|
</java>
|
|
</target>
|
|
|
|
|
|
<!-- Installs artifacts to local Maven repository -->
|
|
<target name="mvn-install"
|
|
depends="maven-declare-dependencies,jar,sources-jar,javadoc-jar"
|
|
description="Installs the artifacts in the Maven Local Repository">
|
|
|
|
<!-- the parent -->
|
|
<install pomFile="${build.dir}/${final.name}-parent.pom"
|
|
file="${build.dir}/${final.name}-parent.pom"
|
|
packaging="pom"/>
|
|
|
|
<!-- the cassandra-thrift jar -->
|
|
<install pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}.jar"/>
|
|
<install pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}-sources.jar"
|
|
classifier="sources"/>
|
|
<install pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
|
|
<!-- the cassandra-clientutil jar -->
|
|
<install pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}.jar"/>
|
|
<install pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}-sources.jar"
|
|
classifier="sources"/>
|
|
<install pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
|
|
<!-- the cassandra-all jar -->
|
|
<install pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}.jar"/>
|
|
<install pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}-sources.jar"
|
|
classifier="sources"/>
|
|
<install pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
</target>
|
|
|
|
<!-- Publish artifacts to remote Maven repository -->
|
|
<target name="publish"
|
|
depends="mvn-install,artifacts"
|
|
if="release"
|
|
description="Publishes the artifacts to the Maven repository">
|
|
|
|
<!-- the parent -->
|
|
<deploy pomFile="${build.dir}/${final.name}-parent.pom"
|
|
file="${build.dir}/${final.name}-parent.pom"
|
|
packaging="pom"/>
|
|
|
|
<!-- the cassandra-thrift jar -->
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}.jar"/>
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}-sources.jar"
|
|
classifier="sources"/>
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-thrift-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-thrift-${version}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
|
|
<!-- the cassandra-clientutil jar -->
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}.jar"/>
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}-sources.jar"
|
|
classifier="sources"/>
|
|
<deploy pomFile="${build.dir}/${ant.project.name}-clientutil-${version}.pom"
|
|
file="${build.dir}/${ant.project.name}-clientutil-${version}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
|
|
<!-- the cassandra-all jar -->
|
|
<deploy pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}.jar"/>
|
|
<deploy pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}-sources.jar"
|
|
classifier="sources"/>
|
|
<deploy pomFile="${build.dir}/${final.name}.pom"
|
|
file="${build.dir}/${final.name}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
|
|
<!-- the distribution -->
|
|
<sign-dist file="${build.dir}/${final.name}-bin.tar.gz" />
|
|
<sign-dist file="${build.dir}/${final.name}-src.tar.gz" />
|
|
|
|
</target>
|
|
</project>
|