-
Notifications
You must be signed in to change notification settings - Fork 14
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
Xcode schemes #207
Xcode schemes #207
Conversation
|
||
return tmpDir | ||
} | ||
|
||
// GitCloneBranch clones a branch from a git repository into an existing directory | ||
func GitCloneBranch(t *testing.T, repo string, branch string, dir string) { | ||
cmd := command.New("git", "clone", "-b", branch, repo, dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it's worth adding --depth=1
for fast tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in: 473d0c3
|
||
func (p XcodeProj) userSchemesDir() (string, error) { | ||
// <project_name>.xcodeproj/xcuserdata/<current_user>.xcuserdatad/xcschemes/ | ||
currentUser, err := user.Current() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to check for the current user only, if running in a CI env?
I assume in most cases schemes would be recreated if a specific user schema would not be found, so maybe would not break for most people who relied on the previous version that did not consider the current user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should follow how Xcode behaves, to avoid confusion.
I don't think it is too frequent, that you intentionally make a scheme not shared and then customize it.
Also, steps and tools depending on this package might be running locally too (this is probably the minority of uses, but still I think we should consider it), not just in CI.
} | ||
|
||
var settings serialized.Object | ||
if _, err := plist.Unmarshal(workspaceSettingsContent, &settings); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: are we ignoring directories, symlinks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work.
Context
Our tooling (go-xcode libs, ios steps, and project scanner) expects shared schemes to be placed in the project's shared data directory (
<project_name>.xcodeproj/xcshareddata/xcschemes
) as a.xcscheme
file.This expectation is not necessarily valid, by default Xcode projects are generated with a shared scheme, but this scheme isn't in the shared data dir as a scheme file. The scheme file gets generated when you modify any scheme related setting, but Xcode works well without it.
This PR updates the
xcodeproject
package's scheme management to make it more similar to how Xcode handles schemes.Related ticket: https://bitrise.atlassian.net/browse/BIVS-2082
Changes
1, New scheme listing logic
The visible schemes are the project's shared and user schemes (of the current user). Other user's schemes are not considered by Xcode.
The default schemes are not living as xcscheme files, but Xcode stores information about them under the current user's
xcschememanagement.plist
.If the project doesn't have any visible schemes, Xcode recreates the default schemes unless the 'Autocreate schemes' option is disabled. If this option is disabled, Xcode presents a 'No schemes’ message and no actions are available.
In the case of workspaces, the logic is pretty much the same, but the 'Autocreate schemes' option is stored under the workspace and the same project level options are not considered.
2, Missing properties added to the scheme data model
The
skipped
andparallelizable
fields were missing from theTestableReference
. Because the package works with complete data models, I just added them, but they aren't used by the code.The
shouldAutocreateTestPlan
was also added to theTestAction
, in a follow-up PR we might update Test Plan handling, to utilize this new property.