Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x fix updatehelidonversion script #105

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion etc/scripts/updatehelidonversion.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2022, 2023 Oracle and/or its affiliates.
# Copyright (c) 2022, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,7 @@ if [ -z "${NEW_VERSION}" ]; 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 @@ -56,3 +57,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