Skip to content

Commit

Permalink
[quarkus-next] Align dependency versions before build
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zaoral <[email protected]>
  • Loading branch information
Pepo48 committed Aug 28, 2024
1 parent 29eb017 commit bb52f95
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/scripts/prepare-quarkus-next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ add_repository "pom.xml" "repository"
add_repository "quarkus/pom.xml" "pluginRepository"
add_repository "operator/pom.xml" "pluginRepository"

./quarkus/scripts/set-quarkus-version.sh nightly
./mvnw -B versions:set-property -Dproperty=quarkus.version -DnewVersion=999-SNAPSHOT
./mvnw -B versions:set-property -Dproperty=quarkus.build.version -DnewVersion=999-SNAPSHOT
git commit -am "Set quarkus version to 999-SNAPSHOT"
Expand Down
24 changes: 18 additions & 6 deletions quarkus/set-quarkus-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ DEFAULT_QUARKUS_VERSION="999.0.0-SNAPSHOT"
QUARKUS_VERSION=${1:-"$DEFAULT_QUARKUS_VERSION"}
QUARKUS_BRANCH="$QUARKUS_VERSION"

if [ "$QUARKUS_BRANCH" == "$DEFAULT_QUARKUS_VERSION" ]; then
EXCLUDED_DEPENDENCIES=(
"infinispan"
)

if [ "$QUARKUS_BRANCH" == "$DEFAULT_QUARKUS_VERSION" ] || [ "$QUARKUS_VERSION" == "nightly" ]; then
QUARKUS_BRANCH="main"
fi

Expand All @@ -48,24 +52,32 @@ fi

QUARKUS_BOM=$(curl -f -s "$QUARKUS_BOM_URL")

echo "Setting Quarkus version: $QUARKUS_VERSION"
$(mvn versions:set-property -f ../pom.xml -Dproperty=quarkus.version,quarkus.build.version -DnewVersion="$QUARKUS_VERSION" 1> /dev/null)
if [ "$QUARKUS_VERSION" != "nightly" ]; then
echo "Setting Quarkus version: $QUARKUS_VERSION"
$(mvn versions:set-property -f ../pom.xml -Dproperty=quarkus.version,quarkus.build.version -DnewVersion="$QUARKUS_VERSION" 1> /dev/null)
fi

DEPENDENCIES_LIST=$(grep -oP '(?<=\</).*(?=\.version\>)' ../pom.xml)
DEPENDENCIES_LIST=$(grep -oP '(?<=\</).*(?=\.version\>)' "$(dirname "$0")/../pom.xml")

echo "Changing dependencies: $DEPENDENCIES_LIST"
$(mvn -f ./pom.xml versions:revert 1> /dev/null)

for dependency in $DEPENDENCIES_LIST; do
for excluded in "${EXCLUDED_DEPENDENCIES[@]}"; do
if [[ $dependency =~ $excluded ]]; then
echo "Skipping $dependency because it is listed as an excluded dependency"
continue 2
fi
done
VERSION=$(grep -oP "(?<=<$dependency.version>).*(?=</$dependency.version)" <<< "$QUARKUS_BOM")
if [ "$VERSION" == "" ]; then
echo "Failed to resolve version for dependency '$dependency'"
continue;
continue
fi
echo "Setting $dependency to $VERSION"
mvn versions:set-property -f ../pom.xml -Dproperty="$dependency".version -DnewVersion="$VERSION" 1> /dev/null
mvn versions:set-property -f ./pom.xml -Dproperty="$dependency".version -DnewVersion="$VERSION" 1> /dev/null
done

echo ""
echo "Done!"
echo "Done!"

0 comments on commit bb52f95

Please sign in to comment.