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

Fix ordering and remove IGN_<LIB>_VER pattern #700

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Changes from 2 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
17 changes: 9 additions & 8 deletions release-repo-scripts/bump_dependency.bash
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,10 @@ 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
# Rule: IGN_<LIB>_VER <N> -> IGN_<LIB>_VER ${ignition-<lib><N>_VERSION_MAJOR}
# 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"
# with: "set(IGN_PLUGIN_VER ${ignition-plugin3_VERSION_MAJOR})"
find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER \L\$\{ignition-${DEP_LIB}${DEP_VER}_\UVERSION_MAJOR\}@ig"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this block and rely on updating the examples to use *_VERSION_MAJOR variables. I'll open an example PR to start

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm, ordering does come an issue. Ok, it makes sense to remove the block but update the examples accordingly. I'll note it in the edge-case tracking issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to stop now; I think there may be a few more examples folders to check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

93a5107

Also updated note in issue: #689

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping with them! You got all of them except these: gazebosim/gz-sim#1442

🔥


# Replace lines like "find_package(ignition-cmake2 2.0.0)"
# with "find_package(ignition-cmake3)"
Expand All @@ -478,6 +473,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