yonaskolb / yonaskolb/XcodeGen
Extension scheme when contains application target
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
When an extension scheme contains application target.
wasCreatedForAppExtension becomes false.
In SchemeGenerator.
if let targetName = scheme.run?.executable {
schemeTarget = project.getTarget(targetName)
} else {
guard let firstTarget = scheme.build.targets.first else {
throw SchemeGenerationError.missingBuildTargets(scheme.name)
}
let name = scheme.build.targets.first { $0.buildTypes.contains(.running) }?.target.name ?? firstTarget.target.name
schemeTarget = target ?? project.getTarget(name)
}
If enables askForAppToLaunch, the scheme.run?.executable is Ask on Launch
So schemeTarget is nil -> wasCreatedForAppExtension is false.
Disable askForAppToLaunch to run else block still not working in this case.
In Project.init(spec:)
spec.resolvedDictionary() sorts targets so the first target is sample not sampleShare.
schemeTarget is sample -> wasCreatedForAppExtension is false.
any suggestions?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in SchemeGenerator and trace how scheme.run.executable and the first resolved build target determine schemeTarget. Reproduce the extension-target case from sample.zip, then inspect Project.init(spec:) and spec.resolvedDictionary() to confirm target ordering. Done means an extension scheme with Ask on Launch or the relevant target selection preserves wasCreatedForAppExtension correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100