// swift-tools-version: 6.4 import PackageDescription let package = Package( name: "Infrastructure", platforms: [ .macOS(.v15), ], products: [ .library( name: "Infrastructure", targets: [ "Infrastructure" ] ), ], traits: [ .trait( name: "Analytics", description: "Analytics events, their element tagging, and the tracker script pages embed." ), .trait( name: "StructuredData", description: "Schema.org structured data, rendered as a JSON-LD script." ), ], dependencies: [ .package( path: "../Localization" ), .package( url: "https://github.com/adam-fowler/compress-nio.git", from: "1.4.2" ), .package( url: "https://github.com/elementary-swift/elementary.git", from: "0.6.0" ), .package( url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.25.0" ), .package( url: "https://github.com/hummingbird-project/hummingbird-compression.git", from: "2.0.0" ), ], targets: [ .target( name: "Infrastructure", dependencies: [ .byName(name: "Localization"), .product( name: "CompressNIO", package: "compress-nio" ), .product( name: "Elementary", package: "elementary" ), .product( name: "Hummingbird", package: "hummingbird" ), .product( name: "HummingbirdCompression", package: "hummingbird-compression" ), ], path: "Sources" ), .testTarget( name: "InfrastructureTests", dependencies: [ .byName(name: "Infrastructure"), .product( name: "Elementary", package: "elementary" ), .product( name: "HummingbirdTesting", package: "hummingbird" ), ], path: "Tests", resources: [ // Copied verbatim rather than processed: the String Catalog is read as raw JSON at // runtime so it resolves identically on Darwin and Linux (which cannot compile it). .copy("Catalogs/Localizable.xcstrings") ] ), ] ) // Applied to every target: strict memory safety and warnings as errors as guardrails — deprecations stay warnings, so a // dependency update cannot break the build — plus the upcoming concurrency features Swift 7 turns on by default. for target in package.targets { target.swiftSettings = (target.swiftSettings ?? []) + [ .strictMemorySafety(), .treatAllWarnings(as: .error), .treatWarning("DeprecatedDeclaration", as: .warning), .enableUpcomingFeature("NonisolatedNonsendingByDefault"), .enableUpcomingFeature("InferIsolatedConformances"), ] }