@@ -60,13 +60,13 @@ extension PackageGraph {
60
60
// Evaluate each plugin in turn, creating a list of results (one for each plugin used by the target).
61
61
var evalResults : [ PluginInvocationResult ] = [ ]
62
62
for pluginTarget in pluginTargets {
63
- // Give each invocation of an extension a separate output directory.
64
- let extOutputDir = outputDir. appending ( components: package . name, target. name, pluginTarget. name)
63
+ // Give each invocation of a plugin a separate output directory.
64
+ let pluginOutputDir = outputDir. appending ( components: package . name, target. name, pluginTarget. name)
65
65
do {
66
- try fileSystem. createDirectory ( extOutputDir , recursive: true )
66
+ try fileSystem. createDirectory ( pluginOutputDir , recursive: true )
67
67
}
68
68
catch {
69
- throw PluginEvaluationError . outputDirectoryCouldNotBeCreated ( path: extOutputDir , underlyingError: error)
69
+ throw PluginEvaluationError . outputDirectoryCouldNotBeCreated ( path: pluginOutputDir , underlyingError: error)
70
70
}
71
71
72
72
// Create the input context to pass to the plugin.
@@ -81,7 +81,7 @@ extension PackageGraph {
81
81
dependencies: dependencyTargets. map {
82
82
. init( targetName: $0. name, moduleName: $0. c99name, targetDir: $0. sources. root. pathString)
83
83
} ,
84
- outputDir: extOutputDir . pathString,
84
+ outputDir: pluginOutputDir . pathString,
85
85
toolsDir: execsDir. pathString
86
86
)
87
87
@@ -165,24 +165,6 @@ extension PackageGraph {
165
165
return evalResultsByTarget
166
166
}
167
167
168
- @available ( * , deprecated, message: " used evaluationPlugins() instead " )
169
- public func evaluateExtensions(
170
- buildEnvironment: BuildEnvironment ,
171
- execsDir: AbsolutePath ,
172
- outputDir: AbsolutePath ,
173
- extensionRunner: PluginScriptRunner ,
174
- diagnostics: DiagnosticsEngine ,
175
- fileSystem: FileSystem
176
- ) throws -> [ ResolvedTarget : [ PluginInvocationResult ] ] {
177
- return try self . invokePlugins (
178
- buildEnvironment: buildEnvironment,
179
- execsDir: execsDir,
180
- outputDir: outputDir,
181
- pluginScriptRunner: extensionRunner,
182
- diagnostics: diagnostics,
183
- fileSystem: fileSystem)
184
- }
185
-
186
168
187
169
/// Private helper function that serializes a PluginEvaluationInput as input JSON, calls the plugin runner to invoke the plugin, and finally deserializes the output JSON it emits to a PluginEvaluationOutput. Adds any errors or warnings to `diagnostics`, and throws an error if there was a failure.
188
170
/// FIXME: This should be asynchronous, taking a queue and a completion closure.
@@ -282,7 +264,6 @@ public struct PluginInvocationResult {
282
264
/// Any textual output emitted by the plugin.
283
265
public var textOutput : String
284
266
}
285
- public typealias ExtensionEvaluationResult = PluginInvocationResult
286
267
287
268
288
269
/// An error in plugin evaluation.
@@ -291,7 +272,6 @@ public enum PluginEvaluationError: Swift.Error {
291
272
case runningPluginFailed( underlyingError: Error )
292
273
case decodingPluginOutputFailed( json: Data , underlyingError: Error )
293
274
}
294
- public typealias ExtensionEvaluationError = PluginEvaluationError
295
275
296
276
297
277
/// Implements the mechanics of running a plugin script (implemented as a set of Swift source files) as a process.
@@ -315,50 +295,10 @@ public protocol PluginScriptRunner {
315
295
diagnostics: DiagnosticsEngine ,
316
296
fileSystem: FileSystem
317
297
) throws -> ( outputJSON: Data , stdoutText: Data )
318
-
319
- @available ( * , deprecated, message: " use runPluginScript() instead " )
320
- func runExtension(
321
- sources: Sources ,
322
- inputJSON: Data ,
323
- toolsVersion: ToolsVersion ,
324
- diagnostics: DiagnosticsEngine ,
325
- fileSystem: FileSystem
326
- ) throws -> ( outputJSON: Data , stdoutText: Data )
327
- }
328
- extension PluginScriptRunner {
329
- public func runPluginScript(
330
- sources: Sources ,
331
- inputJSON: Data ,
332
- toolsVersion: ToolsVersion ,
333
- diagnostics: DiagnosticsEngine ,
334
- fileSystem: FileSystem
335
- ) throws -> ( outputJSON: Data , stdoutText: Data ) {
336
- return try self . runExtension (
337
- sources: sources,
338
- inputJSON: inputJSON,
339
- toolsVersion: toolsVersion,
340
- diagnostics: diagnostics,
341
- fileSystem: fileSystem)
342
- }
343
- public func runExtension(
344
- sources: Sources ,
345
- inputJSON: Data ,
346
- toolsVersion: ToolsVersion ,
347
- diagnostics: DiagnosticsEngine ,
348
- fileSystem: FileSystem
349
- ) throws -> ( outputJSON: Data , stdoutText: Data ) {
350
- return try self . runPluginScript (
351
- sources: sources,
352
- inputJSON: inputJSON,
353
- toolsVersion: toolsVersion,
354
- diagnostics: diagnostics,
355
- fileSystem: fileSystem)
356
- }
357
298
}
358
- public typealias ExtensionRunner = PluginScriptRunner
359
299
360
300
361
- /// Serializable context that's passed as input to the evaluation of the extension .
301
+ /// Serializable context that's passed as input to the invocation of the plugin .
362
302
struct PluginScriptRunnerInput : Codable {
363
303
var targetName : String
364
304
var moduleName : String
@@ -378,7 +318,7 @@ struct PluginScriptRunnerInput: Codable {
378
318
}
379
319
380
320
381
- /// Deserializable result that's received as output from the evaluation of the extension .
321
+ /// Deserializable result that's received as output from the invocation of the plugin .
382
322
struct PluginScriptRunnerOutput : Codable {
383
323
var version : Int
384
324
var diagnostics : [ Diagnostic ]
0 commit comments