Skip to content

Commit 4cf147a

Browse files
committed
Create an Examples-all target that includes all of the example targets in the Examples package
1 parent d14176d commit 4cf147a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Examples/Package.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,19 @@ let package = Package(
4040
),
4141
]
4242
)
43+
44+
// This is a fake target that depends on all targets in the package.
45+
// We need to define it manually because the `Examples-Package` target doesn't exist for `swift build`.
46+
47+
package.targets.append(
48+
.target(
49+
name: "Examples-all",
50+
dependencies: package.targets.compactMap {
51+
if $0.type == .test {
52+
return nil
53+
} else {
54+
return .byName(name: $0.name)
55+
}
56+
}
57+
)
58+
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// This is a fake target that depends on all targets in the package.
2+
// We need to define it manually because the `Examples-Package` target doesn't exist for `swift build`.

0 commit comments

Comments
 (0)