Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.73 KB

Installation.md

File metadata and controls

58 lines (44 loc) · 1.73 KB

Installation

SwiftWhy needs macOS 14+ and a Swift 6 toolchain (Xcode 16 or later). Install it once for yourself with Mint, or pin a version in your repository so everyone on a team runs the same one.

Mint

mint install acfriedman/SwiftWhy

Mint builds the tag you name, or the latest, and links swiftwhy into ~/.mint/bin, which needs to be on your PATH. To pin one version for a team, add a Mintfile at the repository's root holding the line acfriedman/SwiftWhy@0.1.0, and run it with mint run swiftwhy.

Swift Package Manager

For a version pinned in the repository with nothing to install, keep a small package beside the project, BuildTools/Package.swift:

// swift-tools-version: 6.0
import PackageDescription

let package = Package(
    name: "BuildTools",
    platforms: [.macOS(.v14)],
    dependencies: [
        .package(url: "https://github.com/acfriedman/SwiftWhy", exact: "0.1.0")
    ],
    targets: [.target(name: "BuildTools", path: "")]
)

Add an empty BuildTools/Empty.swift for the target, commit both, and ignore BuildTools/.build. Then run it from the repository's root:

swift run --quiet -c release --package-path BuildTools swiftwhy check Sources

The first run builds it. Every later swift run still spends a second or two checking that the build is current, so a commit hook or build phase that runs often can call the binary it built directly, and run swift build again only after changing the pinned version:

BuildTools/.build/release/swiftwhy check Sources

From source

git clone https://github.com/acfriedman/SwiftWhy
cd SwiftWhy
swift build -c release
cp .build/release/swiftwhy /usr/local/bin/