Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension scheme when contains application target #1523

Open
xxi511 opened this issue Dec 23, 2024 · 0 comments
Open

Extension scheme when contains application target #1523

xxi511 opened this issue Dec 23, 2024 · 0 comments

Comments

@xxi511
Copy link

xxi511 commented Dec 23, 2024

sample.zip

When an extension scheme contains application target.
wasCreatedForAppExtension becomes false.
Screenshot 2024-12-23 at 14 58 24

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant