Mercurial > hg > monetdb-java
view tests/build.xml @ 455:05592cb939bf
Explicitly set source 8 and target 8 flags for javac compiler.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 11 Mar 2021 19:20:00 +0100 (2021-03-11) |
parents | 52030d17ab9a |
children | e84b3cbd8b57 |
line wrap: on
line source
<?xml version="1.0"?><!-- vim:set ts=2 sw=2 expandtab: --> <!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V. --> <!-- Build file to allow ant (http://ant.apache.org/) to be used to build and run the tests --> <project name="JDBCTests" default="compile" basedir="."> <property file="build.local.properties" /> <property file="build.properties" /> <property file="../build.properties" /> <!-- included for version --> <!-- set global properties for this build --> <property name="srcdir" value="." /> <property name="builddir" value="build" /> <property name="jardir" value="../jars" /> <property name="jvm.version" value="8" /> <property name="jre.version" value="jre8" /> <property name="javac.flags" value="-source 8" /> <property name="javac.flags" value="-target 8" /> <property name="javac.flags" value="-profile compact2" /> <property name="javac.flags" value="-Xlint" /> <property name="jdbc_jar" value="${jardir}/monetdb-jdbc-${JDBC_MAJOR}.${JDBC_MINOR}.${jre.version}.jar" /> <property name="jdbc_url" value="jdbc:monetdb://localhost/?user=monetdb&password=monetdb${debug}" /> <property name="jdbctests-jar" value="${jardir}/jdbctests.jar" /> <!-- Prepares the build directory --> <target name="prepare"> <mkdir dir="${builddir}" /> </target> <!-- Compiles the tests --> <target name="compile" depends="prepare,jdbc"> <echo message="Compiling JDBC tests" /> <javac srcdir="${srcdir}" destdir="${builddir}" debug="false" optimize="false" includeantruntime="false" source="${jvm.version}" target="${jvm.version}" > <include name="**/*.java" /> <compilerarg line="${javac.flags}" /> <classpath> <pathelement path="${srcdir}" /> <pathelement path="${jdbc_jar}" /> </classpath> </javac> </target> <!-- a convenience jar collectin all JDBC tests --> <target name="jar_jdbctests" depends="compile" unless="uptodate.jdbctests-jar"> <echo message="Building JDBC tests convenience jar" /> <jar jarfile="${jdbctests-jar}"> <fileset dir="${builddir}"> <include name="JDBC_API_Tester.class" /> </fileset> </jar> </target> <!-- makes sure the jdbc driver is compiled --> <target name="jdbc" depends="find_driver" unless="have_driver"> <ant antfile="build.xml" dir=".." inheritAll="false" target="jar_jdbc" /> </target> <target name="find_driver"> <condition property="have_driver"> <and> <available classname="org.monetdb.jdbc.MonetDriver"> <classpath> <pathelement path="${jdbc_jar}" /> </classpath> </available> </and> </condition> </target> <!-- This target removes the build directory --> <target name="clean"> <delete quiet="true" dir="${builddir}" /> </target> <!-- Run tests --> <target name="test"> <antcall target="JDBC_API_Tester" /> </target> <target name="test_class" depends="compile,jdbc"> <echo message="Testing class ${test.class}" /> <java classname="${test.class}" failonerror="true"> <classpath> <pathelement path="${builddir}" /> <pathelement path="${jdbc_jar}" /> </classpath> <arg value="${jdbc_url}" /> </java> </target> <!-- convenience targets for the outside caller to specify which test(s) should be run --> <target name="JDBC_API_Tester"> <antcall target="test_class"> <param name="test.class" value="JDBC_API_Tester" /> </antcall> </target> </project>