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 API method for getting all build_types regardless of conditions. #337

Merged
merged 3 commits into from
May 25, 2022
Merged
Changes from all 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
12 changes: 12 additions & 0 deletions src/catkin_pkg/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ def get_build_type(self):
return build_type_exports[0]
raise InvalidPackage('Only one <build_type> element is permitted.', self.filename)

def get_unconditional_build_types(self):
"""
Return values of export/build_type elements without conditional filtering, or ['catkin'] if unspecified.

:returns: package build types
:rtype: List[str]
"""
build_type_exports = [e.content for e in self.exports if e.tagname == 'build_type']
if not build_type_exports:
return ['catkin']
return build_type_exports

def has_invalid_metapackage_dependencies(self):
"""
Return True if this package has invalid dependencies for a metapackage.
Expand Down