// swift-tools-version: 6.3 import PackageDescription let package = Package( name: "Website", defaultLocalization: "en", platforms: [ .macOS(.v15), .iOS(.v18), .tvOS(.v18), ], products: [ .executable( name: "Website", targets: [ "Website", "WebsiteLibrary", ] ) ], dependencies: [ .package( path: "../../Packages/Infrastructure" ), .package( path: "../../Packages/Localization" ), .package( path: "../../Packages/Persistence" ), .package( path: "../../Packages/Utility" ), .package( url: "https://github.com/elementary-swift/elementary.git", from: "0.6.0" ), .package( url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.3.0" ), .package( url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.25.0" ), .package( url: "https://github.com/adam-fowler/compress-nio.git", from: "1.4.2" ), .package( url: "https://github.com/apple/swift-configuration.git", from: "1.0.0", traits: [ .defaults, "CommandLineArguments", ] ), ], targets: [ .executableTarget( name: "Website", dependencies: [ .byName(name: "Localization"), .byName(name: "Persistence"), .byName(name: "WebsiteLibrary"), .product( name: "Configuration", package: "swift-configuration" ), .product( name: "Hummingbird", package: "hummingbird" ), ], path: "Sources/App" ), .target( name: "WebsiteLibrary", dependencies: [ .byName(name: "Infrastructure"), .byName(name: "Localization"), .byName(name: "Persistence"), .byName(name: "Utility"), .product( name: "Configuration", package: "swift-configuration" ), .product( name: "Elementary", package: "elementary" ), .product( name: "Hummingbird", package: "hummingbird" ), .product( name: "HummingbirdElementary", package: "hummingbird-elementary" ), ], path: "Sources/Library", 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") ] ), .testTarget( name: "WebsiteTests", dependencies: [ .byName(name: "Infrastructure"), .byName(name: "Website"), .product( name: "CompressNIO", package: "compress-nio" ), .product( name: "HummingbirdTesting", package: "hummingbird" ), ], path: "Tests/App", resources: [ // `Static` links to the service's `Resources/Static`, copying it into the test bundle at build // time — the tests must not read the repository tree, which Xcode's test runner is denied. .copy("Static") ] ), .testTarget( name: "WebsiteLibraryTests", dependencies: [ .byName(name: "Infrastructure"), .byName(name: "Persistence"), .byName(name: "WebsiteLibrary"), .product( name: "Elementary", package: "elementary" ), .product( name: "Hummingbird", package: "hummingbird" ), .product( name: "HummingbirdTesting", package: "hummingbird" ), ], path: "Tests/Library" ), ] )