I would like to specify the packages to be built within a repo as part of a local source build of ROS2 Foxy. How can I specify this in the ros2.repos file?
you can't, as that's not the responsibility of a .repos
file. That's only used to provide information on a set of repositories (name, location and specific version to check out).
vcs
(the tool which consumes these files) does not have any concept of "package", neither does a .repos
file.
To build only a subset of the packages hosted in the repositories listed in a .repos
file, you could:
- place
COLCON_IGNORE
or AMENT_IGNORE
files in all the directories containing packages you don't want to build, or - use Colcon's (extensive) support for package selection arguments
The latter is probably more maintainable. You'd use something like --packages-select [PKG_NAME [PKG_NAME …]]
and tell Colcon exactly which packages you'd want it to build. Or something like --packages-up-to [PKG_NAME [PKG_NAME …]]
which builds all packages you list plus their (transitive) dependencies.