Slide 30
Slide 30 text
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "isucon11",
platforms: [
.macOS(.v10_15)
],
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", .branch("async-await")),
.package(url: "https://github.com/vapor/mysql-kit.git", from: "4.0.0"),
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.0"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
],
targets: [
.target(
name: "App",
dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "MySQLKit", package: "mysql-kit"),
.product(name: "JWTKit", package: "jwt-kit"),
.product(name: "AnyCodable", package: "AnyCodable")
],
swiftSettings: [
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release)),
// Disable availability checking to use concurrency API on macOS for development purpose
// SwiftNIO exposes concurrency API with availability for deployment environment,
// but in our use case, the deployment target is Linux, and we only use macOS while development,
// so it's always safe to disable the checking in this situation.
.unsafeFlags(["-Xfrontend", "-disable-availability-checking"])
]
),
.target(name: "Run", dependencies: [.target(name: "App")])
]
)
Package.swift (+ k8s などの設定ファイル) 作れば開発可能!