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

[Feature Request] Share a scheme created when duplicating a target. #28

Open
mgrebenets opened this issue Sep 25, 2013 · 4 comments
Open

Comments

@mgrebenets
Copy link

Hi.

I happen to use XcodeEditor, but not directly. I am using Calabash for iOS for automation tests, and calabash is using XcodeEditor. They have calabash-ios setup command, which does the following

  • Duplicate an existing target (say "MyTarget") and name it using "-cal" suffix, say "MyTarget-cal"
  • Add calabash.framework to newly created target
  • Modify "Other Linker Flags" for "MyTarget-cal"
    All that using XcodeEditor.

When new target is created, a new scheme appears in the Xcode as well, in my case it's "MyTarget-cal" scheme.

So, the problem is that newly created scheme is not shared.
If I go to "Manage Schemes" Xcode menu, the "MyTarget-cal" scheme will not have checkmark in "Shared" column, even if the original "MyTarget" scheme had it.

Why that matters?
It is not a problem when building from Xcode and when using xcodebuild from command line on dev machine.
But that becomes a real problem when trying to build from CI environment, such as Bamboo or Jenkins.
It's a known issue, Bamboo and Jenkins run their shell scripts in a specific environment, under some special user. So when Bamboo runs xcodebuild -project MyProject.xcodeproj -scheme MyTarget-cal the xcodebuild will complain that the project does not have "MyTarget-cal" scheme. To put it another way, Bamboo and Jenkins can't "see" scheme unless it's shared. That's why having a shared scheme is important for CI builds.

Most of Xcode projects can be build using only configuration, target and sdk options, but if it's an Xcode workspace with lot's of libraries, sub-projects and custom frameworks, building using -scheme option is the only way to build it from command line properly.

I've done some research around the shared schemes.
If the scheme is shared in Xcode, then it will appear in MyProject.xcodeproj/xcsharedata/xcschemes, for each scheme there will be a .xcscheme file, like "MyTarget.xcscheme", "MyTarget-cal.xcscheme".
But that folder and its contents are created only when the project is opened in Xcode, looks like Xcode generates those folders and files.
When the whole thing is done on CI box, none of those folders and files will be created.

The only place I can find mention of "MyTarget-cal" target and scheme is in "MyProject.xcodeproj/project.pbxproj" file.
I assume there's a way to extract information about "MyTarget-cal" scheme from pbxproj file and create "MyTarget-cal.xcscheme" and put it under "xcshareddata/xcschemes", at least Xcode does that somehow.

@jasperblues
Copy link
Member

We can easily add this feature to XcodeEditor, however Calabase are unfortunately on their own old fork of XcodeEditor. . . So in this case, I think you'd have to ask them to either:

a) Bring their fork up to date with master. .
b) Implement the feature for you.

@mgrebenets
Copy link
Author

I believe your refer to this one: https://github.com/calabash/xcode-editor
It's seems quite out of date and the things in this repo do not actually match their latest executable.

It would still be nice to have such a feature with XcodeEditor, there's number of cases when it could be useful, like adding Reveal framework automatically and making new scheme shared.

@nmkp17
Copy link

nmkp17 commented May 27, 2014

For me when I did calabash-ios setup on the source code, it's not creating the cal scheme. Also I didn't get any error. In Xcode also i couldn't find the cal scheme.

@jasperblues
Copy link
Member

I believe the scheme info is stored in another file under the .xcodeproj directory. Again this would be a fairly simple feature to add. . . I'm afraid that lately I'm just so busy with my regular work and typhoonframework.org

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

3 participants