Skip to content

Commit 1c1840f

Browse files
authored
Update update_major_version.sh
1 parent 5a539fc commit 1c1840f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

update_major_version.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ if [ ! -f "${VERSIONS_FILE_PATH}" ]; then
1414
exit 1
1515
fi
1616

17-
# Extract version from the file
18-
if grep -q "^${PACKAGE_NAME}=" "${VERSIONS_FILE_PATH}"; then
19-
current_version=$(grep "^${PACKAGE_NAME}=" "${VERSIONS_FILE_PATH}" | cut -d'=' -f2)
20-
else
21-
echo "Error: ${PACKAGE_NAME} not found in ${VERSIONS_FILE_PATH}"
22-
exit 1
23-
fi
17+
# Load versions to be used
18+
# shellcheck source="${VERSIONS_FILE_PATH}"
19+
source "${VERSIONS_FILE_PATH}"
20+
21+
#add parents version and current version
22+
xmlstarlet ed -L \
23+
-u "//_:project/_:parent/_:version" -v "${REACTOME_PARENT_VERSION}" \
24+
-u "//_:project/_:version" -v "${!PACKAGE_NAME}" \
25+
"pom.xml"
2426

25-
echo "Version read from ${VERSIONS_FILE_PATH}: ${current_version}"
27+
echo "Maven ${PACKAGE_NAME} updated to ${!PACKAGE_NAME}"
28+
echo "Maven parent updated to ${REACTOME_PARENT_VERSION}"
2629

27-
# Set the extracted version in Maven
28-
mvn versions:set -DnewVersion="${current_version}"
2930

30-
echo "Maven version updated to ${current_version}"
31+
# deleting custom versions of org.reactome.server
32+
xmlstarlet ed -L -d "//_:dependency[_:groupId[starts-with(text(),'org.reactome')]]/_:version" pom.xml

0 commit comments

Comments
 (0)