Select the first runnable target (#957)

* Select the first runnable target, if there is one

Instead of just selecting the first target as the scheme target, instead search for and select the first runnable target. If there are no runnables found, then select the first target.

* update docs
This commit is contained in:
Cody Vandermyn
2020-09-29 16:44:53 +10:00
committed by GitHub
parent 775e14c48f
commit 43177dec49
4 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -165,7 +165,8 @@ public class SchemeGenerator {
if let targetName = scheme.run?.executable {
schemeTarget = project.getTarget(targetName)
} else {
schemeTarget = target ?? project.getTarget(scheme.build.targets.first!.target.name)
let name = scheme.build.targets.first { $0.buildTypes.contains(.running) }?.target.name ?? scheme.build.targets.first!.target.name
schemeTarget = target ?? project.getTarget(name)
}
let shouldExecuteOnLaunch = schemeTarget?.shouldExecuteOnLaunch == true