swiftenv is an environment manager of Swift on Ubuntu at a very early stage, inspired by
pyenv. It’s written in purely
bash script and has so far supported to install and manage multiple versions of Swift and expose one of them to the system.
Since Swift has not implemented complete backward compatibility yet, it’s still necessary for developers to test their code using different Swift versions. On macOS,
xcrun can select the designated toolchain, while on Linux, developers still need to manage different paths manually.
swiftenv can let developers easily switch between Swift versions in an easy way.
Also, it’s a little bit complicated to manually install Swift on Ubuntu. Before Swift gain community-hosted
apt repository support or being officially adopted by Ubuntu,
swiftenv might be among the easiest ways to install Swift on Ubuntu.
How to evolve?
swiftenv is currently based on scanning directories and files, thus does not support integrity check. There may be some tricky bugs to deal with, which largely relies on your tries and issues.
man files and
help command need to be implemented. Also, I hope development builds can be supported. These are the things to do before the 1.0 release.
For 1.x, I’d planned to support project-based Swift version config and introduce a new way to switch through Swift versions, which may works like
pyenv. As long as community support is ready, Linux distributions besides Ubuntu can get
swiftenv support too.
Welcome to try out and propose issues at GitHub.