Changeset: cccaeb65a5d6 for monetdb-java URL: https://dev.monetdb.org/hg/monetdb-java/rev/cccaeb65a5d6 Added Files: build_jre21.xml Modified Files: Makefile Branch: default Log Message:
Extend Makefile with target: jre21jars Note this requires that your OS has jdk21 installed and be the default jvm. diffs (truncated from 385 to 300 lines): diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -7,6 +7,11 @@ jre17jars: src/main/java/org/monetdb/jdb ant -f build_jre17.xml distjdbc rm -rf build +jre21jars: src/main/java/org/monetdb/jdbc/MonetVersion.java + rm -rf build + ant -f build_jre21.xml distjdbc + rm -rf build + test: all echo banana cd tests; ant -f build.xml test diff --git a/build_jre21.xml b/build_jre21.xml new file mode 100644 --- /dev/null +++ b/build_jre21.xml @@ -0,0 +1,365 @@ +<?xml version="1.0"?><!-- vim:set ts=2 sw=2 expandtab: --> + +<!-- +SPDX-License-Identifier: MPL-2.0 + +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 2024 MonetDB Foundation; +Copyright August 2008 - 2023 MonetDB B.V.; +Copyright 1997 - July 2008 CWI. +--> + +<!-- + Build file to allow ant (http://ant.apache.org/) to be used + to build the MonetDB Java packages, such as the JDBC driver. +--> + +<project name="MonetDB_Java_Drivers" default="default" basedir="."> + + + <!-- set global properties for this build --> + <property name="srcdir" value="src/main/java" /> + <property name="libdir" value="lib" /> + <property name="jardir" value="jars" /> + <property name="builddir" value="build" /> + <property name="docdir" value="doc" /> + <property name="jdbc-package" value="org/monetdb/jdbc" /> + <property name="mcl-package" value="org/monetdb/mcl" /> + <property name="client-package" value="org/monetdb/client" /> + <property name="util-package" value="org/monetdb/util" /> + <property name="mero-control-package" value="org/monetdb/merovingian" /> + + <property file="build.local.properties" /> + <property file="build.properties" /> + + <!-- + Update: cross-compile for JVM 8 (=1.8), profile compact2 + 2020-02-12, martin.van.dint...@monetdbsolutions.com + + Update: cross-compile for JVM 17, profile compact2 + 2023-03-08, martin.van.dint...@monetdbsolutions.com + + Update: cross-compile for JVM 21, profile compact2 + 2024-05-30, martin.van.dint...@monetdbsolutions.com + --> + + <property name="jvm.version" value="21" /> + <property name="jre.version" value="jre21" /> + <property name="javac.flags" value="-source 8" /> + <property name="javac.flags" value="-target 21" /> + <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="jdbcclient-jar" + value="${jardir}/jdbcclient.${jre.version}.jar" /> + <property name="jmonetdb-jar" + value="${jardir}/jmonetdb.${jre.version}.jar" /> + <property name="mero-control-jar" + value="${jardir}/merocontrol.${jre.version}.jar" /> + + <!-- full target --> + <target name="all"> + <antcall target="distjdbc" /> + <antcall target="distmerocontrol" /> + <antcall target="doc" /> + </target> + + <target name="distall"> + <antcall target="distjdbc" /> + <antcall target="distmerocontrol" /> + </target> + + <target name="default"> + <antcall target="jar_jdbcclient" /> + <antcall target="jar_jmonetdb" /> + </target> + + <target name="distjdbc"> + <antcall target="jar_jdbc" /> + <antcall target="jar_jdbcclient" /> + </target> + + <target name="distmerocontrol"> + <antcall target="jar_mero_control" /> + </target> + + <!-- jar targets --> + <target name="jar_jdbc" depends="compile_mcl,compile_jdbc" + unless="uptodate.jdbc-jar"> + <echo file="${builddir}/META-INF/services/java.sql.Driver" append="false">org.monetdb.jdbc.MonetDriver</echo> + <jar jarfile="${jdbc-jar}"> + <fileset dir="${builddir}"> + <include name="META-INF/services/java.sql.Driver" /> + <include name="${jdbc-package}/**/*.class" /> + <include name="${mcl-package}/**/*.class" /> + <include name="${util-package}/FileTransferHandler.class" /> + </fileset> + </jar> + </target> + + <target name="jar_client" depends="compile_util,compile_client"> + <jar jarfile="${jardir}/monetdb-clients.jar"> + <fileset dir="${builddir}"> + <include name="${client-package}/**/*.class" /> + <include name="${util-package}/**/*.class" /> + </fileset> + </jar> + </target> + + <!-- a convenience jar of jdbcclient command line program plus JDBC driver --> + <target name="jar_jdbcclient" + depends="compile_mcl,compile_jdbc,compile_util,compile_client" + unless="uptodate.jdbcclient-jar"> + <echo message="Building jdbcclient + JDBC driver convenience jar" /> + <jar jarfile="${jdbcclient-jar}"> + <fileset dir="${builddir}"> + <include name="${client-package}/**/*.class" /> + <include name="${util-package}/**/*.class" /> + <include name="META-INF/services/java.sql.Driver" /> + <include name="${jdbc-package}/**/*.class" /> + <include name="${mcl-package}/**/*.class" /> + </fileset> + <manifest> + <attribute name="Built-By" value="${user.name}" /> + <attribute name="Main-Class" value="org.monetdb.client.JdbcClient" /> + </manifest> + </jar> + </target> + + <!-- a convenience jar of MeroControl plus the JMonetDB utility --> + <target name="jar_jmonetdb" + depends="compile_mcl,compile_util,compile_mero_control,compile_client" + unless="uptodate.jmonetdb-jar"> + <echo message="Building MeroControl + JmonetDB convenience jar" /> + <jar jarfile="${jmonetdb-jar}"> + <fileset dir="${builddir}"> + <include name="${mero-control-package}/**/*.class" /> + <include name="${mcl-package}/**/*.class" /> + <include name="${client-package}/JMonetDB.class" /> + <include name="${util-package}/**/*.class" /> + </fileset> + <manifest> + <attribute name="Built-By" value="${user.name}" /> + <attribute name="Main-Class" value="org.monetdb.client.JMonetDB" /> + </manifest> + </jar> + </target> + + <target name="jar_mero_control" + depends="compile_mcl,compile_mero_control"> + <jar jarfile="${mero-control-jar}"> + <fileset dir="${builddir}"> + <include name="${mero-control-package}/**/*.class" /> + </fileset> + <manifest> + <attribute name="Built-By" value="${user.name}" /> + </manifest> + </jar> + </target> + + <!-- compile targets --> + <target name="compile_jdbc" depends="prepare,driver"> + <echo message="Compiling JDBC driver" /> + <javac + classpath="${srcdir}" + destdir="${builddir}" + debug="${debug}" + optimize="${optimize}" + includeantruntime="false" + source="${jvm.version}" + target="${jvm.version}" + > + <src path="${srcdir}" /> + <include name="${jdbc-package}/**/*.java" /> + <include name="${util-package}/FileTransferHandler.java" /> + <compilerarg line="${javac.flags}" /> + </javac> + </target> + + <target name="compile_mcl" depends="prepare"> + <echo message="Compiling MCL" /> + <javac + classpath="${srcdir}" + srcdir="${srcdir}" + destdir="${builddir}" + debug="${debug}" + optimize="${optimize}" + includeantruntime="false" + source="${jvm.version}" + target="${jvm.version}" + > + <include name="${mcl-package}/**/*.java" /> + <compilerarg line="${javac.flags}" /> + </javac> + </target> + + <target name="compile_client" depends="prepare"> + <echo message="Compiling Clients" /> + <javac + classpath="${srcdir}" + srcdir="${srcdir}" + destdir="${builddir}" + debug="${debug}" + optimize="${optimize}" + includeantruntime="false" + source="${jvm.version}" + target="${jvm.version}" + > + <include name="${client-package}/**/*.java" /> + <compilerarg line="${javac.flags}" /> + </javac> + </target> + + <target name="compile_util" depends="prepare"> + <echo message="Compiling Utilities" /> + <javac + classpath="${srcdir}" + srcdir="${srcdir}" + destdir="${builddir}" + debug="${debug}" + optimize="${optimize}" + includeantruntime="false" + source="${jvm.version}" + target="${jvm.version}" + > + <include name="${util-package}/**/*.java" /> + <compilerarg line="${javac.flags}" /> + </javac> + </target> + + <target name="compile_mero_control" depends="prepare"> + <echo message="Compiling Merovingian Control library" /> + <javac + classpath="${srcdir}" + srcdir="${srcdir}" + destdir="${builddir}" + debug="${debug}" + optimize="${optimize}" + includeantruntime="false" + source="${jvm.version}" + target="${jvm.version}" + > + <include name="${mero-control-package}/**/*.java" /> + <compilerarg line="${javac.flags}" /> + </javac> + </target> + + <!-- + This generates MonetVersion.java from its ".java.in" equivalent. + It's required for importing the driver version properties. + --> + <target name="driver" depends="prepare" unless="uptodate.drivers"> + <tstamp> + <format property="TODAY" pattern="yyyyMMdd" /> + </tstamp> + + <!-- Some defaults --> + <filter token="JDBC_MAJOR" value="${JDBC_MAJOR}" /> + <filter token="JDBC_MINOR" value="${JDBC_MINOR}" /> + <filter token="JDBC_VER_SUFFIX" value="${JDBC_VER_SUFFIX} ${TODAY}" /> + + <fail unless="JDBC_MAJOR" message="'JDBC_MAJOR' undefined. Please follow the directions in build.properties."/> + <fail unless="JDBC_MINOR" message="'JDBC_MINOR' undefined. Please follow the directions in build.properties."/> + <fail unless="JDBC_VER_SUFFIX" message="'JDBC_VER_SUFFIX' undefined. Please follow the directions in build.properties."/> + + <!-- now copy and filter the file --> + <copy file="${srcdir}/${jdbc-package}/MonetVersion.java.in" + overwrite="true" + tofile="${srcdir}/${jdbc-package}/MonetVersion.java" + filtering="yes" /> + + <echo message="Configured build for the ${JDBC_MAJOR}.${JDBC_MINOR} (${JDBC_VER_SUFFIX}) edition driver" /> + </target> + + <!-- Prepares the build directory and sets some variables --> + <!-- checks whether regeneration of files is necessary --> _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org