@@ -92,14 +92,14 @@ struct PackageToJSPlugin: CommandPlugin {
92
92
// Build products
93
93
let productName = try buildOptions. product ?? deriveDefaultProduct ( package : context. package )
94
94
let build = try buildWasm (
95
- productName: productName, context: context, options : buildOptions . options )
95
+ productName: productName, context: context)
96
96
guard build. succeeded else {
97
97
reportBuildFailure ( build, arguments)
98
98
exit ( 1 )
99
99
}
100
100
let productArtifact = try build. findWasmArtifact ( for: productName)
101
101
let outputDir =
102
- if let outputPath = buildOptions. options . outputPath {
102
+ if let outputPath = buildOptions. packageOptions . outputPath {
103
103
URL ( fileURLWithPath: outputPath)
104
104
} else {
105
105
context. pluginWorkDirectoryURL. appending ( path: " Package " )
@@ -111,11 +111,11 @@ struct PackageToJSPlugin: CommandPlugin {
111
111
throw PackageToJSError ( " Failed to find JavaScriptKit in dependencies!? " )
112
112
}
113
113
var make = MiniMake (
114
- explain: buildOptions. options . explain,
114
+ explain: buildOptions. packageOptions . explain,
115
115
printProgress: self . printProgress
116
116
)
117
117
let planner = PackagingPlanner (
118
- options: buildOptions. options , context: context, selfPackage: selfPackage,
118
+ options: buildOptions. packageOptions , context: context, selfPackage: selfPackage,
119
119
outputDir: outputDir)
120
120
let rootTask = try planner. planBuild (
121
121
make: & make, splitDebug: buildOptions. splitDebug, wasmProductArtifact: productArtifact)
@@ -143,7 +143,7 @@ struct PackageToJSPlugin: CommandPlugin {
143
143
144
144
let productName = " \( context. package . displayName) PackageTests "
145
145
let build = try buildWasm (
146
- productName: productName, context: context, options : testOptions . options )
146
+ productName: productName, context: context)
147
147
guard build. succeeded else {
148
148
reportBuildFailure ( build, arguments)
149
149
exit ( 1 )
@@ -169,7 +169,7 @@ struct PackageToJSPlugin: CommandPlugin {
169
169
" Failed to find ' \( productName) .wasm' or ' \( productName) .xctest' " )
170
170
}
171
171
let outputDir =
172
- if let outputPath = testOptions. options . outputPath {
172
+ if let outputPath = testOptions. packageOptions . outputPath {
173
173
URL ( fileURLWithPath: outputPath)
174
174
} else {
175
175
context. pluginWorkDirectoryURL. appending ( path: " PackageTests " )
@@ -181,11 +181,11 @@ struct PackageToJSPlugin: CommandPlugin {
181
181
throw PackageToJSError ( " Failed to find JavaScriptKit in dependencies!? " )
182
182
}
183
183
var make = MiniMake (
184
- explain: testOptions. options . explain,
184
+ explain: testOptions. packageOptions . explain,
185
185
printProgress: self . printProgress
186
186
)
187
187
let planner = PackagingPlanner (
188
- options: testOptions. options , context: context, selfPackage: selfPackage,
188
+ options: testOptions. packageOptions , context: context, selfPackage: selfPackage,
189
189
outputDir: outputDir)
190
190
let ( rootTask, binDir) = try planner. planTestBuild (
191
191
make: & make, wasmProductArtifact: productArtifact)
@@ -230,7 +230,7 @@ struct PackageToJSPlugin: CommandPlugin {
230
230
}
231
231
}
232
232
233
- private func buildWasm( productName: String , context: PluginContext , options : PackageToJS . PackageOptions ) throws
233
+ private func buildWasm( productName: String , context: PluginContext ) throws
234
234
-> PackageManager . BuildResult
235
235
{
236
236
var parameters = PackageManager . BuildParameters (
@@ -300,8 +300,8 @@ extension PackageToJS.BuildOptions {
300
300
static func parse( from extractor: inout ArgumentExtractor ) -> PackageToJS . BuildOptions {
301
301
let product = extractor. extractOption ( named: " product " ) . last
302
302
let splitDebug = extractor. extractFlag ( named: " split-debug " )
303
- let options = PackageToJS . PackageOptions. parse ( from: & extractor)
304
- return PackageToJS . BuildOptions ( product: product, splitDebug: splitDebug != 0 , options : options )
303
+ let packageOptions = PackageToJS . PackageOptions. parse ( from: & extractor)
304
+ return PackageToJS . BuildOptions ( product: product, splitDebug: splitDebug != 0 , packageOptions : packageOptions )
305
305
}
306
306
307
307
static func help( ) -> String {
@@ -338,10 +338,10 @@ extension PackageToJS.TestOptions {
338
338
let buildOnly = extractor. extractFlag ( named: " build-only " )
339
339
let listTests = extractor. extractFlag ( named: " list-tests " )
340
340
let filter = extractor. extractOption ( named: " filter " )
341
- let options = PackageToJS . PackageOptions. parse ( from: & extractor)
341
+ let packageOptions = PackageToJS . PackageOptions. parse ( from: & extractor)
342
342
return PackageToJS . TestOptions (
343
343
buildOnly: buildOnly != 0 , listTests: listTests != 0 ,
344
- filter: filter, options : options
344
+ filter: filter, packageOptions : packageOptions
345
345
)
346
346
}
347
347
0 commit comments