Skip to content
brightdigitPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SwoopKit

SwiftPM Swift Versions Platforms License GitHub Workflow Status Documentation

Shared Swift models for Apple release data: SDKs, simulator runtimes, Xcode and Swift releases, and macOS restore images.

Table of Contents

Overview

SwoopKit is the vocabulary the Swoop packages share. A writer fills these records from public sources and stores them in a CloudKit public database; a reader maps the stored records back; apps match what's installed on a Mac against them.

  • SwoopMistKit writes the records to CloudKit with MistKit.
  • SwoopCloudKit reads them with native CloudKit.
  • Bushel and Stewed use them to show and match releases.
Type What it describes
SDKVersionRecord A platform SDK build shipped with Xcode (iOS, macOS, tvOS, visionOS, watchOS)
SimulatorRuntimeRecord A simulator runtime build from Apple's simulator index, with its ReleaseLabel (Beta N, RC N or Final)
XcodeVersionRecord An Xcode release
SwiftVersionRecord A Swift compiler release
RestoreImageRecord A macOS restore image (IPSW), with hash and URL validation
DataSourceMetadata When a data source was last fetched, and how many records it gave
ReleaseDataSnapshot The SDKVersion, XcodeVersion and SimulatorRuntime records fetched together, with fetchedAt: an app's bundled snapshot or a disk cache's contents

It depends only on Foundation. Every type is Sendable, the records are Codable, and each record has a stable recordName for its CloudKit record.

Requirements

  • Swift 6.4 (swift-tools-version 6.4, Swift 6 language mode); Xcode 27.2 on Apple platforms
  • macOS 12, iOS 18, watchOS 11, tvOS 18, visionOS 2 or Mac Catalyst 18; or Linux

Installation

Add SwoopKit to your Package.swift:

dependencies: [
  .package(url: "https://github.com/brightdigit/SwoopKit.git", from: "1.0.0-alpha.1")
]

and to your target:

.target(
  name: "YourTarget",
  dependencies: [
    .product(name: "SwoopKit", package: "SwoopKit")
  ]
)

Usage

import SwoopKit

let runtime = SimulatorRuntimeRecord(
  platform: .iOS,
  version: "27.2",
  buildNumber: "24B114",
  releaseLabel: .releaseCandidate(1),
  sdkBuildNumbers: ["24B113"]
)

runtime.isPrerelease  // true
runtime.recordName    // "SimulatorRuntime-iOS-24B114"

// Labels order Beta 1 < … < RC 1 < … < Final.
SimulatorRuntimeRecord.ReleaseLabel("Beta 4")! < .releaseCandidate(1)  // true

Write a ReleaseDataSnapshot with JSONEncoder.iso8601PrettySorted (ISO 8601 dates in whole seconds, pretty-printed, sorted keys) so the file is stable and diffable, and read one with ReleaseDataSnapshot(json:), which uses JSONDecoder.iso8601 and throws a typed DecodingError (JSONDecoder.decodeValue(_:from:)).

Decoding doesn't validate. After ingesting external data, call RestoreImageRecord.validate() or DataSourceMetadata.validate(sourceName:recordTypeName:recordCount:fetchDurationSeconds:).

Documentation

The DocC catalog is in Sources/SwoopKit/SwoopKit.docc. Swift Package Index hosts the published documentation.

To build it locally (no plugin dependency; unresolved symbol links fail the build):

make docs          # .build/docs/SwoopKit.doccarchive
make docs-preview  # live preview

Development

mise trust && mise install   # swift-format, SwiftLint and periphery, pinned in mise.toml
make build
make test
make lint      # Scripts/lint.sh: format, swift-format, SwiftLint, build, headers, periphery

CI runs on pull requests only (.github/workflows): Linux (Swift 6.4) and Apple platforms (Xcode 27.2), the DocC build, lint and an unsafeFlags check.

License

SwoopKit is available under the MIT license. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages