Skip to content

Commit

Permalink
2.x fix updatehelidonversion script (helidon-io#105)
Browse files Browse the repository at this point in the history
* Fix updatehelidonversion.sh to update build.gradle files
  • Loading branch information
barchetta committed Dec 2, 2024
1 parent 6079f4b commit 4f26a40
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions etc/scripts/updatehelidonversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 4f26a40

Please sign in to comment.