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? Thanks.