Hi I’m looking for some guidance in creating a plugin to support writing snaps for Ubuntu Core 18 running on microcontrollers such as the Raspberry Pi 3B+. Swift has excellent support for Ubuntu on x86_64.
I have a good software development background in Swift and C/C++ and have been successful developing code written in Swift for Ubuntu 16.
I saw this thread, but I’m looking for adding Swift as a language option for snaps, rather than a snap to support developing in the language.
I looked at a couple of examples here, but, though I do know a little python, it’s not clear to me how to go about this.
So, two questions in one:
Is writing a plugin the proper way to support authoring snaps in Swift?
If so, can someone point me to documentation on writing plugins for snapcraft?
Yes, this would be the proper way to create snaps out of a swift code base.
The documentation on this is quite sparse, but minimally you would need to follow https://docs.snapcraft.io/writing-local-plugins/5125 to start out and iterate.
Thank you for confirming I’m on the right track and for the link. As it turns out, I found that one right after posting. It’s a starting point and it has a link to the plugin API. I’ll update this thread with my progress in case anyone else would like a Swift plugin as well.
Hi. Just seeing if you got anywhere with this? I have to do the same thing. I have a swift app that I want to distribute as a snap. Thanks
Hi _patrick, I’ve had issues with Ubuntu Core support on Raspberry Pi that have gotten in the way of working on this part of the project. Are you targeting Core or normal Ubuntu? If you would like to take point on this, I would be happy to transfer swift-lang to you. Canonical should really support Swift as a language themselves. To say adding language support is largely undocumented is a generous understatement.
on core you would likely be better off to create a swift part that you utilize then inside a snapcraft.yaml for the application snap you want to use on the system… or alternatively create a swift snap that provides access to the langiage (libs, interprter, whatever) via a content interface.
Thanks for getting back to me. I’m pretty new to Linux environments so i’m probably not the best person to take this forward. I’m still exploring the possibilities. However, the lack of documentation in places is proving problematic. Cheers