Skip to content

Commit 88e39a7

Browse files
committed
fix
1 parent 2b12e3a commit 88e39a7

File tree

1 file changed

+60
-85
lines changed

1 file changed

+60
-85
lines changed

Package.swift

Lines changed: 60 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,13 @@
1010
import CompilerPluginSupport
1111
import PackageDescription
1212

13-
#if os(iOS) || !os(macOS)
14-
var QuickLayoutDependencies: [Target.Dependency] = [
15-
"QuickLayoutMacro",
16-
"QuickLayoutBridge",
17-
]
18-
#else
19-
var QuickLayoutDependencies: [Target.Dependency] = [
20-
"QuickLayoutMacro",
21-
]
22-
#endif
23-
24-
var targets: [Target] = [
25-
.target(
26-
name: "QuickLayout",
27-
dependencies: QuickLayoutDependencies,
28-
path: "Sources/QuickLayout/QuickLayout",
29-
exclude: [
30-
"__showcase__/"
31-
]
32-
),
33-
.macro(
34-
name: "QuickLayoutMacro",
35-
dependencies: [
36-
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
37-
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
38-
],
39-
path: "Sources/QuickLayout/QuickLayoutMacro"
40-
),
41-
.target(
42-
name: "FastResultBuilder",
43-
path: "Sources/FastResultBuilder/FastResultBuilder",
44-
exclude: [
45-
"__tests__/"
46-
]
47-
),
48-
.testTarget(
49-
name: "QuickLayoutMacroTests",
50-
dependencies: [
51-
"QuickLayoutMacro",
52-
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
53-
],
54-
path: "Sources/QuickLayout/QuickLayoutMacroTests"
55-
),
56-
]
57-
58-
var products: [Product] = [
13+
let package = Package(
14+
name: "QuickLayout",
15+
platforms: [
16+
.iOS(.v15),
17+
.macOS(.v10_15),
18+
],
19+
products: [
5920
.library(
6021
name: "QuickLayout",
6122
targets: ["QuickLayout"]
@@ -64,47 +25,61 @@ var products: [Product] = [
6425
name: "FastResultBuilder",
6526
targets: ["FastResultBuilder"]
6627
),
67-
]
68-
69-
// iOS-only targets
70-
#if os(iOS) || !os(macOS)
71-
targets += [
72-
.target(
73-
name: "QuickLayoutCore",
74-
path: "Sources/QuickLayout/QuickLayoutCore"
75-
),
76-
.target(
77-
name: "QuickLayoutBridge",
78-
dependencies: ["FastResultBuilder", "QuickLayoutCore"],
79-
path: "Sources/QuickLayout/QuickLayoutBridge",
80-
exclude: [
81-
"__server_snapshot_tests__",
82-
"__tests__",
83-
]
84-
),
85-
]
86-
87-
products += [
88-
.library(
89-
name: "QuickLayoutCore",
90-
targets: ["QuickLayoutCore"]
91-
),
92-
.library(
93-
name: "QuickLayoutBridge",
94-
targets: ["QuickLayoutBridge"]
95-
),
96-
]
97-
#endif
98-
99-
let package = Package(
100-
name: "QuickLayout",
101-
platforms: [
102-
.iOS(.v15),
103-
.macOS(.v10_15),
10428
],
105-
products: products,
10629
dependencies: [
10730
.package(url: "https://github.com/apple/swift-syntax.git", from: "602.0.0"),
31+
.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", from: "0.6.4"),
10832
],
109-
targets: targets
33+
targets: [
34+
.target(
35+
name: "QuickLayout",
36+
dependencies: [
37+
"QuickLayoutMacro",
38+
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS])),
39+
],
40+
path: "Sources/QuickLayout/QuickLayout",
41+
exclude: [
42+
"__showcase__/"
43+
]
44+
),
45+
.macro(
46+
name: "QuickLayoutMacro",
47+
dependencies: [
48+
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
49+
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
50+
],
51+
path: "Sources/QuickLayout/QuickLayoutMacro"
52+
),
53+
.target(
54+
name: "QuickLayoutCore",
55+
path: "Sources/QuickLayout/QuickLayoutCore"
56+
),
57+
.target(
58+
name: "FastResultBuilder",
59+
path: "Sources/FastResultBuilder/FastResultBuilder",
60+
exclude: [
61+
"__tests__/"
62+
]
63+
),
64+
.target(
65+
name: "QuickLayoutBridge",
66+
dependencies: [
67+
"FastResultBuilder",
68+
.target(name: "QuickLayoutCore", condition: .when(platforms: [.iOS])),
69+
],
70+
path: "Sources/QuickLayout/QuickLayoutBridge",
71+
exclude: [
72+
"__server_snapshot_tests__",
73+
"__tests__",
74+
]
75+
),
76+
.testTarget(
77+
name: "QuickLayoutMacroTests",
78+
dependencies: [
79+
"QuickLayoutMacro",
80+
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
81+
],
82+
path: "Sources/QuickLayout/QuickLayoutMacroTests"
83+
)
84+
]
11085
)

0 commit comments

Comments
 (0)