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

Helper to get version number from package.xml #456

Merged
merged 8 commits into from
Oct 29, 2024

Conversation

scpeters
Copy link
Member

🎉 New feature

Follow-up to gazebosim/gz-math#639, part of gazebosim/sdformat#1491

Summary

This adds a python script and a cmake helper function for getting the version number from a package.xml file.

Test it

Test using the version_from_package_xml example.

  1. Build and install gz-cmake from this branch
  2. cd examples/version_from_package_xml
  3. mkdir build && cd build
  4. cmake ..
  5. You should see the following lines in the console output, pulling the version number from the example package.xml file
-- PACKAGE_XML_VERSION 8.21.65
-- PACKAGE_XML_VERSION_MAJOR 8
-- PACKAGE_XML_VERSION_MINOR 21
-- PACKAGE_XML_VERSION_PATCH 65
-- gz-version_from_package_xml version 8.21.65

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

This adds a python script and a cmake helper function
for getting the version number from a package.xml
file.

Signed-off-by: Steve Peters <[email protected]>
This makes the gz_get_package_xml_version function
available automatically after finding gz-cmake.

Signed-off-by: Steve Peters <[email protected]>
scpeters and others added 3 commits October 28, 2024 13:44
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

Made some cosmetic commits, one suggestion and one real fix.

Thanks for the PR!

tools/print_package_xml_version.py Outdated Show resolved Hide resolved
tools/print_package_xml_version.py Show resolved Hide resolved
scpeters and others added 3 commits October 29, 2024 10:04
Signed-off-by: Steve Peters <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

Good to go with green CI ! Thanks!

@scpeters scpeters merged commit eb7226d into gz-cmake4 Oct 29, 2024
9 checks passed
@scpeters scpeters deleted the scpeters/package_xml_version branch October 29, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants