Path: blob/main/databases/cassandra5/files/maven/build.xml
46591 views
<!--1Licensed to the Apache Software Foundation (ASF) under one or more2contributor license agreements. See the NOTICE file distributed with3this work for additional information regarding copyright ownership.4The ASF licenses this file to You under the Apache License, Version 2.05(the "License"); you may not use this file except in compliance with6the License. You may obtain a copy of the License at78http://www.apache.org/licenses/LICENSE-2.0910Unless required by applicable law or agreed to in writing, software11distributed under the License is distributed on an "AS IS" BASIS,12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13See the License for the specific language governing permissions and14limitations under the License.15-->16<project basedir="." default="check" name="apache-cassandra"17xmlns:if="ant:if"18xmlns:unless="ant:unless">1920<fail message="You need to use Ant of version at least 1.10 to continue.">21<condition>22<not>23<antversion atleast="1.10"/>24</not>25</condition>26</fail>2728<property environment="env"/>29<property file="build.properties" />30<property file="build.properties.default" />31<property file="${user.home}/.ant/build.properties"/>32<property name="debuglevel" value="source,lines,vars"/>3334<!-- default version and SCM information -->35<property name="base.version" value="5.0.8"/>36<property name="scm.connection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>37<property name="scm.developerConnection" value="scm:https://gitbox.apache.org/repos/asf/cassandra.git"/>38<property name="scm.url" value="https://gitbox.apache.org/repos/asf?p=cassandra.git"/>3940<!-- JDKs supported.41All releases are built with the default JDK.42Builds with non-default JDKs are considered experimental and for development and testing purposes.43When building, javac's source and target flags are set to the jdk used, so lower JDKs are not supported at runtime.44The use of both CASSANDRA_USE_JDK11 and use-jdk11 is deprecated.45-->46<property name="java.default" value="11" />47<property name="java.supported" value="11,17" />4849<!-- directory details -->50<property name="basedir" value="."/>51<property name="build.helpers.dir" value="${basedir}/.build"/>52<property name="build.src" value="${basedir}/src"/>53<property name="build.src.java" value="${basedir}/src/java"/>54<property name="build.src.antlr" value="${basedir}/src/antlr"/>55<property name="build.src.resources" value="${basedir}/src/resources"/>56<property name="build.src.gen-java" value="${basedir}/src/gen-java"/>57<property name="build.lib" value="${basedir}/lib"/>58<property name="build.dir" value="${basedir}/build"/>59<property name="build.dir.lib" value="${build.dir}/lib"/>60<property name="build.test.dir" value="${build.dir}/test"/>61<property name="build.test.output.dir" value="${build.test.dir}/output"/>62<property name="build.test.report.dir" value="${build.test.dir}/reports" />63<property name="build.classes" value="${build.dir}/classes"/>64<property name="build.classes.main" value="${build.classes}/main" />65<property name="javadoc.dir" value="${build.dir}/javadoc"/>66<property name="interface.dir" value="${basedir}/interface"/>67<property name="test.dir" value="${basedir}/test"/>68<property name="test.resources" value="${test.dir}/resources"/>69<property name="test.lib" value="${build.dir}/test/lib"/>70<property name="test.classes" value="${build.dir}/test/classes"/>71<property name="test.conf" value="${test.dir}/conf"/>72<property name="test.data" value="${test.dir}/data"/>73<property name="test.name" value="*Test"/>74<property name="test.classlistfile" value="testlist.txt"/>75<property name="test.classlistprefix" value="unit"/>76<property name="benchmark.name" value=""/>77<property name="jmh.args" value=""/>78<property name="test.methods" value=""/>79<property name="test.anttasks.src" value="${test.dir}/anttasks"/>80<property name="test.unit.src" value="${test.dir}/unit"/>81<property name="test.long.src" value="${test.dir}/long"/>82<property name="test.burn.src" value="${test.dir}/burn"/>83<property name="test.memory.src" value="${test.dir}/memory"/>84<property name="test.microbench.src" value="${test.dir}/microbench"/>85<property name="test.distributed.src" value="${test.dir}/distributed"/>86<property name="test.compression.algo" value="LZ4"/>87<property name="test.simulator.src" value="${test.dir}/simulator/main"/>88<property name="test.simulator-asm.src" value="${test.dir}/simulator/asm"/>89<property name="test.simulator-bootstrap.src" value="${test.dir}/simulator/bootstrap"/>90<property name="test.simulator-test.src" value="${test.dir}/simulator/test"/>91<property name="test.driver.connection_timeout_ms" value="10000"/>92<property name="test.driver.read_timeout_ms" value="24000"/>93<property name="test.jvm.args" value="" />94<property name="testtag.extra" value="" />95<property name="dist.dir" value="${build.dir}/dist"/>9697<!-- Use build/tmp for temp files if not otherwise specified. Because Ant properties are immutable, this has no effect if98the user specifies the tmp.dir property -->99<property name="tmp.dir" value="${build.dir}/tmp"/>100101<property name="doc.dir" value="${basedir}/doc"/>102103<condition property="version" value="${base.version}">104<isset property="release"/>105</condition>106<property name="version" value="${base.version}-SNAPSHOT"/>107<property name="version.properties.dir"108value="${build.src.resources}/org/apache/cassandra/config/" />109<property name="final.name" value="${ant.project.name}-${version}"/>110111<property name="local.repository" value="${user.home}/.m2/repository" />112113<!-- details of how and which Maven repository we publish to -->114<property name="maven.version" value="3.0.3" />115<condition property="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2">116<isset property="release"/>117</condition>118<condition property="maven-repository-id" value="apache.releases.https">119<isset property="release"/>120</condition>121<property name="maven-repository-url" value="https://repository.apache.org/content/repositories/snapshots"/>122<property name="maven-repository-id" value="apache.snapshots.https"/>123124<property name="test.timeout" value="480000" />125<property name="test.memory.timeout" value="480000" />126<property name="test.long.timeout" value="600000" />127<property name="test.burn.timeout" value="60000000" />128<property name="test.distributed.timeout" value="900000" />129<property name="test.simulation.timeout" value="1800000" />130131<!-- default for cql tests. Can be overridden by -Dcassandra.test.use_prepared=false -->132<property name="cassandra.test.use_prepared" value="true" />133134<!-- The number of active processors seen by JVM -->135<property name="cassandra.test.processorCount" value="2"/>136137<!-- skip flushing schema tables during tests -->138<property name="cassandra.test.flush_local_schema_changes" value="false" />139140<!-- fast shutdown of messaging service -->141<property name="cassandra.test.messagingService.nonGracefulShutdown" value="true"/>142143<!-- https://www.eclemma.org/jacoco/ -->144<property name="jacoco.version" value="0.8.8"/>145<property name="jacoco.export.dir" value="${build.dir}/jacoco/" />146<property name="jacoco.partials.dir" value="${jacoco.export.dir}/partials" />147<property name="jacoco.partialexecfile" value="${jacoco.partials.dir}/partial.exec" />148<property name="jacoco.finalexecfile" value="${jacoco.export.dir}/jacoco.exec" />149150<condition property="isMac" value="true">151<os family="mac"/>152</condition>153<condition property="isLinux" value="true">154<and>155<os family="unix"/>156<not>157<os family="mac"/>158</not>159</and>160</condition>161162<property name="jflex.version" value="1.8.2"/>163<property name="jamm.version" value="0.4.0"/>164<property name="ecj.version" value="3.33.0"/>165<!-- When updating ASM, please, do consider whether you might need to update also FBUtilities#ASM_BYTECODE_VERSION166and the simulator InterceptClasses#BYTECODE_VERSION, in particular if we are looking to provide Cassandra support167for newer JDKs (CASSANDRA-17873). -->168<property name="asm.version" value="9.4"/>169<property name="allocation-instrumenter.version" value="3.1.0"/>170171<condition property="is.source.artifact">172<available file="${build.src.java}" type="dir" />173</condition>174175<condition property="cassandra.use_nix_recursive_delete" value="false" else="true">176<os family="windows" />177</condition>178179<condition property="withoutMethods">180<and>181<equals arg1="${test.methods}" arg2=""/>182<not>183<contains string="${test.name}" substring="*"/>184</not>185</and>186</condition>187<condition property="withMethods">188<and>189<not>190<equals arg1="${test.methods}" arg2=""/>191</not>192<not>193<contains string="${test.name}" substring="*"/>194</not>195</and>196</condition>197198<!-- Check if all tests are being run or just one (check testclasslist target). If it's all tests don't spam the199console with test output.200If it's an individual test print the output from the test under the assumption someone is debugging the test201and wants to know what is going on without having to context switch to the log file that is generated.202Debug level output still needs to be retrieved from the log file. -->203<macrodef name="set-keepbrief-property">204<attribute name="test-name" />205<sequential>206<condition property="cassandra.keepBriefBrief" value="false" else="true">207<not>208<equals arg1="@{test-name}" arg2="*Test"/>209</not>210</condition>211</sequential>212</macrodef>213<set-keepbrief-property test-name="${test.name}" />214215<fail message="Unsupported JDK version used: ${ant.java.version}">216<condition><not><contains string="${java.supported}" substring="${ant.java.version}"/></not></condition>217</fail>218<condition property="is.java.default"><equals arg1="${ant.java.version}" arg2="${java.default}"/></condition>219<echo unless:true="${is.java.default}" message="Non default JDK version used: ${ant.java.version}"/>220221<condition property="arch_x86">222<equals arg1="${os.arch}" arg2="x86" />223</condition>224<!-- On non-X86 JDK 8 (such as M1 Mac) the smallest allowed Xss is 384k; so need a larger value225when on these platforms. -->226<condition property="jvm_xss" value="-Xss256k" else="-Xss384k">227<isset property="arch_x86" />228</condition>229230<resources id="_jvm11_arg_items">231<string>-Djdk.attach.allowAttachSelf=true</string>232<string>-XX:+UseConcMarkSweepGC</string>233<string>-XX:+CMSParallelRemarkEnabled</string>234<string>-XX:SurvivorRatio=8</string>235<string>-XX:MaxTenuringThreshold=1</string>236<string>-XX:CMSInitiatingOccupancyFraction=75</string>237<string>-XX:+UseCMSInitiatingOccupancyOnly</string>238<string>-XX:CMSWaitDuration=10000</string>239<string>-XX:+CMSParallelInitialMarkEnabled</string>240<string>-XX:+CMSEdenChunksRecordAlways</string>241242243<string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string>244<string>--add-exports java.base/jdk.internal.ref=ALL-UNNAMED</string>245<string>--add-exports java.base/sun.nio.ch=ALL-UNNAMED</string>246<string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string>247<string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string>248<string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string>249<string>--add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED</string>250<string>--add-exports java.sql/java.sql=ALL-UNNAMED</string>251252<string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string>253<string>--add-opens java.base/java.net=ALL-UNNAMED</string>254<string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string>255<string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string>256<string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string>257<string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string>258<string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string>259<string>--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED</string>260<string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string>261</resources>262<pathconvert property="_jvm11_args_concat" refid="_jvm11_arg_items" pathsep=" "/>263<condition property="java-jvmargs" value="${_jvm11_args_concat}">264<equals arg1="${ant.java.version}" arg2="11"/>265</condition>266267<resources id="_jvm17_arg_items">268<string>-Djdk.attach.allowAttachSelf=true</string>269<string>-XX:+UseG1GC</string>270<string>-XX:+ParallelRefProcEnabled</string>271<string>-XX:MaxTenuringThreshold=1</string>272<string>-XX:G1HeapRegionSize=16m</string>273274<string>--add-exports java.base/jdk.internal.misc=ALL-UNNAMED</string>275<string>--add-exports java.management.rmi/com.sun.jmx.remote.internal.rmi=ALL-UNNAMED</string>276<string>--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED</string>277<string>--add-exports java.rmi/sun.rmi.server=ALL-UNNAMED</string>278<string>--add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED</string>279<string>--add-exports java.sql/java.sql=ALL-UNNAMED</string>280<string>--add-exports java.base/java.lang.ref=ALL-UNNAMED</string>281<string>--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED</string>282<string>--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</string>283<string>--add-exports jdk.attach/sun.tools.attach=ALL-UNNAMED</string>284285<string>--add-opens java.base/java.lang.module=ALL-UNNAMED</string>286<string>--add-opens java.base/jdk.internal.loader=ALL-UNNAMED</string>287<string>--add-opens java.base/jdk.internal.ref=ALL-UNNAMED</string>288<string>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</string>289<string>--add-opens java.base/jdk.internal.math=ALL-UNNAMED</string>290<string>--add-opens java.base/jdk.internal.module=ALL-UNNAMED</string>291<string>--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED</string>292<string>--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED</string>293<string>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</string>294<string>--add-opens java.base/java.io=ALL-UNNAMED</string>295<string>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</string>296<string>--add-opens jdk.compiler/com.sun.tools.javac=ALL-UNNAMED</string>297<string>--add-opens java.base/java.lang=ALL-UNNAMED</string>298<string>--add-opens java.base/java.util=ALL-UNNAMED</string>299<string>--add-opens java.base/java.nio=ALL-UNNAMED</string>300301<string>--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED</string>302</resources>303<pathconvert property="_jvm17_args_concat" refid="_jvm17_arg_items" pathsep=" "/>304<condition property="java-jvmargs" value="${_jvm17_args_concat}">305<equals arg1="${ant.java.version}" arg2="17"/>306</condition>307308<!--309JVM arguments for tests.310311There is a race condition bug in java 11 (see CASSANDRA-15981) which causes a crash of the312JVM; this race is between CMS and class unloading. In java 8 we can cap the metaspace to313make tests stable on low resource environments, but in java 11 we need to make it unlimited314(don't define MaxMetaspaceSize) and disable class unloading in CMS outside of a315stop-the-world pause.316317In java 11 we also need to set a system property to enable netty to use Unsafe direct byte318buffer construction (see CASSANDRA-16493)319-->320<resources id="_jvm11_test_arg_items">321<string>-XX:-CMSClassUnloadingEnabled</string>322<string>-Dio.netty.tryReflectionSetAccessible=true</string>323</resources>324<pathconvert property="_jvm11_test_arg_items_concat" refid="_jvm11_test_arg_items" pathsep=" "/>325<resources id="_jvm17_test_arg_items">326<string>-Dio.netty.tryReflectionSetAccessible=true</string>327</resources>328<pathconvert property="_jvm17_test_arg_items_concat" refid="_jvm17_test_arg_items" pathsep=" "/>329<condition property="_std-test-jvmargs" value="${_jvm11_test_arg_items_concat}">330<equals arg1="${ant.java.version}" arg2="11"/>331</condition>332<condition property="_std-test-jvmargs" value="${_jvm17_test_arg_items_concat}">333<equals arg1="${ant.java.version}" arg2="17"/>334</condition>335336<!-- needed to compile org.apache.cassandra.utils.JMXServerUtils -->337<!-- needed to compile org.apache.cassandra.distributed.impl.Instance-->338<!-- needed to compile org.apache.cassandra.utils.memory.BufferPool -->339<property name="jdk11plus-javac-exports" value="--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED" />340341<!--342Add all the dependencies.343-->344<path id="cassandra.classpath">345<pathelement location="${build.classes.main}" />346<fileset dir="${build.dir.lib}">347<include name="**/*.jar" />348</fileset>349</path>350<path id="cassandra.classpath.test">351<file file="${build.dir}/${final.name}.jar"/> <!-- we need the jar for tests and benchmarks (multi-version jar) -->352<fileset dir="${build.dir.lib}">353<include name="**/*.jar" />354</fileset>355<fileset dir="${test.lib}/jars">356<include name="**/*.jar" />357<exclude name="**/ant-*.jar"/>358</fileset>359</path>360361<macrodef name="create-javadoc">362<attribute name="destdir"/>363<element name="filesets"/>364<sequential>365<javadoc destdir="@{destdir}" author="true" version="true" use="true"366windowtitle="${ant.project.name} API" classpathref="cassandra.classpath"367bottom="Copyright &copy; 2009- The Apache Software Foundation"368useexternalfile="yes" encoding="UTF-8" failonerror="false"369maxmemory="1024m" additionalparam="${jdk11plus-javac-exports}">370<filesets/>371</javadoc>372<fail message="javadoc failed">373<condition>374<not>375<available file="@{destdir}/index-all.html" />376</not>377</condition>378</fail>379</sequential>380</macrodef>381382<!--383Setup the output directories.384-->385<target name="init" >386<fail unless="is.source.artifact"387message="Not a source artifact, stopping here." />388<mkdir dir="${build.classes.main}"/>389<mkdir dir="${test.lib}"/>390<mkdir dir="${test.classes}"/>391<mkdir dir="${stress.test.classes}"/>392<mkdir dir="${fqltool.test.classes}"/>393<mkdir dir="${build.src.gen-java}"/>394<mkdir dir="${build.dir.lib}"/>395<mkdir dir="${jacoco.export.dir}"/>396<mkdir dir="${jacoco.partials.dir}"/>397398<!-- Set up jdk specific properties -->399<javac includes="**/JdkProperties.java,**/SetSystemProperty.java" srcdir="test/anttasks" destdir="${test.classes}" includeantruntime="true" source="${java.default}" target="${java.default}">400<compilerarg value="-Xlint:-options"/>401</javac>402<taskdef name="JdkProperties" classname="org.apache.cassandra.anttasks.JdkProperties" classpath="${test.classes}"/>403<taskdef name="SetSystemProperty" classname="org.apache.cassandra.anttasks.SetSystemProperty" classpath="${test.classes}"/>404405<JdkProperties/>406407<!-- https://issues.apache.org/jira/browse/CASSANDRA-16391?focusedCommentId=17310803&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17310803 -->408<SetSystemProperty name="jmc5.path" value="/tmp"/>409<SetSystemProperty name="jmc6.path" value="/tmp"/>410<SetSystemProperty name="visualvm.path" value="/tmp"/>411</target>412413<target name="clean" description="Remove all locally created artifacts">414<delete dir="${build.test.dir}" />415<delete dir="${build.dir}/tmp" />416<delete dir="${build.classes}" />417<delete dir="${build.src.gen-java}" />418<delete dir="${version.properties.dir}" />419<delete dir="${jacoco.export.dir}" />420<delete dir="${jacoco.partials.dir}"/>421</target>422<target depends="clean" name="cleanall"/>423424<target name="realclean" depends="clean" description="Remove the entire build directory and all downloaded artifacts">425<delete>426<fileset dir="${build.lib}" excludes="cassandra-driver-internal-only-*,puresasl-internal-only-*"/>427</delete>428<delete dir="${build.dir}" />429<delete dir="${doc.dir}/build" />430<delete dir="${doc.dir}/source/tools/nodetool" />431</target>432433<!--434This generates the CQL grammar files from Cql.g435-->436<target name="check-gen-cql3-grammar">437<uptodate property="cql3current"438targetfile="${build.src.gen-java}/org/apache/cassandra/cql3/Cql.tokens">439<srcfiles dir="${build.src.antlr}">440<include name="*.g"/>441</srcfiles>442</uptodate>443</target>444445<target name="gen-cql3-grammar" depends="check-gen-cql3-grammar" unless="cql3current">446<echo>Building Grammar ${build.src.antlr}/Cql.g ...</echo>447<java classname="org.antlr.Tool"448classpathref="cql3-grammar.classpath"449failonerror="true">450<arg value="-Xconversiontimeout" />451<arg value="10000" />452<arg value="${build.src.antlr}/Cql.g" />453<arg value="-fo" />454<arg value="${build.src.gen-java}/org/apache/cassandra/cql3/" />455<arg value="-Xmaxinlinedfastates"/>456<arg value="10"/> <!-- default is 60 -->457</java>458</target>459460<target name="generate-cql-html" depends="resolver-init" description="Generate HTML from textile source">461<taskdef classpathref="wikitext.classpath" resource="wikitexttasks.properties" />462<wikitext-to-html markupLanguage="Textile">463<fileset dir="${basedir}">464<include name="doc/cql3/*.textile"/>465</fileset>466</wikitext-to-html>467</target>468469<target name="gen-asciidoc" description="Generate dynamic asciidoc pages" depends="jar" unless="ant.gen-doc.skip">470<exec executable="make" osfamily="unix" dir="${doc.dir}" failonerror="true">471<arg value="gen-asciidoc"/>472</exec>473</target>474475<target name="gen-doc" description="Generate documentation" depends="gen-asciidoc,generate-cql-html" unless="ant.gen-doc.skip">476<exec executable="make" osfamily="unix" dir="${doc.dir}" failonerror="true">477<arg value="html"/>478</exec>479</target>480481<!--482Generates Java sources for tokenization support from jflex483grammar files484-->485<target name="generate-jflex-java" description="Generate Java from jflex grammar">486<taskdef classname="jflex.anttask.JFlexTask" classpathref="jflex.classpath" name="jflex" />487<jflex file="${build.src.java}/org/apache/cassandra/index/sasi/analyzer/StandardTokenizerImpl.jflex" destdir="${build.src.gen-java}/" />488</target>489490<!-- create properties file with C version -->491<target name="_createVersionPropFile" depends="_get-git-sha,set-cqlsh-version">492<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"/>493<mkdir dir="${version.properties.dir}"/>494<propertyfile file="${version.properties.dir}/version.properties">495<entry key="CassandraVersion" value="${version}"/>496<entry key="GitSHA" value="${git.sha}"/>497</propertyfile>498</target>499500<target name="test-run" depends="jar"501description="Run in test mode. Not for production use!">502<java classname="org.apache.cassandra.service.CassandraDaemon" fork="true">503<classpath>504<path refid="cassandra.classpath.test"/>505<pathelement location="${test.conf}"/>506</classpath>507<jvmarg value="-Dstorage-config=${test.conf}"/>508<jvmarg value="-Dcassandra.reads.thresholds.coordinator.defensive_checks_enabled=true" /> <!-- enable defensive checks -->509<jvmarg value="-javaagent:${build.dir.lib}/jars/jamm-${jamm.version}.jar" />510<jvmarg value="-ea"/>511<jvmarg line="${java-jvmargs}"/>512</java>513</target>514515<!--516The build target builds all the .class files517-->518<target name="build" depends="resolver-retrieve-build,build-project" description="Compile Cassandra classes"/>519<target name="codecoverage" depends="jacoco-run,jacoco-report" description="Create code coverage report"/>520521<target name="_build_java">522<!-- Note: we cannot use javac's 'release' option, as that does not allow accessing sun.misc.Unsafe nor523Nashorn's ClassFilter class as any javac modules option is invalid for release 8. -->524<echo message="Compiling for Java ${ant.java.version}..."/>525<javac526debug="true" debuglevel="${debuglevel}" encoding="utf-8"527destdir="${build.classes.main}" includeantruntime="false" source="${ant.java.version}" target="${ant.java.version}">528<src path="${build.src.java}"/>529<src path="${build.src.gen-java}"/>530<compilerarg value="-XDignore.symbol.file"/>531<compilerarg line="${jdk11plus-javac-exports}"/>532<classpath>533<path refid="cassandra.classpath"/>534</classpath>535</javac>536</target>537538<target depends="init,gen-cql3-grammar,generate-cql-html,generate-jflex-java"539name="build-project">540<echo message="${ant.project.name}: ${ant.file}"/>541<!-- Order matters! -->542<antcall target="_build_java"/>543<antcall target="_createVersionPropFile"/>544<copy todir="${build.classes.main}">545<fileset dir="${build.src.resources}" />546</copy>547<copy todir="${basedir}/conf" file="${build.classes.main}/META-INF/hotspot_compiler"/>548</target>549550<target name="check" depends="_main-jar,build-test,gen-doc" description="Verifies the source code and dependencies. This task is intended to run on pre-commit and locally. It should verify mostly modified files compared to the upstream base branch." unless="check.skip">551<antcall target="rat-check" inheritrefs="true"/>552<antcall target="checkstyle" inheritrefs="true"/>553<antcall target="checkstyle-test" inheritrefs="true"/>554</target>555556<!-- Stress build file -->557<property name="stress.build.src" value="${basedir}/tools/stress/src" />558<property name="stress.build.resources" value="${basedir}/tools/stress/resources" />559<property name="stress.test.src" value="${basedir}/tools/stress/test/unit" />560<property name="stress.build.classes" value="${build.classes}/stress" />561<property name="stress.test.classes" value="${build.dir}/test/stress-classes" />562<property name="stress.manifest" value="${stress.build.classes}/MANIFEST.MF" />563564<target name="stress-build-test" depends="stress-build" description="Compile stress tests">565<javac debug="true" debuglevel="${debuglevel}" destdir="${stress.test.classes}"566source="${ant.java.version}" target="${ant.java.version}"567includeantruntime="false" encoding="utf-8">568<classpath>569<path refid="cassandra.classpath.test"/>570<pathelement location="${stress.build.classes}" />571</classpath>572<src path="${stress.test.src}"/>573</javac>574</target>575576<target name="stress-build" depends="build" description="build stress tool">577<antcall target="_stress_build"/>578</target>579580<target name="_stress_build">581<mkdir dir="${stress.build.classes}" />582<javac compiler="modern" debug="true" debuglevel="${debuglevel}"583source="${ant.java.version}" target="${ant.java.version}"584encoding="utf-8" destdir="${stress.build.classes}" includeantruntime="true">585<src path="${stress.build.src}"/>586<classpath>587<path refid="cassandra.classpath" />588</classpath>589</javac>590<copy todir="${stress.build.classes}">591<fileset dir="${stress.build.resources}" />592</copy>593</target>594595<target name="stress-test" depends="maybe-build-test" description="Runs stress tests">596<testmacro inputdir="${stress.test.src}"597timeout="${test.timeout}">598</testmacro>599</target>600601<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:602ant stress-test-some -Dtest.name=org.apache.cassandra.stress.generate.DistributionGaussianTest603ant stress-test-some -Dtest.name=org.apache.cassandra.stress.generate.DistributionGaussianTest -Dtest.methods=simpleGaussian604-->605<target name="stress-test-some" depends="maybe-build-test" description="Runs stress tests">606<testmacro inputdir="${stress.test.src}" timeout="${test.timeout}">607<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>608<test if:blank="${test.methods}" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>609</testmacro>610</target>611612<!--613fqltool build file614-->615<property name="fqltool.build.src" value="${basedir}/tools/fqltool/src" />616<property name="fqltool.test.src" value="${basedir}/tools/fqltool/test/unit" />617<property name="fqltool.build.classes" value="${build.classes}/fqltool" />618<property name="fqltool.test.classes" value="${build.dir}/test/fqltool-classes" />619<property name="fqltool.manifest" value="${fqltool.build.classes}/MANIFEST.MF" />620621<target name="fqltool-build-test" depends="fqltool-build" description="Compile fqltool tests">622<javac debug="true" debuglevel="${debuglevel}" destdir="${fqltool.test.classes}"623source="${ant.java.version}" target="${ant.java.version}"624includeantruntime="false" encoding="utf-8">625<classpath>626<path refid="cassandra.classpath.test"/>627<pathelement location="${fqltool.build.classes}" />628</classpath>629<src path="${fqltool.test.src}"/>630</javac>631</target>632633<target name="fqltool-build" depends="build" description="build fqltool">634<antcall target="_fqltool_build"/>635</target>636637<target name="_fqltool_build">638<mkdir dir="${fqltool.build.classes}" />639<javac compiler="modern" debug="true" debuglevel="${debuglevel}"640source="${ant.java.version}" target="${ant.java.version}"641encoding="utf-8" destdir="${fqltool.build.classes}" includeantruntime="true">642<src path="${fqltool.build.src}" />643<classpath>644<path refid="cassandra.classpath" />645</classpath>646</javac>647</target>648649<target name="fqltool-test" depends="fqltool-build-test, maybe-build-test" description="Runs fqltool tests">650<testmacro inputdir="${fqltool.test.src}"651timeout="${test.timeout}">652</testmacro>653</target>654655<!--656simulator asm build file657-->658<property name="simulator-asm.build.src" value="${test.simulator-asm.src}" />659<property name="simulator-asm.build.classes" value="${build.classes}/simulator-asm" />660<property name="simulator-asm.manifest" value="${simulator-asm.build.classes}/MANIFEST.MF" />661662<property name="simulator-bootstrap.build.src" value="${test.simulator-bootstrap.src}" />663<property name="simulator-bootstrap.build.classes" value="${build.classes}/simulator-bootstrap" />664<property name="simulator-bootstrap.manifest" value="${simulator-bootstrap.build.classes}/MANIFEST.MF" />665666<target name="simulator-asm-build" depends="build" description="build simulator-asm">667<antcall target="_simulator-asm_build"/>668</target>669670<target name="simulator-bootstrap-build" depends="build" description="build simulator-bootstrap">671<antcall target="_simulator-bootstrap_build"/>672</target>673674<target name="_simulator-asm_build">675<mkdir dir="${simulator-asm.build.classes}" />676<javac compiler="modern" debug="true" debuglevel="${debuglevel}"677source="${ant.java.version}" target="${ant.java.version}"678encoding="utf-8" destdir="${simulator-asm.build.classes}" includeantruntime="true">679<src path="${simulator-asm.build.src}" />680<classpath>681<fileset dir="${test.lib}">682<include name="**/asm-*${asm.version}.jar" />683</fileset>684<fileset dir="${build.lib}">685<include name="**/asm-*${asm.version}.jar" />686</fileset>687</classpath>688</javac>689</target>690691<target name="_simulator-bootstrap_build">692<mkdir dir="${simulator-bootstrap.build.classes}" />693<javac compiler="modern" debug="true" debuglevel="${debuglevel}"694source="${ant.java.version}" target="${ant.java.version}"695encoding="utf-8" destdir="${simulator-bootstrap.build.classes}" includeantruntime="true">696<src path="${simulator-bootstrap.build.src}" />697<classpath>698<fileset dir="${test.lib}">699<include name="**/asm-*${asm.version}.jar" />700</fileset>701<fileset dir="${build.lib}">702<include name="**/asm-*${asm.version}.jar" />703</fileset>704</classpath>705<compilerarg value="-XDignore.symbol.file"/>706</javac>707</target>708709<target name="write-poms" unless="without.maven">710<filterset id="pom-template">711<filter token="version" value="${version}"/>712<filter token="final.name" value="${final.name}"/>713<filter token="jamm.version" value="${jamm.version}"/>714<filter token="allocation-instrumenter.version" value="${allocation-instrumenter.version}"/>715<filter token="ecj.version" value="${ecj.version}"/>716<filter token="asm.version" value="${asm.version}"/>717<filter token="jacoco.version" value="${jacoco.version}"/>718<filter token="jflex.version" value="${jflex.version}"/>719</filterset>720721<copy file=".build/cassandra-deps-template.xml" tofile="${build.dir}/${final.name}.pom">722<filterset refid="pom-template"/>723</copy>724<copy file=".build/parent-pom-template.xml" tofile="${build.dir}/${final.name}-parent.pom">725<filterset refid="pom-template"/>726</copy>727<copy file=".build/cassandra-build-deps-template.xml" tofile="${build.dir}/tmp-${final.name}-deps.pom">728<filterset refid="pom-template"/>729</copy>730</target>731732<!--733The jar target makes cassandra.jar output.734-->735<target name="_main-jar"736depends="build"737description="Assemble Cassandra JAR files">738<mkdir dir="${build.classes.main}/META-INF" />739<copy file="LICENSE.txt"740tofile="${build.classes.main}/META-INF/LICENSE.txt"/>741<copy file="NOTICE.txt"742tofile="${build.classes.main}/META-INF/NOTICE.txt"/>743744<!-- Main Jar -->745<jar jarfile="${build.dir}/${final.name}.jar">746<fileset dir="${build.classes.main}">747</fileset>748<manifest>749<!-- <section name="org/apache/cassandra/infrastructure"> -->750<attribute name="Multi-Release" value="true"/>751<attribute name="Implementation-Title" value="Cassandra"/>752<attribute name="Implementation-Version" value="${version}"/>753<attribute name="Implementation-Vendor" value="Apache"/>754<attribute name="Implementation-Git-SHA" value="${git.sha}"/>755<!-- </section> -->756</manifest>757</jar>758</target>759760<target name="stress-jar"761depends="stress-build"762description="Assemble Cassandra JAR files">763<!-- Stress jar -->764<manifest file="${stress.manifest}">765<attribute name="Built-By" value="Pavel Yaskevich"/>766<attribute name="Main-Class" value="org.apache.cassandra.stress.Stress"/>767</manifest>768<mkdir dir="${stress.build.classes}/META-INF" />769<mkdir dir="${build.dir}/tools/lib/" />770<jar destfile="${build.dir}/tools/lib/stress.jar" manifest="${stress.manifest}">771<fileset dir="${stress.build.classes}"/>772</jar>773</target>774775<target name="fqltool-jar"776depends="fqltool-build"777description="Assemble Cassandra JAR files">778779<!-- fqltool jar -->780<manifest file="${fqltool.manifest}">781<attribute name="Built-By" value="Marcus Eriksson"/>782<attribute name="Main-Class" value="org.apache.cassandra.fqltool.FullQueryLogTool"/>783</manifest>784<mkdir dir="${fqltool.build.classes}/META-INF" />785<mkdir dir="${build.dir}/tools/lib/" />786<jar destfile="${build.dir}/tools/lib/fqltool.jar" manifest="${fqltool.manifest}">787<fileset dir="${fqltool.build.classes}"/>788</jar>789</target>790791<target name="simulator-jars"792depends="simulator-asm-build,simulator-bootstrap-build"793description="Assemble Cassandra JAR files">794795<!-- simulator asm jar -->796<manifest file="${simulator-asm.manifest}">797<attribute name="Built-By" value="Benedict Elliott Smith"/>798<attribute name="Premain-Class" value="org.apache.cassandra.simulator.asm.InterceptAgent"/>799<attribute name="Agent-Class" value="org.apache.cassandra.simulator.asm.InterceptAgent"/>800<attribute name="Can-Redefine-Classes" value="true"/>801<attribute name="Can-Retransform-Classes" value="true"/>802</manifest>803<mkdir dir="${simulator-asm.build.classes}/META-INF" />804<mkdir dir="${test.lib}/jars/" />805<jar destfile="${test.lib}/jars/simulator-asm.jar" manifest="${simulator-asm.manifest}">806<fileset dir="${simulator-asm.build.classes}"/>807<fileset dir="${test.lib}/jars">808<include name="**/asm-*${asm.version}.jar" />809</fileset>810</jar>811812<!-- simulator bootstrap jar -->813<manifest file="${simulator-bootstrap.manifest}">814<attribute name="Built-By" value="Benedict Elliott Smith"/>815</manifest>816<mkdir dir="${simulator-bootstrap.build.classes}/META-INF" />817<mkdir dir="${test.lib}/jars/" />818<jar destfile="${test.lib}/jars/simulator-bootstrap.jar" manifest="${simulator-bootstrap.manifest}">819<fileset dir="${simulator-bootstrap.build.classes}"/>820<fileset dir="${test.lib}/jars">821<include name="**/asm-*${asm.version}.jar" />822</fileset>823</jar>824</target>825826<target name="jar"827depends="_main-jar,build-test,stress-jar,fqltool-jar,simulator-jars,write-poms"828description="Assemble Cassandra JAR files">829</target>830831<!--832The javadoc-jar target makes cassandra-javadoc.jar output required for publishing to Maven central repository.833-->834<target name="javadoc-jar" depends="javadoc" unless="no-javadoc" description="Assemble Cassandra JavaDoc JAR file">835<jar jarfile="${build.dir}/${final.name}-javadoc.jar" basedir="${javadoc.dir}"/>836<!-- javadoc task always rebuilds so might as well remove the generated docs to prevent837being pulled into the distribution by accident -->838<delete quiet="true" dir="${javadoc.dir}"/>839</target>840841<!--842The sources-jar target makes cassandra-sources.jar output required for publishing to Maven central repository.843-->844<target name="sources-jar" depends="init" description="Assemble Cassandra Sources JAR file">845<jar jarfile="${build.dir}/${final.name}-sources.jar">846<fileset dir="${build.src.java}" defaultexcludes="yes">847<include name="org/apache/**/*.java"/>848</fileset>849<fileset dir="${build.src.gen-java}" defaultexcludes="yes">850<include name="org/apache/**/*.java"/>851</fileset>852</jar>853</target>854855<target name="_artifacts-init" depends="jar">856<mkdir dir="${dist.dir}"/>857<!-- fix the control linefeed so that builds on windows works on linux -->858<fixcrlf srcdir="bin" includes="**/*" eol="lf" eof="remove" />859<fixcrlf srcdir="conf" includes="**/*" eol="lf" eof="remove" />860<fixcrlf srcdir="tools/bin" includes="**/*" eol="lf" eof="remove" />861<copy todir="${dist.dir}/lib">862<fileset dir="${build.lib}"/>863<fileset dir="${build.dir}">864<include name="${final.name}.jar" />865</fileset>866</copy>867<copy todir="${dist.dir}/doc" failonerror="false">868<fileset dir="doc">869<include name="cql3/CQL.html" />870<include name="cql3/CQL.css" />871<include name="SASI.md" />872</fileset>873</copy>874<copy todir="${dist.dir}/doc/html" failonerror="false">875<fileset dir="doc" />876<globmapper from="build/html/*" to="*"/>877</copy>878<copy todir="${dist.dir}/bin">879<fileset dir="bin"/>880</copy>881<copy todir="${dist.dir}/conf">882<fileset dir="conf"/>883</copy>884<copy todir="${dist.dir}/pylib">885<fileset dir="pylib">886<include name="**" />887<exclude name="**/*.pyc" />888</fileset>889</copy>890<copy todir="${dist.dir}/">891<fileset dir="${basedir}">892<include name="*.txt" />893<include name=".snyk" />894</fileset>895</copy>896<copy todir="${dist.dir}/tools/bin">897<fileset dir="${basedir}/tools/bin"/>898</copy>899<copy todir="${dist.dir}/tools/">900<fileset dir="${basedir}/tools/">901<include name="*.yaml"/>902</fileset>903</copy>904<copy todir="${dist.dir}/tools/lib">905<fileset dir="${build.dir}/tools/lib/">906<include name="*.jar" />907</fileset>908</copy>909</target>910911<!-- creates release tarballs -->912<target name="artifacts" depends="_artifacts-init,check,sources-jar"913description="Create Cassandra tarball and maven artifacts">914<tar compression="gzip" longfile="gnu"915destfile="${build.dir}/${final.name}-bin.tar.gz">916917<!-- Everything but bin/ (default mode) -->918<tarfileset dir="${dist.dir}" prefix="${final.name}">919<include name="**"/>920<exclude name="bin/*" />921<exclude name="tools/bin/*"/>922</tarfileset>923<!-- Shell includes in bin/ (default mode) -->924<tarfileset dir="${dist.dir}" prefix="${final.name}">925<include name="bin/*.in.sh" />926<include name="tools/bin/*.in.sh" />927</tarfileset>928<!-- Executable scripts in bin/ -->929<tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755">930<include name="bin/*"/>931<include name="tools/bin/*"/>932<exclude name="bin/*.in.sh" />933<exclude name="tools/bin/*.in.sh" />934</tarfileset>935</tar>936937<tar compression="gzip" longfile="gnu"938destfile="${build.dir}/${final.name}-src.tar.gz">939940<tarfileset dir="${basedir}"941prefix="${final.name}-src">942<include name="**"/>943<exclude name="build/**" />944<exclude name="lib/**" />945<exclude name="src/gen-java/**" />946<exclude name=".git/**" />947<exclude name="venv/**" />948<exclude name="src/resources/org/apache/cassandra/config/version.properties" />949<exclude name="conf/hotspot_compiler" />950<exclude name="doc/cql3/CQL.html" />951<exclude name="doc/build/**" />952<exclude name="bin/*" /> <!-- handled separately below -->953<exclude name="tools/bin/*" /> <!-- handled separately below -->954<!-- exclude python generated files -->955<exclude name="**/__pycache__/**" />956<!-- exclude Eclipse files -->957<exclude name=".project" />958<exclude name=".classpath" />959<exclude name=".settings/**" />960<exclude name=".externalToolBuilders/**" />961<!-- exclude NetBeans files -->962<exclude name="ide/nbproject/private/**" />963</tarfileset>964965<!-- python driver -->966<tarfileset dir="${basedir}" prefix="${final.name}-src">967<include name="lib/cassandra-driver-internal-only-**" />968</tarfileset>969970<!-- Shell includes in bin/ and tools/bin/ -->971<tarfileset dir="${basedir}" prefix="${final.name}-src">972<include name="bin/*.in.sh" />973<include name="tools/bin/*.in.sh" />974</tarfileset>975<!-- Everything else (assumed to be scripts), is executable -->976<tarfileset dir="${basedir}" prefix="${final.name}-src" mode="755">977<include name="bin/*"/>978<exclude name="bin/*.in.sh" />979<include name="tools/bin/*"/>980<exclude name="tools/bin/*.in.sh" />981<include name=".build/**/*.sh"/>982<include name="doc/scripts/process-native-protocol-specs-in-docker.sh"/>983</tarfileset>984</tar>985986<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha256" algorithm="SHA-256">987<fileset dir="${build.dir}">988<include name="${final.name}-bin.tar.gz" />989<include name="${final.name}-src.tar.gz" />990</fileset>991</checksum>992<checksum forceOverwrite="yes" todir="${build.dir}" fileext=".sha512" algorithm="SHA-512">993<fileset dir="${build.dir}">994<include name="${final.name}-bin.tar.gz" />995<include name="${final.name}-src.tar.gz" />996</fileset>997</checksum>998</target>9991000<!-- Wrapper of build-test without dependencies, so both that target and its dependencies are skipped if the property1001no-build-test is true. This is meant to be used to run tests without actually building them, provided that they have1002been built before. All test targets depend on this, so one can run them using the no-build-test property.1003For example:10041005ant test -Dno-build-test=true1006ant test -Dtest.name=StorageServiceServerTest -Dno-build-test=true1007ant testsome -Dtest.name=org.apache.cassandra.service.StorageServiceServerTest -Dno-build-test=true10081009The property is false by default, so if it's not specified the tests would be built with all their dependencies.1010See CASSANDRA-16625 and CASSANDRA-18000 for further details.1011-->1012<target name="maybe-build-test" unless="no-build-test">1013<antcall target="build-test" inheritRefs="true"/>1014</target>10151016<target name="build-test" depends="_main-jar,stress-build-test,fqltool-build,resolver-dist-lib,simulator-jars"1017description="Compile test classes">1018<antcall target="_build-test"/>1019<antcall target="_check-test-names"/>1020</target>10211022<target name="_build-test">1023<javac1024compiler="modern"1025debug="true"1026debuglevel="${debuglevel}"1027destdir="${test.classes}"1028includeantruntime="true"1029source="${ant.java.version}"1030target="${ant.java.version}"1031encoding="utf-8">1032<classpath>1033<path refid="cassandra.classpath.test"/>1034<pathelement location="${fqltool.build.classes}"/>1035</classpath>1036<compilerarg value="-XDignore.symbol.file"/>1037<!-- needed to compile org.apache.cassandra.utils.memory.BufferPoolTest -->1038<compilerarg line="${jdk11plus-javac-exports}"/>1039<src path="${test.anttasks.src}"/>1040<src path="${test.unit.src}"/>1041<src path="${test.long.src}"/>1042<src path="${test.burn.src}"/>1043<src path="${test.memory.src}"/>1044<src path="${test.microbench.src}"/>1045<src path="${test.distributed.src}"/>1046<src path="${test.simulator.src}"/>1047<src path="${test.simulator-asm.src}"/>1048<src path="${test.simulator-bootstrap.src}"/>1049<src path="${test.simulator-test.src}"/>1050<compilerarg line="${jdk11plus-javac-exports}"/>1051</javac>10521053<!-- Non-java resources needed by the test suite -->1054<copy todir="${test.classes}">1055<fileset dir="${test.resources}"/>1056</copy>1057</target>10581059<macrodef name="check-test-names">1060<attribute name="annotationName"/>1061<attribute name="regex"/>1062<attribute name="scanClassPath" default="${test.classes}:${fqltool.test.classes}:${stress.test.classes}"/>1063<attribute name="packageName" default="org.apache.cassandra"/>1064<attribute name="expand" default="true"/>1065<attribute name="normalize" default="true"/>1066<attribute name="verbose" default="false"/>10671068<sequential>1069<java taskname="check-test-names" fork="true" failonerror="yes" classname="org.apache.cassandra.anttasks.TestNameCheckTask">1070<classpath>1071<path refid="cassandra.classpath.test"/>1072<pathelement location="${fqltool.build.classes}"/>1073<pathelement location="${stress.build.classes}"/>1074<pathelement location="${test.classes}"/>1075<pathelement location="${fqltool.test.classes}"/>1076<pathelement location="${stress.test.classes}"/>1077</classpath>1078<jvmarg line="${java-jvmargs}"/>1079<jvmarg value="-DscanClassPath=@{scanClassPath}"/>1080<jvmarg value="-DpackageName=@{packageName}"/>1081<jvmarg value="-DannotationName=@{annotationName}"/>1082<jvmarg value="-Dexpand=@{expand}"/>1083<jvmarg value="-Dnormalize=@{normalize}"/>1084<jvmarg value="-Dverbose=@{verbose}"/>1085<jvmarg value="-Dregex=@{regex}"/>1086</java>1087</sequential>1088</macrodef>10891090<target name="_check-test-names">1091<check-test-names annotationName="org.junit.Test" regex=".*Test$"/>1092<check-test-names annotationName="org.openjdk.jmh.annotations.Benchmark" regex=".*(Bench|_jmhType.*)$"/>1093</target>10941095<!-- Run tests separately and report errors after and generate a junit report -->1096<macrodef name="testhelper">1097<attribute name="testdelegate"/>1098<sequential>1099<taskdef name="testhelper_" classname="org.apache.cassandra.anttasks.TestHelper" classpath="${test.classes}"/>1100<testhelper_ property="@{testdelegate}"/>1101<fail message="Some test(s) failed.">1102<condition>1103<and>1104<isset property="testfailed"/>1105<not>1106<isset property="ant.test.failure.ignore"/>1107</not>1108</and>1109</condition>1110</fail>1111</sequential>1112</macrodef>11131114<!-- Run a list of junit tasks but don't track errors or generate a report after1115If a test fails the testfailed property will be set. All the tests are run using the testdelegate1116macro that is specified as an attribute and they will be run sequentially in this ant process -->11171118<!-- Defines how to run a set of tests. If you change the defaults for attributes1119you should also update them in testmacro.,1120The two are split because the helper doesn't generate1121a junit report or fail on errors -->1122<macrodef name="testmacrohelper">1123<attribute name="inputdir" />1124<attribute name="timeout" default="${test.timeout}" />1125<attribute name="forkmode" default="perTest"/>1126<element name="optjvmargs" implicit="true" optional="true" />1127<attribute name="filter" default="**/${test.name}.java"/>1128<attribute name="exclude" default="" />1129<attribute name="filelist" default="" />1130<attribute name="testtag" default=""/>1131<attribute name="usejacoco" default="no"/>1132<attribute name="showoutput" default="false"/>11331134<sequential>1135<fail message="testing with build.test.dir (${build.test.dir}) not pointing to 'build/test/' will fail, test configurations are hardcoded.">1136<condition><not><equals arg1="${build.test.dir}" arg2="${basedir}/build/test"/></not></condition>1137</fail>1138<condition property="additionalagent"1139value="-javaagent:${build.dir.lib}/jars/jacocoagent.jar=destfile=${jacoco.partialexecfile}"1140else="">1141<istrue value="${usejacoco}"/>1142</condition>1143<taskdef name="junit-timeout" classname="org.apache.cassandra.JStackJUnitTask">1144<classpath>1145<pathelement location="${test.classes}"/>1146</classpath>1147</taskdef>1148<mkdir dir="${build.test.dir}/cassandra"/>1149<mkdir dir="${build.test.output.dir}"/>1150<mkdir dir="${build.test.output.dir}/@{testtag}"/>1151<mkdir dir="${tmp.dir}"/>1152<junit-timeout fork="on" forkmode="@{forkmode}" failureproperty="testfailed" maxmemory="1024m" timeout="@{timeout}" showoutput="@{showoutput}">1153<formatter classname="org.apache.cassandra.CassandraXMLJUnitResultFormatter" extension=".xml" usefile="true"/>1154<formatter classname="org.apache.cassandra.CassandraBriefJUnitResultFormatter" usefile="false"/>1155<jvmarg value="-Dstorage-config=${test.conf}"/>1156<jvmarg value="-Djava.awt.headless=true"/>1157<!-- Cassandra 3.0+ needs <jvmarg line="... ${additionalagent}" /> here! (not value=) -->1158<jvmarg line="-javaagent:${build.dir.lib}/jars/jamm-${jamm.version}.jar ${additionalagent}" />1159<jvmarg value="-ea"/>1160<jvmarg value="-Djava.io.tmpdir=${tmp.dir}"/>1161<jvmarg value="-Dcassandra.debugrefcount=true"/>1162<jvmarg value="${jvm_xss}"/>1163<!-- When we do classloader manipulation SoftReferences can cause memory leaks1164that can OOM our test runs. The next two settings informs our GC1165algorithm to limit the metaspace size and clean up SoftReferences1166more aggressively rather than waiting. See CASSANDRA-14922 for more details.1167-->1168<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />1169<jvmarg value="-XX:ActiveProcessorCount=${cassandra.test.processorCount}" />1170<jvmarg value="-XX:HeapDumpPath=${build.test.dir}" />1171<jvmarg value="-Dcassandra.test.driver.connection_timeout_ms=${test.driver.connection_timeout_ms}"/>1172<jvmarg value="-Dcassandra.test.driver.read_timeout_ms=${test.driver.read_timeout_ms}"/>1173<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>1174<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>1175<jvmarg value="-Dcassandra.test.sstableformatdevelopment=true"/>1176<!-- The first time SecureRandom initializes can be slow if it blocks on /dev/random -->1177<jvmarg value="-Djava.security.egd=file:/dev/urandom" />1178<jvmarg value="-Dcassandra.testtag=@{testtag}_jdk${ant.java.version}${testtag.extra}"/>1179<jvmarg value="-Dcassandra.keepBriefBrief=${cassandra.keepBriefBrief}" />1180<jvmarg value="-Dcassandra.strict.runtime.checks=true" />1181<jvmarg value="-Dcassandra.reads.thresholds.coordinator.defensive_checks_enabled=true" /> <!-- enable defensive checks -->1182<jvmarg value="-Dcassandra.test.flush_local_schema_changes=${cassandra.test.flush_local_schema_changes}"/>1183<jvmarg value="-Dcassandra.test.messagingService.nonGracefulShutdown=${cassandra.test.messagingService.nonGracefulShutdown}"/>1184<jvmarg value="-Dcassandra.use_nix_recursive_delete=${cassandra.use_nix_recursive_delete}"/>1185<jvmarg value="-Dio.netty.allocator.useCacheForAllThreads=true"/>1186<jvmarg value="-Dio.netty.allocator.maxOrder=11"/>1187<jvmarg line="${java-jvmargs}"/>1188<!-- disable shrinks in quicktheories CASSANDRA-15554 -->1189<jvmarg value="-DQT_SHRINKS=0"/>1190<jvmarg line="${_std-test-jvmargs} " />1191<jvmarg line="${test.jvm.args}" />1192<optjvmargs/>1193<!-- Uncomment to debug unittest, attach debugger to port 1416 -->1194<!--1195<jvmarg line="-agentlib:jdwp=transport=dt_socket,address=localhost:1416,server=y,suspend=y" />1196-->1197<classpath>1198<pathelement path="${java.class.path}"/>1199<pathelement location="${stress.build.classes}"/>1200<pathelement location="${fqltool.build.classes}"/>1201<pathelement location="${test.classes}"/>1202<path refid="cassandra.classpath.test" />1203<pathelement location="${stress.test.classes}"/>1204<pathelement location="${fqltool.test.classes}"/>1205<pathelement location="${test.conf}"/>1206<pathelement path="${java.class.path}"/>1207<path refid="cassandra.classpath" />1208<fileset dir="${test.lib}">1209<include name="**/*.jar" />1210<exclude name="**/ant-*.jar"/>1211</fileset>1212</classpath>1213<batchtest todir="${build.test.output.dir}/@{testtag}">1214<fileset dir="@{inputdir}" includes="@{filter}" excludes="@{exclude}"/>1215<filelist dir="@{inputdir}" files="@{filelist}"/>1216</batchtest>1217</junit-timeout>12181219<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/commitlog"/>1220<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/cdc_raw"/>1221<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/data"/>1222<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/ssl_upload_tables"/>1223<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/system_data"/>1224<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/saved_caches"/>1225<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/hints"/>1226</sequential>1227</macrodef>12281229<target name="testold" depends="maybe-build-test" description="Execute unit tests">1230<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}">1231<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1232<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1233<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1234<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1235<jvmarg value="-Dcassandra.skip_sync=true" />1236</testmacro>1237<fileset dir="${test.unit.src}" />1238</target>12391240<!-- Will not generate a junit report or fail on error -->1241<macrodef name="testlist">1242<attribute name="test.file.list"/>1243<sequential>1244<condition property="maxMemory" value="8G" else="4G">1245<equals arg1="${test.classlistprefix}" arg2="distributed"/>1246</condition>1247<testmacrohelper inputdir="${test.dir}/${test.classlistprefix}" filelist="@{test.file.list}" exclude="**/*.java" timeout="${test.timeout}">1248<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1249<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1250<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1251<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1252<jvmarg value="-Dcassandra.skip_sync=true" />1253<!-- total memory must fit within the pod constraints, see comments in .jenkins/Jenkinsfile and dind's container resourceRequestMemory in .jenkins/k8s/jenkins-deployment.yaml -->1254<jvmarg value="-Xmx${maxMemory}"/>1255</testmacrohelper>1256</sequential>1257</macrodef>12581259<!-- Will not generate a junit report -->1260<macrodef name="testlist-compression">1261<attribute name="test.file.list" />1262<sequential>1263<property name="compressed_yaml" value="${build.test.dir}/cassandra.compressed.yaml"/>1264<concat destfile="${compressed_yaml}">1265<fileset file="${test.conf}/cassandra.yaml"/>1266<fileset file="${test.conf}/commitlog_compression_${test.compression.algo}.yaml"/>1267</concat>1268<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"1269exclude="**/*.java" timeout="${test.timeout}" testtag="compression">1270<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1271<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1272<jvmarg value="-Dcassandra.test.compression=true"/>1273<jvmarg value="-Dcassandra.test.compression.algo=${test.compression.algo}"/>1274<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1275<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1276<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>1277<jvmarg value="-Dcassandra.skip_sync=true" />1278</testmacrohelper>1279</sequential>1280</macrodef>12811282<macrodef name="testlist-cdc">1283<attribute name="test.file.list" />1284<sequential>1285<property name="cdc_yaml" value="${build.test.dir}/cassandra.cdc.yaml"/>1286<concat destfile="${cdc_yaml}">1287<fileset file="${test.conf}/cassandra.yaml"/>1288<fileset file="${test.conf}/cdc.yaml"/>1289</concat>1290<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"1291exclude="**/*.java" timeout="${test.timeout}" testtag="cdc">1292<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1293<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1294<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1295<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1296<jvmarg value="-Dcassandra.config=file:///${cdc_yaml}"/>1297<jvmarg value="-Dcassandra.skip_sync=true" />1298</testmacrohelper>1299</sequential>1300</macrodef>13011302<macrodef name="testlist-latest">1303<attribute name="test.file.list" />1304<sequential>1305<property name="latest_yaml" value="${build.test.dir}/cassandra.latest.yaml"/>1306<concat destfile="${latest_yaml}">1307<fileset file="${test.conf}/cassandra.yaml"/>1308<fileset file="${test.conf}/latest_diff.yaml"/>1309<fileset file="${test.conf}/storage_compatibility_mode_none.yaml"/>1310</concat>1311<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"1312exclude="**/*.java" timeout="${test.timeout}" testtag="latest">1313<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1314<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1315<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1316<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1317<jvmarg value="-Dcassandra.config=file:///${latest_yaml}"/>1318<jvmarg value="-Dcassandra.test.storage_compatibility_mode=NONE"/>1319<jvmarg value="-Dcassandra.skip_sync=true" />1320</testmacrohelper>1321</sequential>1322</macrodef>13231324<macrodef name="testlist-oa">1325<attribute name="test.file.list"/>1326<sequential>1327<property name="scm_none_yaml" value="${build.test.dir}/cassandra.scm_none.yaml"/>1328<concat destfile="${scm_none_yaml}">1329<fileset file="${test.conf}/cassandra.yaml"/>1330<fileset file="${test.conf}/storage_compatibility_mode_none.yaml"/>1331</concat>1332<testmacrohelper inputdir="${test.dir}/${test.classlistprefix}" filelist="@{test.file.list}"1333exclude="**/*.java" timeout="${test.timeout}" testtag="oa">1334<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1335<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1336<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1337<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1338<jvmarg value="-Dcassandra.config=file:///${scm_none_yaml}"/>1339<jvmarg value="-Dcassandra.test.storage_compatibility_mode=NONE"/>1340<jvmarg value="-Dcassandra.skip_sync=true" />1341</testmacrohelper>1342</sequential>1343</macrodef>13441345<macrodef name="testlist-system-keyspace-directory">1346<attribute name="test.file.list" />1347<sequential>1348<property name="system_keyspaces_directory_yaml" value="${build.test.dir}/cassandra.system.yaml"/>1349<concat destfile="${system_keyspaces_directory_yaml}">1350<fileset file="${test.conf}/cassandra.yaml"/>1351<fileset file="${test.conf}/system_keyspaces_directory.yaml"/>1352</concat>1353<testmacrohelper inputdir="${test.unit.src}" filelist="@{test.file.list}"1354exclude="**/*.java" timeout="${test.timeout}" testtag="system_keyspace_directory">1355<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1356<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1357<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1358<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1359<jvmarg value="-Dcassandra.config=file:///${system_keyspaces_directory_yaml}"/>1360<jvmarg value="-Dcassandra.skip_sync=true" />1361</testmacrohelper>1362</sequential>1363</macrodef>13641365<!--1366Run named ant task with jacoco, such as "ant jacoco-run -Dtaskname=test"1367the target run must enable the jacoco agent if usejacoco is 'yes' -->1368<target name="jacoco-run" description="run named task with jacoco instrumentation">1369<condition property="runtask" value="${taskname}" else="test">1370<isset property="taskname"/>1371</condition>1372<antcall target="${runtask}">1373<param name="usejacoco" value="yes"/>1374</antcall>1375</target>13761377<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:1378ant testsome -Dtest.name=org.apache.cassandra.service.StorageServiceServerTest1379ant testsome -Dtest.name=org.apache.cassandra.service.StorageServiceServerTest -Dtest.methods=testRegularMode,testGetAllRangesEmpty1380-->1381<target name="testsome" depends="maybe-build-test" description="Execute specific unit tests" >1382<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}">1383<test if="withMethods" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>1384<test if="withoutMethods" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>1385<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>1386<jvmarg value="-Dinvalid-legacy-sstable-root=${test.data}/invalid-legacy-sstables"/>1387<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1388<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1389<jvmarg value="-Dcassandra.skip_sync=true" />1390</testmacro>1391</target>13921393<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:1394ant long-testsome -Dtest.name=org.apache.cassandra.cql3.ManyRowsTest1395ant long-testsome -Dtest.name=org.apache.cassandra.cql3.ManyRowsTest -Dtest.methods=testLargeCount1396-->1397<target name="long-testsome" depends="maybe-build-test" description="Execute specific long unit tests" >1398<testmacro inputdir="${test.long.src}" timeout="${test.long.timeout}">1399<test if="withMethods" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>1400<test if="withoutMethods" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>1401<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1402<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1403</testmacro>1404</target>14051406<!-- Use this with an FQDN for test class, and an optional csv list of methods like this:1407ant burn-testsome -Dtest.name=org.apache.cassandra.utils.memory.LongBufferPoolTest1408ant burn-testsome -Dtest.name=org.apache.cassandra.utils.memory.LongBufferPoolTest -Dtest.methods=testPoolAllocateWithRecyclePartially1409-->1410<target name="burn-testsome" depends="maybe-build-test" description="Execute specific burn unit tests" >1411<testmacro inputdir="${test.burn.src}" timeout="${test.burn.timeout}">1412<test if="withMethods" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>1413<test if="withoutMethods" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>1414<jvmarg value="-Dlogback.configurationFile=test/conf/logback-burntest.xml"/>1415</testmacro>1416</target>14171418<target name="test-compression" depends="maybe-build-test,stress-build" description="Execute unit tests with sstable compression enabled">1419<path id="all-test-classes-path">1420<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />1421<fileset dir="${test.distributed.src}" includes="**/${test.name}.java" />1422</path>1423<property name="all-test-classes" refid="all-test-classes-path"/>1424<testhelper testdelegate="testlist-compression" />1425</target>14261427<target name="test-cdc" depends="maybe-build-test" description="Execute unit tests with change-data-capture enabled">1428<path id="all-test-classes-path">1429<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />1430</path>1431<property name="all-test-classes" refid="all-test-classes-path"/>1432<testhelper testdelegate="testlist-cdc" />1433</target>14341435<target name="test-latest" depends="maybe-build-test" description="Execute unit tests with configuration matching cassandra_latest.yaml">1436<path id="all-test-classes-path">1437<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />1438</path>1439<property name="all-test-classes" refid="all-test-classes-path"/>1440<testhelper testdelegate="testlist-latest" />1441</target>14421443<target name="test-oa" depends="maybe-build-test" description="Test Runner for the oa sstable format">1444<path id="all-test-classes-path">1445<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/distributed/test/UpgradeTest*.java" />1446</path>1447<property name="all-test-classes" refid="all-test-classes-path"/>1448<testhelper testdelegate="testlist-oa"/>1449</target>14501451<target name="test-system-keyspace-directory" depends="maybe-build-test" description="Execute unit tests with a system keyspaces directory configured">1452<path id="all-test-classes-path">1453<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />1454</path>1455<property name="all-test-classes" refid="all-test-classes-path"/>1456<testhelper testdelegate="testlist-system-keyspace-directory" />1457</target>14581459<target name="msg-ser-gen-test" depends="maybe-build-test" description="Generates message serializations">1460<testmacro inputdir="${test.unit.src}"1461timeout="${test.timeout}" filter="**/SerializationsTest.java">1462<jvmarg value="-Dcassandra.test-serialization-writes=True"/>1463</testmacro>1464</target>14651466<target name="msg-ser-test" depends="maybe-build-test" description="Tests message serializations">1467<testmacro inputdir="${test.unit.src}" timeout="${test.timeout}"1468filter="**/SerializationsTest.java"/>1469</target>14701471<target name="msg-ser-test-7" depends="maybe-build-test" description="Generates message serializations">1472<testmacro inputdir="${test.unit.src}"1473timeout="${test.timeout}" filter="**/SerializationsTest.java">1474<jvmarg value="-Dcassandra.version=0.7"/>1475</testmacro>1476</target>14771478<target name="msg-ser-test-10" depends="maybe-build-test" description="Tests message serializations on 1.0 messages">1479<testmacro inputdir="${test.unit.src}"1480timeout="${test.timeout}" filter="**/SerializationsTest.java">1481<jvmarg value="-Dcassandra.version=1.0"/>1482</testmacro>1483</target>14841485<target name="test-burn" depends="maybe-build-test" description="Execute functional tests">1486<testmacro inputdir="${test.burn.src}"1487timeout="${test.burn.timeout}">1488</testmacro>1489</target>14901491<target name="long-test" depends="maybe-build-test" description="Execute functional tests">1492<testmacro inputdir="${test.long.src}"1493timeout="${test.long.timeout}">1494<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>1495<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1496</testmacro>1497</target>14981499<target name="test-memory" depends="maybe-build-test" description="Execute functional tests">1500<testmacro inputdir="${test.memory.src}"1501timeout="${test.memory.timeout}">1502<jvmarg value="-javaagent:${build.dir}/test/lib/jars/java-allocation-instrumenter-${allocation-instrumenter.version}.jar"/>1503</testmacro>1504</target>15051506<target name="cql-test" depends="maybe-build-test" description="Execute CQL tests">1507<sequential>1508<echo message="running CQL tests"/>1509<mkdir dir="${build.test.dir}/cassandra"/>1510<mkdir dir="${build.test.output.dir}"/>1511<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">1512<formatter type="brief" usefile="false"/>1513<jvmarg value="-Dstorage-config=${test.conf}"/>1514<jvmarg value="-Djava.awt.headless=true"/>1515<jvmarg value="-javaagent:${build.dir.lib}/jars/jamm-${jamm.version}.jar" />1516<jvmarg value="-ea"/>1517<jvmarg value="${jvm_xss}"/>1518<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>1519<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>1520<jvmarg value="-Dcassandra.skip_sync=true" />1521<classpath>1522<path refid="cassandra.classpath.test" />1523<pathelement location="${test.classes}"/>1524<pathelement location="${test.conf}"/>1525<fileset dir="${test.lib}">1526<include name="**/*.jar" />1527</fileset>1528</classpath>1529<batchtest todir="${build.test.output.dir}">1530<fileset dir="${test.unit.src}" includes="**/cql3/*Test.java">1531<contains text="CQLTester" casesensitive="yes"/>1532</fileset>1533</batchtest>1534</junit>1535<fail message="Some CQL test(s) failed.">1536<condition>1537<and>1538<isset property="testfailed"/>1539<not>1540<isset property="ant.test.failure.ignore"/>1541</not>1542</and>1543</condition>1544</fail>1545</sequential>1546</target>15471548<!-- Use this with an simple class name for test class, and an optional csv list of methods like this:1549ant cql-test-some -Dtest.name=ListsTest1550ant cql-test-some -Dtest.name=ListsTest -Dtest.methods=testPrecisionTime_getNext_simple1551-->1552<target name="cql-test-some" depends="maybe-build-test" description="Execute specific CQL tests" >1553<sequential>1554<echo message="running ${test.methods} tests from ${test.name}"/>1555<mkdir dir="${build.test.dir}/cassandra"/>1556<mkdir dir="${build.test.output.dir}"/>1557<junit fork="on" forkmode="once" failureproperty="testfailed" maxmemory="1024m" timeout="${test.timeout}">1558<formatter type="brief" usefile="false"/>1559<jvmarg value="-Dstorage-config=${test.conf}"/>1560<jvmarg value="-Djava.awt.headless=true"/>1561<jvmarg value="-javaagent:${build.dir.lib}/jars/jamm-${jamm.version}.jar" />1562<jvmarg value="-ea"/>1563<jvmarg value="${jvm_xss}"/>1564<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>1565<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>1566<jvmarg value="-Dcassandra.skip_sync=true" />1567<classpath>1568<path refid="cassandra.classpath.test" />1569<pathelement location="${test.classes}"/>1570<pathelement location="${test.conf}"/>1571<fileset dir="${test.lib}">1572<include name="**/*.jar" />1573</fileset>1574</classpath>1575<test unless:blank="${test.methods}" name="org.apache.cassandra.cql3.${test.name}" methods="${test.methods}" todir="${build.test.output.dir}"/>1576<test if:blank="${test.methods}" name="org.apache.cassandra.cql3.${test.name}" todir="${build.test.output.dir}"/>1577</junit>1578</sequential>1579</target>15801581<!-- Use JaCoCo ant extension without needing externally saved lib -->1582<target name="jacoco-init" depends="resolver-init">1583<typedef uri="antlib:org.jacoco.ant" classpathref="jacocoant.classpath"/>1584</target>15851586<target name="jacoco-merge" depends="jacoco-init">1587<jacoco:merge destfile="${jacoco.finalexecfile}" xmlns:jacoco="antlib:org.jacoco.ant">1588<fileset dir="${jacoco.export.dir}" includes="*.exec,**/*.exec"/>1589</jacoco:merge>1590</target>15911592<target name="jacoco-report" depends="jacoco-merge">1593<jacoco:report xmlns:jacoco="antlib:org.jacoco.ant">1594<executiondata>1595<file file="${jacoco.finalexecfile}" />1596</executiondata>1597<structure name="JaCoCo Cassandara Coverage Report">1598<classfiles>1599<fileset dir="${build.classes.main}">1600<include name="**/*.class"/>1601</fileset>1602</classfiles>1603<sourcefiles encoding="UTF-8">1604<dirset dir="${build.src}">1605<include name="java"/>1606<include name="gen-java"/>1607</dirset>1608</sourcefiles>1609</structure>1610<!-- to produce reports in different formats. -->1611<html destdir="${jacoco.export.dir}" />1612<csv destfile="${jacoco.export.dir}/report.csv" />1613<xml destfile="${jacoco.export.dir}/report.xml" />1614</jacoco:report>1615</target>16161617<target name="jacoco-cleanup" description="Destroy JaCoCo exec data and reports">1618<delete file="${jacoco.partialexecfile}"/>1619<delete dir="${jacoco.export.dir}"/>1620</target>16211622<target name="javadoc" depends="build" description="Create javadoc" unless="no-javadoc">1623<create-javadoc destdir="${javadoc.dir}">1624<filesets>1625<fileset dir="${build.src.java}" defaultexcludes="yes">1626<include name="org/apache/**/*.java"/>1627</fileset>1628</filesets>1629</create-javadoc>1630</target>16311632<!-- Run tests and reports errors and generates a junit report after -->1633<macrodef name="testmacro">1634<attribute name="inputdir" />1635<attribute name="timeout" default="${test.timeout}" />1636<attribute name="forkmode" default="perTest"/>1637<attribute name="showoutput" default="true"/>1638<element name="optjvmargs" implicit="true" optional="true" />1639<attribute name="filter" default="**/${test.name}.java"/>1640<attribute name="exclude" default="" />1641<attribute name="filelist" default="" />1642<attribute name="testtag" default=""/>16431644<sequential>1645<testmacrohelper inputdir="@{inputdir}" timeout="@{timeout}"1646forkmode="@{forkmode}" filter="@{filter}"1647exclude="@{exclude}" filelist="@{filelist}"1648testtag="@{testtag}" showoutput="false" >1649<optjvmargs/>1650</testmacrohelper>1651<fail message="Some test(s) failed.">1652<condition>1653<and>1654<isset property="testfailed"/>1655<not>1656<isset property="ant.test.failure.ignore"/>1657</not>1658</and>1659</condition>1660</fail>1661</sequential>1662</macrodef>16631664<target name="test" depends="maybe-build-test" description="Test Runner">1665<path id="all-test-classes-path">1666<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/distributed/test/UpgradeTest*.java" />1667</path>1668<property name="all-test-classes" refid="all-test-classes-path"/>1669<testhelper testdelegate="testlist"/>1670</target>16711672<!-- run a list of tests as provided in -Dtest.classlistfile (or default of 'testnames.txt')1673The class list file should be one test class per line, with the path starting after test/unit1674e.g. org/apache/cassandra/hints/HintMessageTest.java -->1675<target name="testclasslist" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1676<path id="all-test-classes-path">1677<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1678</path>1679<property name="all-test-classes" refid="all-test-classes-path"/>1680<testhelper testdelegate="testlist"/>1681</target>1682<target name="testclasslist-oa" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1683<path id="all-test-classes-path">1684<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1685</path>1686<property name="all-test-classes" refid="all-test-classes-path"/>1687<testhelper testdelegate="testlist-oa"/>1688</target>1689<target name="testclasslist-compression" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1690<path id="all-test-classes-path">1691<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1692</path>1693<property name="all-test-classes" refid="all-test-classes-path"/>1694<testhelper testdelegate="testlist-compression"/>1695</target>1696<target name="testclasslist-latest" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1697<path id="all-test-classes-path">1698<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1699</path>1700<property name="all-test-classes" refid="all-test-classes-path"/>1701<testhelper testdelegate="testlist-latest"/>1702</target>1703<target name="testclasslist-cdc" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1704<path id="all-test-classes-path">1705<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1706</path>1707<property name="all-test-classes" refid="all-test-classes-path"/>1708<testhelper testdelegate="testlist-cdc"/>1709</target>1710<target name="testclasslist-system-keyspace-directory" depends="maybe-build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">1711<path id="all-test-classes-path">1712<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>1713</path>1714<property name="all-test-classes" refid="all-test-classes-path"/>1715<testhelper testdelegate="testlist-system-keyspace-directory"/>1716</target>17171718<!-- Build a self-contained jar for e.g. remote execution; not currently used for running burn tests with this build script -->1719<target name="burn-test-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">1720<jar jarfile="${build.dir}/burntest.jar">1721<zipgroupfileset dir="${build.lib}" includes="*.jar" excludes="META-INF/*.SF"/>1722<fileset dir="${build.classes.main}"/>1723<fileset dir="${test.classes}"/>1724<fileset dir="${test.conf}" excludes="logback*.xml"/>1725<fileset dir="${basedir}/conf" includes="logback*.xml"/>1726<zipgroupfileset dir="${build.dir.lib}/jars">1727<include name="junit*.jar"/>1728</zipgroupfileset>1729</jar>1730</target>17311732<target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">1733<delete dir="${build.dir}/dtest/**" quiet="true"/>17341735<copy todir="${build.dir}/dtest" quiet="true" overwrite="false">1736<fileset dir="${build.classes.main}"/>1737<fileset dir="${test.classes}"/>1738<fileset dir="${test.conf}"/>1739</copy>1740<unzip dest="${build.dir}/dtest" overwrite="false">1741<fileset dir="${test.lib}/jars" includes="jimfs-1.1.jar,dtest-api-*.jar,asm-*.jar,javassist-*.jar,reflections-*.jar,semver4j-*.jar"/>1742<patternset excludes="META-INF/license/**"/>1743</unzip>1744<unzip dest="${build.dir}/dtest" overwrite="false">1745<fileset dir="${build.dir.lib}/jars" includes="*.jar"/>1746<patternset excludes="META-INF/license/**"/>1747</unzip>17481749<jar jarfile="${build.dir}/dtest-${base.version}.jar" duplicate="preserve">1750<fileset dir="${build.dir}/dtest">1751<exclude name="META-INF/*.SF"/>1752<exclude name="META-INF/*.DSA"/>1753<exclude name="META-INF/*.RSA"/>1754<exclude name="META-INF/license/**"/>1755</fileset>1756</jar>17571758<delete dir="${build.dir}/dtest" quiet="true"/>1759</target>17601761<target name="test-jvm-dtest" depends="maybe-build-test" description="Execute in-jvm dtests">1762<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/test/${test.name}.java">1763<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>1764<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1765<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1766<jvmarg value="-Dcassandra.skip_sync=true" />1767<!-- total memory must fit within the pod constraints, see comments in .jenkins/Jenkinsfile and dind's container resourceRequestMemory in .jenkins/k8s/jenkins-deployment.yaml -->1768<jvmarg value="-Xmx8G"/>1769</testmacro>1770</target>17711772<target name="test-jvm-dtest-latest" depends="maybe-build-test" description="Execute in-jvm dtests with latest configuration">1773<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/test/${test.name}.java">1774<jvmarg value="-Djvm_dtests.latest=true"/>1775<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>1776<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1777<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1778<jvmarg value="-Dcassandra.skip_sync=true" />1779</testmacro>1780</target>17811782<property name="simulator.asm.print" value="none"/> <!-- Supports: NONE, CLASS_SUMMARY, CLASS_DETAIL, METHOD_SUMMARY, METHOD_DETAIL, ASM; see org.apache.cassandra.simulator.asm.MethodLogger.Level -->1783<target name="test-simulator-dtest" depends="maybe-build-test" description="Execute simulator dtests">1784<testmacro inputdir="${test.simulator-test.src}" timeout="${test.simulation.timeout}" forkmode="perTest" showoutput="true" filter="**/test/${test.name}.java">1785<jvmarg value="-Dlogback.configurationFile=test/conf/logback-simulator.xml"/>1786<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1787<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1788<jvmarg value="-Dcassandra.skip_sync=true" />1789<jvmarg value="-Dcassandra.debugrefcount=false"/>1790<jvmarg value="-Dcassandra.test.simulator.determinismcheck=strict"/>1791<jvmarg value="-Dcassandra.test.simulator.print_asm=${simulator.asm.print}" />1792<!-- Support Simulator Tests -->1793<jvmarg line="-javaagent:${test.lib}/jars/simulator-asm.jar"/>1794<jvmarg line="-Xbootclasspath/a:${test.lib}/jars/simulator-bootstrap.jar"/>1795<jvmarg line="-XX:ActiveProcessorCount=4"/>1796<jvmarg line="-XX:-TieredCompilation"/>1797<jvmarg line="-XX:-BackgroundCompilation"/>1798<jvmarg line="-XX:CICompilerCount=1"/>1799<jvmarg line="-XX:Tier4CompileThreshold=1000"/>1800<jvmarg line="-XX:ReservedCodeCacheSize=256M"/>1801<!-- total memory must fit within the pod constraints, see comments in .jenkins/Jenkinsfile and dind's container resourceRequestMemory in .jenkins/k8s/jenkins-deployment.yaml -->1802<jvmarg line="-Xmx8G"/>1803</testmacro>1804</target>18051806<!-- To run them you'll need to:1807- `ant dtest-jar` on each version involved, including your current feature branch1808- copy the build/dtest-*.jar for each version into your feature branch build folder1809- You can use 'test-jvm-dtest-some' if you only need to run one -->1810<target name="test-jvm-upgrade-dtest" depends="maybe-build-test" description="Execute in-jvm dtests">1811<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true" filter="**/upgrade/*Test.java">1812<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>1813<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1814<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1815<jvmarg value="-Dcassandra.skip_sync=true" />1816<!-- total memory must fit within the pod constraints, see comments in .jenkins/Jenkinsfile and dind's container resourceRequestMemory in .jenkins/k8s/jenkins-deployment.yaml -->1817<jvmarg value="-Xmx8G"/>1818</testmacro>1819</target>18201821<!-- Use this with an FQDN for test class or upgrade test, and an optional csv list of methods like this:1822ant test-jvm-dtest-some -Dtest.name=org.apache.cassandra.distributed.test.ResourceLeakTest1823ant test-jvm-dtest-some -Dtest.name=org.apache.cassandra.distributed.test.ResourceLeakTest -Dtest.methods=looperTest1824-->1825<target name="test-jvm-dtest-some" depends="maybe-build-test" description="Execute some in-jvm dtests">1826<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true">1827<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>1828<test if:blank="${test.methods}" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>1829<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>1830<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1831<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1832<jvmarg value="-Dcassandra.skip_sync=true" />1833<!-- total memory must fit within the pod constraints, see comments in .jenkins/Jenkinsfile and dind's container resourceRequestMemory in .jenkins/k8s/jenkins-deployment.yaml -->1834<jvmarg value="-Xmx8G"/>1835</testmacro>1836</target>18371838<target name="test-jvm-dtest-latest-some" depends="maybe-build-test" description="Execute some in-jvm dtests with latest configuration">1839<testmacro inputdir="${test.distributed.src}" timeout="${test.distributed.timeout}" forkmode="once" showoutput="true">1840<test unless:blank="${test.methods}" name="${test.name}" methods="${test.methods}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}-${test.methods}"/>1841<test if:blank="${test.methods}" name="${test.name}" todir="${build.test.output.dir}/" outfile="TEST-${test.name}"/>1842<jvmarg value="-Djvm_dtests.latest=true"/>1843<jvmarg value="-Dlogback.configurationFile=test/conf/logback-dtest.xml"/>1844<jvmarg value="-Dcassandra.ring_delay_ms=10000"/>1845<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>1846<jvmarg value="-Dcassandra.skip_sync=true" />1847</testmacro>1848</target>18491850<target name="generate-test-report" description="Merge all unit xml files into one, generate html pages, and print summary test numbers">1851<echo message="Generating Test Summary for test files found under ${build.test.output.dir}" />1852<mkdir dir="${build.test.report.dir}/unitTestReport"/>1853<junitreport todir="${build.test.report.dir}/unitTestReport">1854<fileset dir="${build.test.output.dir}">1855<include name="**/TEST-*.xml"/>1856<include name="**/cqlshlib*.xml"/>1857<include name="**/nosetests*.xml"/>1858</fileset>1859<report todir="${build.test.report.dir}/unitTestReport/html" unless:true="${print-summary.skip}" />1860</junitreport>1861<!-- concat the report through a filter chain to extract a single line summary -->1862<concat unless:true="${print-summary.skip}">1863<fileset file="${build.test.report.dir}/unitTestReport/html/overview-summary.html" />1864<filterchain>1865<linecontainsregexp>1866<regexp pattern='title="Display all tests"' />1867</linecontainsregexp>1868<tokenfilter>1869<!-- escaped values of < and > are ">" and "<" -->1870<replaceregex pattern='.*all tests.*>(\d+)<.*all failures.*>(\d+)<.*all errors.*>(\d+)<.*all skipped test.*>(\d+)<.*$' replace="[Test Summary] Run: \1, Failed: \2, Errors: \3, Skipped: \4" />1871</tokenfilter>1872</filterchain>1873</concat>1874</target>18751876<!-- run arbitrary mains in tests, for example to run the long running memory tests with lots of memory pressure1877ant run-main -Dmainclass=org.apache.cassandra.utils.memory.LongBufferPoolTest -Dvmargs="-Xmx30m -XX:-UseGCOverheadLimit"1878-->1879<target name="run-main" depends="maybe-build-test">1880<property name="mainclass" value="" />1881<property name="vmargs" value="" />1882<property name="args" value="" />1883<java classname="${mainclass}"1884fork="true"1885failonerror="true">1886<jvmarg value="-server" />1887<jvmarg value="-ea" />1888<jvmarg line="${vmargs}" />1889<arg line="${args}" />1890<classpath>1891<path refid="cassandra.classpath" />1892<pathelement location="${test.classes}"/>1893<pathelement location="${test.conf}"/>1894<fileset dir="${test.lib}">1895asm-<include name="**/*.jar" />1896</fileset>1897</classpath>1898</java>1899</target>19001901<target name="_maybe_update_idea_to_java11plus" depends="init">1902<replace file="${eclipse.project.name}.iml" token="JDK_11" value="JDK_${ant.java.version}"/>1903<replace file=".idea/misc.xml" token="JDK_11" value="JDK_${ant.java.version}"/>1904<replace file=".idea/misc.xml" token="11" value="${ant.java.version}"/>1905<replaceregexp file=".idea/workspace.xml"1906match="name="VM_PARAMETERS" value="(.*)"1907replace="name="VM_PARAMETERS" value="\1 ${java-jvmargs} ${_std-test-jvmargs}"1908byline="true"/>19091910<echo file=".idea/compiler.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>1911<project version="4">1912<component name="JavacSettings">1913<option name="ADDITIONAL_OPTIONS_STRING" value="--add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED1914--add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED1915--add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED1916--add-exports java.base/jdk.internal.ref=ALL-UNNAMED1917--add-exports java.base/sun.nio.ch=ALL-UNNAMED" />1918</component>1919</project>]]></echo>1920</target>19211922<!-- Generate IDEA project description files -->1923<target name="generate-idea-files" depends="init,resolver-dist-lib,gen-cql3-grammar,generate-jflex-java,_createVersionPropFile" description="Generate IDEA files">1924<delete dir=".idea"/>1925<delete file="${eclipse.project.name}.iml"/>1926<mkdir dir=".idea"/>1927<mkdir dir=".idea/libraries"/>1928<copy todir=".idea" overwrite="true">1929<fileset dir="ide/idea"/>1930</copy>1931<replace file=".idea/workspace.xml" token="trunk" value="${eclipse.project.name}"/>1932<replace file=".idea/workspace.xml" token="-Dcassandra.use_nix_recursive_delete=true" value="-Dcassandra.use_nix_recursive_delete=${cassandra.use_nix_recursive_delete}"/>1933<copy tofile="${eclipse.project.name}.iml" file="ide/idea-iml-file.xml"/>1934<echo file=".idea/.name">Apache Cassandra ${eclipse.project.name}</echo>1935<echo file=".idea/modules.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>1936<project version="4">1937<component name="ProjectModuleManager">1938<modules>1939<module fileurl="file://$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" filepath="$PROJECT_DIR$/]]>${eclipse.project.name}<![CDATA[.iml" />1940</modules>1941</component>1942</project>]]></echo>1943<antcall target="_maybe_update_idea_to_java11plus"/>1944<echo>1945IDE configuration in .idea/ updated for use with JDK${ant.java.version}.19461947In IntelliJ verify that the SDK is ${ant.java.version}, and its path is valid.1948This can be verified in 'Project Structure/Project Setting/Project' and 'Project Structure/Platform Setting/SDKs'.1949</echo>1950</target>19511952<!-- Generate Eclipse project description files -->1953<target name="generate-eclipse-files" depends="build-test" description="Generate eclipse files">1954<echo file=".project"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>1955<projectDescription>1956<name>${eclipse.project.name}</name>1957<comment></comment>1958<projects>1959</projects>1960<buildSpec>1961<buildCommand>1962<name>org.eclipse.jdt.core.javabuilder</name>1963</buildCommand>1964</buildSpec>1965<natures>1966<nature>org.eclipse.jdt.core.javanature</nature>1967</natures>1968</projectDescription>]]>1969</echo>1970<path id="eclipse-project-libs-path">1971<fileset dir="lib">1972<include name="**/*.jar" />1973</fileset>1974<fileset dir="${build.dir.lib}/jars">1975<include name="**/*.jar" />1976</fileset>1977<fileset dir="${test.lib}/jars">1978<include name="**/*.jar" />1979</fileset>1980</path>1981<pathconvert property="eclipse-libs-list" refid="eclipse-project-libs-path" pathsep="${line.separator}">1982<mapper>1983<regexpmapper from="^(.*)$$" to='<classpathentry kind="lib" path="\1" />'/>1984</mapper>1985</pathconvert>1986<property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>1987<echo file=".classpath"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>1988<classpath>1989<classpathentry kind="src" path="src/java"/>1990<classpathentry kind="src" path="src/resources"/>1991<classpathentry kind="src" path="src/gen-java"/>1992<classpathentry kind="src" path="conf" including="hotspot_compiler"/>1993<classpathentry kind="src" output="${test.classes}" path="test/unit"/>1994<classpathentry kind="src" output="${test.classes}" path="test/long"/>1995<classpathentry kind="src" output="${test.classes}" path="test/distributed"/>1996<classpathentry kind="src" output="${test.classes}" path="test/simulator/asm"/>1997<classpathentry kind="src" output="${test.classes}" path="test/simulator/main"/>1998<classpathentry kind="src" output="${test.classes}" path="test/resources" />1999<classpathentry kind="src" path="tools/stress/src"/>2000<classpathentry kind="src" path="tools/fqltool/src"/>2001<classpathentry kind="src" output="build/test/stress-classes" path="tools/stress/test/unit" />2002<classpathentry kind="src" output="build/test/fqltool-classes" path="tools/fqltool/test/unit" />2003<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>2004<classpathentry kind="output" path="build/classes/eclipse"/>2005<classpathentry kind="lib" path="test/conf"/>2006<classpathentry kind="lib" path="${java.home}/../lib/tools.jar"/>2007${eclipse-libs-list}2008</classpath>2009]]>2010</echo>2011<taskdef name="echoeclipseprojectslibs" classname="org.apache.cassandra.anttasks.EchoEclipseProjectLibs" classpath="${test.classes}">2012<classpath>2013<path refid="cassandra.classpath"/>2014<path refid="cassandra.classpath.test"/>2015</classpath>2016</taskdef>2017<mkdir dir=".settings" />2018</target>20192020<pathconvert property="eclipse.project.name">2021<path path="${basedir}" />2022<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes" />2023</pathconvert>20242025<!-- Clean Eclipse project description files -->2026<target name="clean-eclipse-files">2027<delete file=".project" />2028<delete file=".classpath" />2029<delete dir=".settings" />2030<delete dir=".externalToolBuilders" />2031<delete dir="build/eclipse-classes" />2032</target>20332034<!-- Empty fake task until we remove it from Jenkins. eclipse-warnings removed in favor of using CheckerFramework2035For more information - CASSANDRA-18190 and CASSANDDRA-18239-->2036<target name="eclipse-warnings" depends="build" description="Run eclipse compiler code analysis" if="java.version.8"> </target>20372038<!-- Installs artifacts to local Maven repository -->2039<target name="mvn-install"2040depends="jar,sources-jar,javadoc-jar"2041description="Installs the artifacts in the Maven Local Repository">20422043<!-- the parent -->2044<install pomFile="${build.dir}/${final.name}-parent.pom"2045file="${build.dir}/${final.name}-parent.pom"2046packaging="pom"/>20472048<!-- the cassandra-all jar -->2049<install pomFile="${build.dir}/${final.name}.pom"2050file="${build.dir}/${final.name}.jar"/>2051<install pomFile="${build.dir}/${final.name}.pom"2052file="${build.dir}/${final.name}-sources.jar"2053classifier="sources"/>2054<install pomFile="${build.dir}/${final.name}.pom"2055file="${build.dir}/${final.name}-javadoc.jar"2056classifier="javadoc"/>2057</target>20582059<!-- Publish artifacts to remote Maven repository -->2060<target name="publish"2061depends="mvn-install,artifacts"2062description="Publishes the artifacts to the Maven repository">20632064<!-- the parent -->2065<deploy pomFile="${build.dir}/${final.name}-parent.pom"2066file="${build.dir}/${final.name}-parent.pom"2067packaging="pom"/>20682069<!-- the cassandra-all jar -->2070<deploy pomFile="${build.dir}/${final.name}.pom"2071file="${build.dir}/${final.name}.jar"/>2072<deploy pomFile="${build.dir}/${final.name}.pom"2073file="${build.dir}/${final.name}-sources.jar"2074classifier="sources"/>2075<deploy pomFile="${build.dir}/${final.name}.pom"2076file="${build.dir}/${final.name}-javadoc.jar"2077classifier="javadoc"/>20782079<!-- the distribution -->2080<sign-dist file="${build.dir}/${final.name}-bin.tar.gz" />2081<sign-dist file="${build.dir}/${final.name}-src.tar.gz" />20822083</target>20842085<import file="${build.helpers.dir}/build-resolver.xml"/>2086<import file="${build.helpers.dir}/build-rat.xml"/>2087<import file="${build.helpers.dir}/build-owasp.xml"/>2088<import file="${build.helpers.dir}/build-git.xml"/>2089<import file="${build.helpers.dir}/build-checkstyle.xml"/>2090<import file="${build.helpers.dir}/build-cqlsh.xml"/>2091<import file="${build.helpers.dir}/build-bench.xml"/>2092<import file="${build.helpers.dir}/build-sonar.xml"/>2093</project>209420952096