|
| 1 | +// swift-tools-version:5.9 |
| 2 | +//===----------------------------------------------------------------------===// |
| 3 | +// |
| 4 | +// This source file is part of the SwiftOpenAPIGenerator open source project |
| 5 | +// |
| 6 | +// Copyright (c) 2024 Apple Inc. and the SwiftOpenAPIGenerator project authors |
| 7 | +// Licensed under Apache License v2.0 |
| 8 | +// |
| 9 | +// See LICENSE.txt for license information |
| 10 | +// See CONTRIBUTORS.txt for the list of SwiftOpenAPIGenerator project authors |
| 11 | +// |
| 12 | +// SPDX-License-Identifier: Apache-2.0 |
| 13 | +// |
| 14 | +//===----------------------------------------------------------------------===// |
| 15 | +import PackageDescription |
| 16 | + |
| 17 | +let package = Package( |
| 18 | + name: "shared-types-client-server-example", |
| 19 | + platforms: [.macOS(.v13)], |
| 20 | + products: [ |
| 21 | + .executable(name: "hello-world-client", targets: ["Client"]), |
| 22 | + .executable(name: "hello-world-server", targets: ["Server"]), |
| 23 | + ], |
| 24 | + dependencies: [ |
| 25 | + .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.0.0"), |
| 26 | + .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"), |
| 27 | + .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"), |
| 28 | + .package(url: "https://github.com/swift-server/swift-openapi-hummingbird", from: "1.0.0"), |
| 29 | + ], |
| 30 | + targets: [ |
| 31 | + .target( |
| 32 | + name: "Types", |
| 33 | + dependencies: [.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime")], |
| 34 | + plugins: [.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")] |
| 35 | + ), |
| 36 | + .executableTarget( |
| 37 | + name: "Client", |
| 38 | + dependencies: [ |
| 39 | + "Types", .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), |
| 40 | + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), |
| 41 | + ], |
| 42 | + plugins: [.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")] |
| 43 | + ), |
| 44 | + .executableTarget( |
| 45 | + name: "Server", |
| 46 | + dependencies: [ |
| 47 | + "Types", .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), |
| 48 | + .product(name: "OpenAPIHummingbird", package: "swift-openapi-hummingbird"), |
| 49 | + ], |
| 50 | + plugins: [.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")] |
| 51 | + ), |
| 52 | + ] |
| 53 | +) |
0 commit comments