From a7b8c34f2f36e8d8cb2c3d541e8c5a3cc5191a12 Mon Sep 17 00:00:00 2001 From: Joe DiPol Date: Mon, 2 Dec 2024 17:02:37 -0700 Subject: [PATCH] 2.x fix updatehelidonversion script (#105) (#106) * Fix updatehelidonversion.sh to update build.gradle files --- etc/scripts/updatehelidonversion.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/scripts/updatehelidonversion.sh b/etc/scripts/updatehelidonversion.sh index 573c7d44e..ca0b0cde4 100755 --- a/etc/scripts/updatehelidonversion.sh +++ b/etc/scripts/updatehelidonversion.sh @@ -34,6 +34,7 @@ if [ -z "${TMPDIR}" ]; then fi readonly POM_FILES=$(find . -name pom.xml -print) +readonly GRADLE_FILES=$(find . -name build.gradle -print) for f in ${POM_FILES}; do pom_dir=$(dirname $f) @@ -60,3 +61,12 @@ for f in ${POM_FILES}; do fi done +# Update helidonversion property in build.gradle files +for f in ${GRADLE_FILES}; do + # first make sure file has property + if grep -q "helidonversion =" "$f" ; then + cat $f | sed -e "s#helidonversion = [a-zA-Z0-9.'-]*#helidonversion = '${NEW_VERSION}'#" > ${TMPDIR}/build.gradle + mv "${TMPDIR}/build.gradle" $f + echo "Updated helidonversion in $f with Helidon version ${NEW_VERSION}" + fi +done