Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Category A (tools-version 6.2 + macOS 26 min): macos-26 + Swift 6.2
# Category B (tools-version 6.2 + older macOS): macos-15 + 6.2, macos-26 + 6.2
# Category C (tools-version 6.0): macos-15 + 6.1, macos-15 + 6.3, macos-26 + 6.3
# Linux (if viable): ubuntu + Swift 6.1, ubuntu + Swift 6.3
# Linux: ubuntu + Swift 6.1, ubuntu + Swift 6.3
# (Package.swift excludes METARFormatting/DecodeMETAR/DecodeTAF on Linux — they format
# Measurement values via APIs swift-corelibs-foundation doesn't implement; SwiftMETAR
# core + DecodeWindsAloft + tests are unaffected and build/test on Linux normally)
#
# When Swift 6.4 ships: bump 6.1→6.2 and 6.3→6.4 in Category C
# When bumping tools-version to 6.2: drop 6.0/6.1, move to Category A or B
Expand Down Expand Up @@ -33,6 +36,10 @@ jobs:
swift: "6.3"
- os: macos-26
swift: "6.3"
- os: ubuntu-latest
swift: "6.1"
- os: ubuntu-latest
swift: "6.3"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
Expand All @@ -45,11 +52,10 @@ jobs:
run: swift test -v
lint:
name: Run SwiftLint
runs-on: macos-latest
runs-on: ubuntu-latest
container: ghcr.io/realm/swiftlint:latest
steps:
- uses: actions/checkout@v6
- name: Install SwiftLint
run: brew install swiftlint
- name: Run SwiftLint
run: swiftlint --strict
swift-format:
Expand Down
101 changes: 59 additions & 42 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,55 @@ let approachableConcurrency: [SwiftSetting] = [
.enableUpcomingFeature("InferIsolatedConformances")
]

let package = Package(
name: "SwiftMETAR",
defaultLocalization: "en",
platforms: [.macOS(.v13), .iOS(.v16), .tvOS(.v16), .watchOS(.v9), .visionOS(.v1)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftMETAR",
targets: ["SwiftMETAR"]
),
// METARFormatting (and DecodeMETAR/DecodeTAF, which depend on it) format `Measurement`
// values using `Measurement.FormatStyle` and the `\(_, format:)` string interpolation
// sugar for custom `FormatStyle` types. Neither is implemented by swift-corelibs-foundation,
// so these targets/products are only defined on Apple platforms; SwiftMETAR and
// DecodeWindsAloft don't use these APIs and build fine everywhere.
var products: [Product] = [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftMETAR",
targets: ["SwiftMETAR"]
),
.executable(name: "decode-winds-aloft", targets: ["DecodeWindsAloft"])
]

var targets: [Target] = [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "SwiftMETAR",
dependencies: [.product(name: "NumberKit", package: "swift-numberkit")],
resources: [.process("Resources")],
swiftSettings: approachableConcurrency
),
.testTarget(
name: "SwiftMETARTests",
dependencies: ["SwiftMETAR"],
swiftSettings: approachableConcurrency
),
.executableTarget(
name: "DecodeWindsAloft",
dependencies: [
"SwiftMETAR",
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
swiftSettings: approachableConcurrency
)
]

#if !os(Linux)
products += [
.library(
name: "METARFormatting",
targets: ["METARFormatting"]
),
.executable(name: "decode-metar", targets: ["DecodeMETAR"]),
.executable(name: "decode-taf", targets: ["DecodeTAF"]),
.executable(name: "decode-winds-aloft", targets: ["DecodeWindsAloft"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.6.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.4.3"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/riscfuture/BuildableMacro.git", from: "1.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "SwiftMETAR",
dependencies: [.product(name: "NumberKit", package: "swift-numberkit")],
resources: [.process("Resources")],
swiftSettings: approachableConcurrency
),
.executable(name: "decode-taf", targets: ["DecodeTAF"])
]

targets += [
.target(
name: "METARFormatting",
dependencies: [
Expand All @@ -50,11 +65,6 @@ let package = Package(
resources: [.process("Resources")],
swiftSettings: approachableConcurrency
),
.testTarget(
name: "SwiftMETARTests",
dependencies: ["SwiftMETAR"],
swiftSettings: approachableConcurrency
),
.executableTarget(
name: "DecodeMETAR",
dependencies: [
Expand All @@ -72,15 +82,22 @@ let package = Package(
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
swiftSettings: approachableConcurrency
),
.executableTarget(
name: "DecodeWindsAloft",
dependencies: [
"SwiftMETAR",
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
swiftSettings: approachableConcurrency
)
]
#endif

let package = Package(
name: "SwiftMETAR",
defaultLocalization: "en",
platforms: [.macOS(.v13), .iOS(.v16), .tvOS(.v16), .watchOS(.v9), .visionOS(.v1)],
products: products,
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.6.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.4.3"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/riscfuture/BuildableMacro.git", from: "1.0.0")
],
targets: targets,
swiftLanguageModes: [.v5, .v6]
)
3 changes: 3 additions & 0 deletions Sources/DecodeMETAR/DecodeMETAR.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import ArgumentParser
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import METARFormatting
import SwiftMETAR

Expand Down
3 changes: 3 additions & 0 deletions Sources/DecodeTAF/DecodeTAF.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import ArgumentParser
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import METARFormatting
import SwiftMETAR

Expand Down
3 changes: 3 additions & 0 deletions Sources/DecodeWindsAloft/DecodeWindsAloft.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import ArgumentParser
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import SwiftMETAR

@available(macOS 15.0, *)
Expand Down
Loading
Loading