Skip to content

Commit

Permalink
Remove implicit target argument when running as Xcode plugin (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Gerasymenko <michael.gerasymenko@tamara.co>
  • Loading branch information
mikeger and Michael Gerasymenko authored Oct 1, 2024
1 parent a441576 commit 30e623f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Plugins/SelectiveTestingPlugin/SelectiveTestingPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ struct SelectiveTestingPlugin: CommandPlugin {

var toolArguments = arguments

if let indexOfTarget = toolArguments.firstIndex(of: "--target"),
indexOfTarget != (toolArguments.count - 1) {
toolArguments.remove(at: indexOfTarget + 1)
toolArguments.remove(at: indexOfTarget)
}

if !toolArguments.contains(where: { $0 == "--test-plan" }),
let testPlan = context.xcodeProject.filePaths.first(where: {
$0.extension == "xctestplan"
Expand Down

0 comments on commit 30e623f

Please sign in to comment.