Different versions per swift version in Portfile

조성빈 goranmoomin at daum.net
Mon May 24 17:27:14 UTC 2021

I’m trying to write my first Portfile for the swift-format tool <http://github.com/apple/swift-format>.

I’m referencing the xcodes port <https://github.com/macports/macports-ports/blob/master/devel/xcodes/Portfile> as an example of a Swift port.

The problem here is that the version of the tool must be synced with the local swift version.
For example, release 0.50400.0 is compatible with Swift 5.4, 0.50300.0 is compatible with Swift 5.3, etc…

My questions:
Is it right to give if conditions on the swift version to differentiate versions? Would executing different version statements on every if branch be sufficient?
If 1. is correct, is there a variable for me to test with?
If 1. is incorrect, how should I provide different versions? Would just providing the version only for the latest swift the right choice?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20210525/f7560b60/attachment.htm>

More information about the macports-users mailing list