@@ -21,52 +21,55 @@ public enum BuildDescriptionError: Swift.Error {
21
21
case requestedFileNotPartOfTarget( targetName: String , requestedFilePath: AbsolutePath )
22
22
}
23
23
24
- /// A target description which can either be for a Swift or Clang target.
25
- public enum TargetBuildDescription {
24
+ @available ( * , deprecated, renamed: " ModuleBuildDescription " )
25
+ public typealias TargetBuildDescription = ModuleBuildDescription
26
+
27
+ /// A module build description which can either be for a Swift or Clang module.
28
+ public enum ModuleBuildDescription {
26
29
/// Swift target description.
27
- case swift( SwiftTargetBuildDescription )
30
+ case swift( SwiftModuleBuildDescription )
28
31
29
32
/// Clang target description.
30
- case clang( ClangTargetBuildDescription )
33
+ case clang( ClangModuleBuildDescription )
31
34
32
35
/// The objects in this target.
33
36
var objects : [ AbsolutePath ] {
34
37
get throws {
35
38
switch self {
36
- case . swift( let target ) :
37
- return try target . objects
38
- case . clang( let target ) :
39
- return try target . objects
39
+ case . swift( let module ) :
40
+ return try module . objects
41
+ case . clang( let module ) :
42
+ return try module . objects
40
43
}
41
44
}
42
45
}
43
46
44
47
/// The resources in this target.
45
48
var resources : [ Resource ] {
46
49
switch self {
47
- case . swift( let target ) :
48
- return target . resources
49
- case . clang( let target ) :
50
- return target . resources
50
+ case . swift( let buildDescription ) :
51
+ return buildDescription . resources
52
+ case . clang( let buildDescription ) :
53
+ return buildDescription . resources
51
54
}
52
55
}
53
56
54
57
/// Path to the bundle generated for this module (if any).
55
58
var bundlePath : AbsolutePath ? {
56
59
switch self {
57
- case . swift( let target ) :
58
- return target . bundlePath
59
- case . clang( let target ) :
60
- return target . bundlePath
60
+ case . swift( let buildDescription ) :
61
+ return buildDescription . bundlePath
62
+ case . clang( let buildDescription ) :
63
+ return buildDescription . bundlePath
61
64
}
62
65
}
63
66
64
67
var target : ResolvedModule {
65
68
switch self {
66
- case . swift( let target ) :
67
- return target . target
68
- case . clang( let target ) :
69
- return target . target
69
+ case . swift( let buildDescription ) :
70
+ return buildDescription . target
71
+ case . clang( let buildDescription ) :
72
+ return buildDescription . target
70
73
}
71
74
}
72
75
@@ -82,46 +85,46 @@ public enum TargetBuildDescription {
82
85
83
86
var resourceBundleInfoPlistPath : AbsolutePath ? {
84
87
switch self {
85
- case . swift( let target ) :
86
- return target . resourceBundleInfoPlistPath
87
- case . clang( let target ) :
88
- return target . resourceBundleInfoPlistPath
88
+ case . swift( let buildDescription ) :
89
+ return buildDescription . resourceBundleInfoPlistPath
90
+ case . clang( let buildDescription ) :
91
+ return buildDescription . resourceBundleInfoPlistPath
89
92
}
90
93
}
91
94
92
95
var buildToolPluginInvocationResults : [ BuildToolPluginInvocationResult ] {
93
96
switch self {
94
- case . swift( let target ) :
95
- return target . buildToolPluginInvocationResults
96
- case . clang( let target ) :
97
- return target . buildToolPluginInvocationResults
97
+ case . swift( let buildDescription ) :
98
+ return buildDescription . buildToolPluginInvocationResults
99
+ case . clang( let buildDescription ) :
100
+ return buildDescription . buildToolPluginInvocationResults
98
101
}
99
102
}
100
103
101
104
var buildParameters : BuildParameters {
102
105
switch self {
103
- case . swift( let swiftTargetBuildDescription ) :
104
- return swiftTargetBuildDescription . buildParameters
105
- case . clang( let clangTargetBuildDescription ) :
106
- return clangTargetBuildDescription . buildParameters
106
+ case . swift( let buildDescription ) :
107
+ return buildDescription . buildParameters
108
+ case . clang( let buildDescription ) :
109
+ return buildDescription . buildParameters
107
110
}
108
111
}
109
112
110
113
var toolsVersion : ToolsVersion {
111
114
switch self {
112
- case . swift( let swiftTargetBuildDescription ) :
113
- return swiftTargetBuildDescription . toolsVersion
114
- case . clang( let clangTargetBuildDescription ) :
115
- return clangTargetBuildDescription . toolsVersion
115
+ case . swift( let buildDescription ) :
116
+ return buildDescription . toolsVersion
117
+ case . clang( let buildDescription ) :
118
+ return buildDescription . toolsVersion
116
119
}
117
120
}
118
121
119
122
/// Determines the arguments needed to run `swift-symbolgraph-extract` for
120
123
/// this module.
121
124
package func symbolGraphExtractArguments( ) throws -> [ String ] {
122
125
switch self {
123
- case . swift( let target ) : try target . symbolGraphExtractArguments ( )
124
- case . clang( let target ) : try target . symbolGraphExtractArguments ( )
126
+ case . swift( let buildDescription ) : try buildDescription . symbolGraphExtractArguments ( )
127
+ case . clang( let buildDescription ) : try buildDescription . symbolGraphExtractArguments ( )
125
128
}
126
129
}
127
130
}
0 commit comments