Skip to content

Commit ae3cce9

Browse files
committed
refactor: simplify package manifest
1 parent f4d55ae commit ae3cce9

1 file changed

Lines changed: 37 additions & 48 deletions

File tree

‎Package.swift‎

Lines changed: 37 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,6 @@
22

33
import PackageDescription
44

5-
var dependencies: [Package.Dependency] = [
6-
.package(
7-
url: "https://github.com/apple/swift-argument-parser.git",
8-
from: "1.5.0"
9-
),
10-
]
11-
var svgViewDependencies: [Target.Dependency] = []
12-
var svgViewSwiftSettings: [SwiftSetting] = []
13-
14-
dependencies.append(
15-
.package(
16-
url: "https://github.com/GoodNotes/FoundationEssentialsExtras.git",
17-
revision: "dace29232ec271389cc1e4c4258c8162d1ac3f5f"
18-
)
19-
)
20-
dependencies.append(
21-
.package(
22-
url: "https://github.com/compnerd/xylem.git",
23-
revision: "9881c95ce3a139f4ccfa584676201516c2a5751d"
24-
)
25-
)
26-
svgViewDependencies.append(contentsOf: [
27-
.product(
28-
name: "FoundationEssentialsExtras",
29-
package: "FoundationEssentialsExtras",
30-
condition: .when(platforms: [.wasi])
31-
),
32-
.product(
33-
name: "SAXParser",
34-
package: "xylem",
35-
condition: .when(platforms: [.wasi])
36-
),
37-
.product(
38-
name: "XMLCore",
39-
package: "xylem",
40-
condition: .when(platforms: [.wasi])
41-
),
42-
])
43-
svgViewSwiftSettings.append(
44-
.define(
45-
"FOUNDATION_ESSENTIALS_BUILD",
46-
.when(platforms: [.wasi])
47-
)
48-
)
49-
505
let package = Package(
516
name: "SVGView",
527
platforms: [
@@ -64,7 +19,20 @@ let package = Package(
6419
targets: ["GenerateReferencesCLI"]
6520
)
6621
],
67-
dependencies: dependencies,
22+
dependencies: [
23+
.package(
24+
url: "https://github.com/apple/swift-argument-parser.git",
25+
from: "1.5.0"
26+
),
27+
.package(
28+
url: "https://github.com/GoodNotes/FoundationEssentialsExtras.git",
29+
revision: "dace29232ec271389cc1e4c4258c8162d1ac3f5f"
30+
),
31+
.package(
32+
url: "https://github.com/compnerd/xylem.git",
33+
revision: "9881c95ce3a139f4ccfa584676201516c2a5751d"
34+
),
35+
],
6836
targets: [
6937
.executableTarget(
7038
name: "GenerateReferencesCLI",
@@ -76,9 +44,30 @@ let package = Package(
7644
),
7745
.target(
7846
name: "SVGView",
79-
dependencies: svgViewDependencies,
47+
dependencies: [
48+
.product(
49+
name: "FoundationEssentialsExtras",
50+
package: "FoundationEssentialsExtras",
51+
condition: .when(platforms: [.wasi])
52+
),
53+
.product(
54+
name: "SAXParser",
55+
package: "xylem",
56+
condition: .when(platforms: [.wasi])
57+
),
58+
.product(
59+
name: "XMLCore",
60+
package: "xylem",
61+
condition: .when(platforms: [.wasi])
62+
),
63+
],
8064
path: "Source",
81-
swiftSettings: svgViewSwiftSettings
65+
swiftSettings: [
66+
.define(
67+
"FOUNDATION_ESSENTIALS_BUILD",
68+
.when(platforms: [.wasi])
69+
),
70+
]
8271
),
8372
.testTarget(
8473
name: "CoreGraphicsPolyfillTests",

0 commit comments

Comments
 (0)