@@ -23,85 +23,81 @@ if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTPM_MACOS_DEP
23
23
macOSPlatform = . macOS( . v10_15)
24
24
}
25
25
26
+ /** A list of products which have two versions listed: one dynamically linked, the other with the
27
+ automatic linking type with `-auto` suffix appended to product's name.
28
+ */
29
+ let autoProducts = [
30
+ // The `libSwiftPM` set of interfaces to programatically work with Swift
31
+ // packages. `libSwiftPM` includes all of the SwiftPM code except the
32
+ // command line tools, while `libSwiftPMDataModel` includes only the data model.
33
+ //
34
+ // NOTE: This API is *unstable* and may change at any time.
35
+ (
36
+ name: " SwiftPM " ,
37
+ targets: [
38
+ " SourceControl " ,
39
+ " SPMLLBuild " ,
40
+ " PackageCollections " ,
41
+ " PackageCollectionsModel " ,
42
+ " LLBuildManifest " ,
43
+ " PackageModel " ,
44
+ " PackageLoading " ,
45
+ " PackageGraph " ,
46
+ " Build " ,
47
+ " Xcodeproj " ,
48
+ " Workspace "
49
+ ]
50
+ ) ,
51
+ (
52
+ name: " SwiftPMDataModel " ,
53
+ targets: [
54
+ " SourceControl " ,
55
+ " PackageCollections " ,
56
+ " PackageCollectionsModel " ,
57
+ " PackageModel " ,
58
+ " PackageLoading " ,
59
+ " PackageGraph " ,
60
+ " Xcodeproj " ,
61
+ " Workspace "
62
+ ]
63
+ )
64
+ ]
65
+
26
66
let package = Package (
27
67
name: " SwiftPM " ,
28
68
platforms: [ macOSPlatform] ,
29
- products: [
30
- // The `libSwiftPM` set of interfaces to programatically work with Swift
31
- // packages. `libSwiftPM` includes all of the SwiftPM code except the
32
- // command line tools, while `libSwiftPMDataModel` includes only the data model.
33
- //
34
- // NOTE: This API is *unstable* and may change at any time.
35
- . library(
36
- name: " SwiftPM " ,
37
- type: . dynamic,
38
- targets: [
39
- " SourceControl " ,
40
- " SPMLLBuild " ,
41
- " PackageCollections " ,
42
- " PackageCollectionsModel " ,
43
- " LLBuildManifest " ,
44
- " PackageModel " ,
45
- " PackageLoading " ,
46
- " PackageGraph " ,
47
- " Build " ,
48
- " Xcodeproj " ,
49
- " Workspace "
50
- ]
51
- ) ,
52
- . library(
53
- name: " SwiftPM-auto " ,
54
- targets: [
55
- " SourceControl " ,
56
- " SPMLLBuild " ,
57
- " LLBuildManifest " ,
58
- " PackageCollections " ,
59
- " PackageCollectionsModel " ,
60
- " PackageModel " ,
61
- " PackageLoading " ,
62
- " PackageGraph " ,
63
- " Build " ,
64
- " Xcodeproj " ,
65
- " Workspace "
66
- ]
67
- ) ,
68
- . library(
69
- name: " SwiftPMDataModel " ,
70
- type: . dynamic,
71
- targets: [
72
- " SourceControl " ,
73
- " PackageCollections " ,
74
- " PackageCollectionsModel " ,
75
- " PackageModel " ,
76
- " PackageLoading " ,
77
- " PackageGraph " ,
78
- " Xcodeproj " ,
79
- " Workspace "
80
- ]
81
- ) ,
82
-
69
+ products:
70
+ autoProducts. flatMap {
71
+ [
72
+ . library(
73
+ name: $0. name,
74
+ type: . dynamic,
75
+ targets: $0. targets
76
+ ) ,
77
+ . library(
78
+ name: " \( $0. name) -auto " ,
79
+ targets: $0. targets
80
+ )
81
+ ] as [ Product ]
82
+ } + [
83
83
. library(
84
84
name: " XCBuildSupport " ,
85
85
targets: [ " XCBuildSupport " ]
86
86
) ,
87
-
88
87
. library(
89
88
name: " PackageDescription " ,
90
89
type: . dynamic,
91
90
targets: [ " PackageDescription " ]
92
91
) ,
93
-
94
92
. library(
95
93
name: " PackagePlugin " ,
96
94
type: . dynamic,
97
95
targets: [ " PackagePlugin " ]
98
96
) ,
99
-
100
97
. library(
101
98
name: " PackageCollectionsModel " ,
102
99
targets: [ " PackageCollectionsModel " ]
103
100
) ,
104
-
105
101
. library(
106
102
name: " SwiftPMPackageCollections " ,
107
103
targets: [
@@ -172,7 +168,7 @@ let package = Package(
172
168
dependencies: [ " SwiftToolsSupport-auto " , " Basics " , " PackageLoading " , " PackageModel " , " SourceControl " ] ) ,
173
169
174
170
// MARK: Package Collections
175
-
171
+
176
172
. target(
177
173
/** Package collections models */
178
174
name: " PackageCollectionsModel " ,
0 commit comments