-
-
Notifications
You must be signed in to change notification settings - Fork 17
130 lines (110 loc) Β· 3.91 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// swift-tools-version:5.5
// Copyright The swift-url Contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import PackageDescription
let package = Package(
name: "swift-url",
products: [
// 𧩠Core functionality.
// The WebURL type. You definitely want this.
.library(name: "WebURL", targets: ["WebURL"]),
// π Integration with swift-system.
// Adds WebURL <-> FilePath conversions.
.library(name: "WebURLSystemExtras", targets: ["WebURLSystemExtras"]),
// π Integration with Foundation.
// Adds WebURL <-> Foundation.URL conversions, and URLSession integration.
.library(name: "WebURLFoundationExtras", targets: ["WebURLFoundationExtras"]),
// π§° Support Libraries (internal use only).
// =========================================
// These libraries expose some convenient hooks for testing, benchmarking, and other tools
// - either in this repo or at <https://github.com/karwa/swift-url-tools>.
.library(name: "_WebURLIDNA", targets: ["IDNA"]),
.library(name: "_WebURLTestSupport", targets: ["WebURLTestSupport"]),
],
dependencies: [
// π Integrations.
// ================
// WebURLSystemExtras supports swift-system 1.0+.
.package(url: "https://github.com/apple/swift-system.git", .upToNextMajor(from: "1.0.0")),
// π§ͺ Test-Only Dependencies.
// ==========================
// Checkit - Exercises for stdlib protocol conformances.
.package(name: "Checkit", url: "https://github.com/karwa/swift-checkit.git", from: "0.0.2"),
],
targets: [
// πΊ Unicode and IDNA.
// ====================
.target(
name: "UnicodeDataStructures",
swiftSettings: [.define("WEBURL_UNICODE_PARSE_N_PRINT", .when(configuration: .debug))]
),
.testTarget(
name: "UnicodeDataStructuresTests",
dependencies: ["UnicodeDataStructures", "Checkit"],
resources: [.copy("GenerateData/TableDefinitions")]
),
.target(
name: "IDNA",
dependencies: ["UnicodeDataStructures"]
),
.testTarget(
name: "IDNATests",
dependencies: ["IDNA", "WebURLTestSupport"]
),
// π WebURL.
// ==========
.target(
name: "WebURL",
dependencies: ["IDNA"]
),
.target(
name: "WebURLTestSupport",
dependencies: ["WebURL", "IDNA"],
resources: [.copy("TestFilesData")]
),
.testTarget(
name: "WebURLTests",
dependencies: ["WebURL", "WebURLTestSupport", "Checkit"]
),
.testTarget(
name: "WebURLDeprecatedAPITests",
dependencies: ["WebURL"]
),
// π WebURLSystemExtras.
// ======================
.target(
name: "WebURLSystemExtras",
dependencies: ["WebURL", .product(name: "SystemPackage", package: "swift-system")]
),
.testTarget(
name: "WebURLSystemExtrasTests",
dependencies: ["WebURLSystemExtras", "WebURL", .product(name: "SystemPackage", package: "swift-system")]
),
// π WebURLFoundationExtras.
// ==========================
.target(
name: "WebURLFoundationExtras",
dependencies: ["WebURL"]
),
.testTarget(
name: "WebURLFoundationExtrasTests",
dependencies: ["WebURLFoundationExtras", "WebURLTestSupport", "WebURL"],
resources: [.copy("URLConversion/Resources")]
),
.testTarget(
name: "WebURLFoundationEndToEndTests",
dependencies: ["WebURLFoundationExtras", "WebURL"]
),
]
)