Closed atyshka closed 5 years ago
Since I am not familiar with Swift
can you please some more context and/or references. How do you usually build Swift package? What build system is being used?
Swift comes with an LLVM-based compiler and a build tool known as the swift package manager. The package manager makes it super easy to build and manage dependencies but I'm guessing it might be difficult to integrate. CMake might be an easier route. CMake 3.15 includes support for swift via the Ninja generator and Makefile generator support is in the works.
Swift comes with an LLVM-based compiler and a build tool known as the swift package manager.
The package manager is as the name indicates a package manager. That is not the same role as a build tool like colcon
.
The referenced documentation mentions the "Swift build system". That sounds more like what could be support by an extension of colcon
. Can you provide any more information about that?
CMake might be an easier route. CMake 3.15 includes support for swift via the Ninja generator and Makefile generator support is in the works.
If Swift has its own build system it would be more natural to add support for that instead of trying to achieve the same with CMake. CMake support is already available with colcon-cmake
so if you want to try that there should be no need to do anything in colcon
. I would still recommend considering to add support for the Swift build system.
FYI the "package manager" is a bit of a misnomer. It's not something like pip, npm, or apt, for managing the installation of packages. It's designed to setup dependencies for a build and then build. Details aren't important, I think with the reference of colcon-cmake I can figure it out. Thanks for the pointer, I'll reopen this if I run into any trouble.
Alright I think I've researched enough to create a colcon extension for Swift in the style of colcon-cmake. As I develop that, how do I make colcon aware of my extension so that colcon build
, test
, etc. will invoke my extension?
colcon build
invoked the corresponding extension based on the identified package type. Since you didn't reference any code / steps I can't tell why it doesn't work for you.
You can check the package type by calling colcon list
- the name in the parenthesis at the end of each line. That type is used to dispatch to the corresponding extension to actually process the package.
Given the growth and power of the Swift language, I’m considering building a swift client library for ROS 2. This would allow for easy, powerful and expressive code on the official platforms of Mac and Linux as well as expand support for iOS apps. The RCL repo is pretty self explanatory, but I’m trying to figure out how to integrate third party clients with the ROS 2 build system. Is there a recommended way to go about this? Unofficial clients are a big part of the ros2 plan but there’s not a lot of discussion on how to ideally implement these.