@@ -540,11 +540,6 @@ extension SwiftPackageTool {
540
540
@Option ( help: " Path to xcconfig file " , completion: . file( ) )
541
541
var xcconfigOverrides : AbsolutePath ?
542
542
543
- @Flag ( name: . customLong( " code-coverage " ) ,
544
- inversion: . prefixedEnableDisable,
545
- help: " Enable code coverage in the generated project " )
546
- var isCodeCoverageEnabled : Bool = false
547
-
548
543
@Option ( name: . customLong( " output " ) ,
549
544
help: " Path where the Xcode project should be generated " )
550
545
var outputPath : AbsolutePath ?
@@ -559,16 +554,6 @@ extension SwiftPackageTool {
559
554
560
555
@Flag ( help: " Do not add file references for extra files to the generated Xcode project " )
561
556
var skipExtraFiles : Bool = false
562
-
563
- func xcodeprojOptions( with buildFlags: BuildFlags ) -> XcodeprojOptions {
564
- XcodeprojOptions (
565
- flags: buildFlags,
566
- xcconfigOverrides: xcconfigOverrides,
567
- isCodeCoverageEnabled: isCodeCoverageEnabled,
568
- useLegacySchemeGenerator: useLegacySchemeGenerator,
569
- enableAutogeneration: enableAutogeneration,
570
- addExtraFiles: !skipExtraFiles)
571
- }
572
557
}
573
558
574
559
@OptionGroup ( )
@@ -577,6 +562,16 @@ extension SwiftPackageTool {
577
562
@OptionGroup ( )
578
563
var options : Options
579
564
565
+ func xcodeprojOptions( ) -> XcodeprojOptions {
566
+ XcodeprojOptions (
567
+ flags: swiftOptions. buildFlags,
568
+ xcconfigOverrides: options. xcconfigOverrides,
569
+ isCodeCoverageEnabled: swiftOptions. shouldEnableCodeCoverage,
570
+ useLegacySchemeGenerator: options. useLegacySchemeGenerator,
571
+ enableAutogeneration: options. enableAutogeneration,
572
+ addExtraFiles: !options. skipExtraFiles)
573
+ }
574
+
580
575
func run( _ swiftTool: SwiftTool ) throws {
581
576
let graph = try swiftTool. loadPackageGraph ( )
582
577
@@ -597,7 +592,7 @@ extension SwiftPackageTool {
597
592
}
598
593
let xcodeprojPath = Xcodeproj . buildXcodeprojPath ( outputDir: dstdir, projectName: projectName)
599
594
600
- var genOptions = options . xcodeprojOptions ( with : swiftOptions . buildFlags )
595
+ var genOptions = xcodeprojOptions ( )
601
596
genOptions. manifestLoader = try swiftTool. getManifestLoader ( )
602
597
603
598
try Xcodeproj . generate (
@@ -616,7 +611,7 @@ extension SwiftPackageTool {
616
611
diagnostics: swiftTool. diagnostics,
617
612
watchmanScriptsDir: swiftTool. buildPath. appending ( component: " watchman " ) ,
618
613
packageRoot: swiftTool. packageRoot!
619
- ) . runXcodeprojWatcher ( options . xcodeprojOptions ( with : swiftOptions . buildFlags ) )
614
+ ) . runXcodeprojWatcher ( xcodeprojOptions ( ) )
620
615
}
621
616
}
622
617
}
0 commit comments