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

Add substitution for finding package share directory #57

Merged
merged 5 commits into from
Sep 11, 2019

Conversation

jacobperron
Copy link
Member

Expose FindPackageShare as 'find-pkg' and FindPackage as 'find-pkg-root'.
The rationale is that getting the share directory is the more common use-case (e.g. including launch files).

This turns

<include file="$(find-pkg foo)/share/foo/launch/foo.launch.xml">

into

<include file="$(find-pkg foo)/launch/foo.launch.xml">

Expose FindPackageShare as 'find-pkg' and FindPackage as 'find-pkg-root'.
The rationale is that getting the share directory is the more common use-case (e.g. including launch files).

This turns

    <include file="$(find-pkg foo)/share/foo/launch/foo.launch.xml">

into

    <include file="$(find-pkg foo)/launch/foo.launch.xml">

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron added the enhancement New feature or request label Aug 28, 2019
@jacobperron
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@dirk-thomas
Copy link
Member

I don't think "root" is a good term here. The term used everywhere else for this basepath is (install) "prefix".

I would rather prefer both substitutions to be explicit (find-pkg-prefix and find-pkg-share) rather than having a shortcut like find-pkg where the use has to guess or know what it might resolve to.

@jacobperron
Copy link
Member Author

I would rather prefer both substitutions to be explicit (find-pkg-prefix and find-pkg-share) rather than having a shortcut like find-pkg where the use has to guess or know what it might resolve to.

👍 for find-pkg-prefix.

I kept find-pkg short since I expect it to be the majority of uses for the find substitution, but I'm okay with expanding it to find-pkg-share

@jacobperron
Copy link
Member Author

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

Windows: Build Status

FindPackage is now an abstract class that requires subclasses to implement a 'find' method.
FindPackagePrefix is the subclass that finds the package prefix.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM!

launch_ros/launch_ros/substitutions/find_package.py Outdated Show resolved Hide resolved
launch_ros/launch_ros/substitutions/find_package.py Outdated Show resolved Hide resolved
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI

@jacobperron jacobperron merged commit 897cae8 into master Sep 11, 2019
@delete-merged-branch delete-merged-branch bot deleted the jacob/find_pkg branch September 11, 2019 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants