Currently to specify a platform version for, e.g., MacOS, an opaque enum value is required (PackageDescription.SupportedPlatform.MacOSVersion
) and can be specified by e..g .macOS(.v10_15)
In cases where a project is distributed via multiple package managers and/or involves build tools other than those provided by Xcode, it is useful to externalise versions in relevant dotfiles. To this end, I use a .macos-version
files that contains a string such as 10.15
It would be very useful to introduce a string initializer of a form similar to .macOS("10.15")
to allow this behaviour.
The only option for doing this at the moment is to either a) update version numbers in multiple places, thus defeating the purpose of the dotfile; or b) add the complication of string templating and generate the Package.swift file as part of the build process.
Feedback appreciated as well as examples of where you've run into this problem or a similar one.
4 posts - 3 participants