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