Skip to content

Commit

Permalink
Fix ordering and remove IGN_<LIB>_VER pattern (#700)
Browse files Browse the repository at this point in the history
* Fix replacement ordering

* Implement IGN_<LIB>_VER fix

* Remove IGN_<LIB>_VER case instead

This pattern requires that the library is found before it is invoked. And in most cases, it'll be invoked first.
  • Loading branch information
methylDragon authored Apr 12, 2022
1 parent 88436da commit 2dc1c0e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions release-repo-scripts/bump_dependency.bash
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,6 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do
DEP_VER=${VERSIONS[$j]}
DEP_PREV_VER="$((${DEP_VER}-1))"

# Rule: *plugin2 -> *plugin3
# Replace lines like: "find_package(ignition-cmake2)"
# with: "find_package(ignition-cmake3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s ${DEP_LIB}${DEP_PREV_VER} ${DEP_LIB}${DEP_VER} g"

# Rule: IGN_PLUGIN_VER 2 -> IGN_PLUGIN_VER 3
# Replace lines like: "set(IGN_PLUGIN_VER 2)"
# with: "set(IGN_PLUGIN_VER 3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER ${DEP_VER}@ig"

# Replace lines like "find_package(ignition-cmake2 2.0.0)"
# with "find_package(ignition-cmake3)"
find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@\(find_package.*${DEP_LIB}\)${DEP_PREV_VER} \+${DEP_PREV_VER}[^ )]*@\1${DEP_VER}@g"
Expand All @@ -478,6 +468,12 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do
# with "ign_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)"
find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@\(find_package.*${DEP_LIB}\)${DEP_PREV_VER}\(.*\) \+VERSION \+${DEP_PREV_VER}[^ )]*@\1${DEP_VER}\2@g"


# Rule: *plugin2 -> *plugin3
# Replace lines like: "find_package(ignition-cmake2)"
# with: "find_package(ignition-cmake3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s ${DEP_LIB}${DEP_PREV_VER} ${DEP_LIB}${DEP_VER} g"

# Replace collection yaml branch names with main
if [[ "${LIB}" == "ign-${COLLECTION}" ]]; then
find . -type f -name "collection-${COLLECTION}.yaml" -print0 | xargs -0 sed -i "s ign-${DEP_LIB}${DEP_VER} main g"
Expand Down

0 comments on commit 2dc1c0e

Please sign in to comment.