Changeset: b6383d05216d for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/b6383d05216d
Added Files:
        src/main/resources/META-INF/release.txt
Removed Files:
        release.txt
        version.sh
Modified Files:
        pom.xml
Branch: mvn
Log Message:

Generate release.txt instead of patching it during release


diffs (136 lines):

diff --git a/pom.xml b/pom.xml
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,8 @@
         <maven.compiler.target>8</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <build-timestamp>${maven.build.timestamp}</build-timestamp>
+        <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
     </properties>
 
 
@@ -71,9 +73,8 @@
 
     <build>
 
-        <!-- insert the version number in MonetDriver.properties
-             so MonetDriver.class can determine its version number -->
         <resources>
+            <!-- Insert version number in MonetDriver.properties -->
             <resource>
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
diff --git a/release.txt b/src/main/resources/META-INF/release.txt
rename from release.txt
rename to src/main/resources/META-INF/release.txt
--- a/release.txt
+++ b/src/main/resources/META-INF/release.txt
@@ -1,8 +1,8 @@
 RELEASE INFO
 ============
 
-MonetDB JDBC driver version 12.2
-Release date: 2026-01-08
+MonetDB JDBC driver version ${project.version}
+Release date: ${build-timestamp}
 
 The Java Database Connectivity (JDBC) API provides universal data access from
 the Java programming language.
diff --git a/version.sh b/version.sh
deleted file mode 100755
--- a/version.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env bash
-
-# 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 - 2026 MonetDB Foundation;
-# Copyright August 2008 - 2023 MonetDB B.V.;
-# Copyright 1997 - July 2008 CWI.
-
-if [[ -z $1 ]] ; then
-       echo "Usage: $0 [-w] <(major|minor)=newversion> [...]"
-       echo "where -w activates actual write of changes"
-       exit -1
-fi
-
-PROPERTIES='build.properties'
-
-get_value() {
-       local tmp=$(grep -E "^$*=" ${PROPERTIES})
-       echo ${tmp#*=}
-}
-
-escape_value() {
-       echo "$*" | sed -e 's/\*/\\*/g' -e 's/\./\\./g'
-}
-
-patch="cat"
-
-# get rid of the script name
-case $1 in
-       -w)
-               patch="patch -p0";
-               shift
-               ;;
-esac
-
-CUR_MAJOR=$(eval "get_value 'JDBC_MAJOR'")
-CUR_MINOR=$(eval "get_value 'JDBC_MINOR'")
-
-NEW_MAJOR=${CUR_MAJOR}
-NEW_MINOR=${CUR_MINOR}
-
-ESC_MAJOR=$(escape_value ${CUR_MAJOR})
-ESC_MINOR=$(escape_value ${CUR_MINOR})
-
-for param in $* ; do
-       arg=${param%%=*}
-       val=${param#*=}
-       num=$(echo ${val} | grep -E '[0-9]+' -o | head -n1)
-       case ${arg} in
-       major)
-               if [[ -z ${num} ]] ; then
-                       echo "major needs a numeric argument!";
-                       exit -1
-               fi
-               NEW_MAJOR=${num}
-               ;;
-       minor)
-               if [[ -z ${num} ]] ; then
-                       echo "minor needs a numeric argument!";
-                       exit -1
-               fi
-               NEW_MINOR=${num}
-               ;;
-       esac
-done
-
-echo "Current version: ${CUR_MAJOR}.${CUR_MINOR}"
-echo "New version:     ${NEW_MAJOR}.${NEW_MINOR}"
-
-diff="diff -Naur"
-
-file="release.txt"
-sed \
-       -e "s|version ${ESC_MAJOR}\.${ESC_MINOR}|version 
${NEW_MAJOR}.${NEW_MINOR}|g" \
-       -e "s|JDBC-${ESC_MAJOR}\.${ESC_MINOR}|JDBC-${NEW_MAJOR}.${NEW_MINOR}|g" 
\
-       -e "s|Release date: 20[0-9][0-9]-[01][0-9]-[0-3][0-9]|Release date: 
`date +%F`|" \
-       ${file} | ${diff} ${file} - | ${patch}
-
-file="build.properties"
-sed \
-       -e "s|JDBC_MAJOR=${ESC_MAJOR}|JDBC_MAJOR=${NEW_MAJOR}|g" \
-       -e "s|JDBC_MINOR=${ESC_MINOR}|JDBC_MINOR=${NEW_MINOR}|g" \
-       ${file} | ${diff} ${file} - | ${patch}
-
-file="pom.xml"
-sed \
-       -e "/monetdb-jdbc/,/MonetDB JDBC 
driver/s|<version>${ESC_MAJOR}\.${ESC_MINOR}</version>|<version>${NEW_MAJOR}.${NEW_MINOR}</version>|g"
 \
-       ${file} | ${diff} ${file} - | ${patch}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to