-
Notifications
You must be signed in to change notification settings - Fork 4
/
Package.swift
82 lines (79 loc) · 2.75 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "VHX",
platforms: [
.macOS(.v13),
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "VHX",
targets: ["VHX"]
),
],
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", from: "4.107.0"),
.package(url: "https://github.com/vapor/leaf.git", from: "4.4.1"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "VHX", dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "Leaf", package: "leaf"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "VHXTests",
dependencies: [
.target(name: "VHX"),
.product(name: "XCTVapor", package: "vapor"),
.product(name: "Vapor", package: "vapor"),
.product(name: "Leaf", package: "leaf"),
],
resources: [
.copy("Views"),
],
swiftSettings: swiftSettings
),
.executableTarget(
name: "Demo",
dependencies: [
.target(name: "VHX"),
.product(name: "Leaf", package: "leaf"),
.product(name: "Vapor", package: "vapor"),
],
resources: [
.copy("Views"),
.copy("Public"),
],
swiftSettings: swiftSettings
),
]
)
let swiftSettings: [SwiftSetting] = [
// Flags to enable Swift 6 compatibility
.enableUpcomingFeature("BareSlashRegexLiterals"),
.enableUpcomingFeature("ConciseMagicFile"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ImportObjcForwardDeclarations"),
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("DeprecateApplicationMain"),
.enableUpcomingFeature("GlobalConcurrency"),
.enableUpcomingFeature("IsolatedDefaultValues"),
.enableExperimentalFeature("StrictConcurrency"),
// Flags to warn about the type checking getting too slow
.unsafeFlags(
[
"-Xfrontend",
"-warn-long-function-bodies=100",
"-Xfrontend",
"-warn-long-expression-type-checking=100",
]
),
]