-
Notifications
You must be signed in to change notification settings - Fork 37
Add UI Target support #94
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
Conversation
…n the scanner with each of them;
godrei
left a comment
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.
pls have a look at my notes
…mmand flag, because the xcudeuitests command does not support it yet
…marin command flag, because the xcudeuitests command does not support it yet" This reverts commit 0ae0e55.
|
|
||
| xcodeUITestsCmd.Flags().StringVar(¶mXcodeProjectFilePath, "file", "", "Xcode Project/Workspace file path") | ||
| xcodeUITestsCmd.Flags().StringVar(¶mXcodeScheme, "scheme", "", "Xcode Scheme") | ||
| xcodeUITestsCmd.Flags().StringVar(¶mXcodebuildSDK, "xcodebuild-sdk", "", "xcodebuild -sdk param. If a value is specified for this flag it'll be passed to xcodebuild as the value of the -sdk flag. For more info about the values please see xcodebuild's -sdk flag docs. Example value: iphoneos") |
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.
the definition of the variables paramXcodeProjectFilePath (xcode.go line 31) should be duplicated 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.
They are in the same package: cmd. Because of this there is no need to duplicate them.
And I could not "duplicate" them on the same package without changing the variables' name.
| func extractCertificatesAndProfiles(codeSignGroups ...export.CodeSignGroup) ([]certificateutil.CertificateInfoModel, []profileutil.ProvisioningProfileInfoModel) { | ||
| certificateMap := map[string]certificateutil.CertificateInfoModel{} | ||
| profilesMap := map[string]profileutil.ProvisioningProfileInfoModel{} | ||
| for _, group := range codeSignGroups { |
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.
Why put items a map, if returning array?
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.
Because of the duplications in the array.
Sadly Golang doesn't support Set, so the other solution for this, to create a map with a certificate.Serial of with the profile.UDID for key.
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.
Got it. Found this example, which could be used in the future:
http://www.golangprograms.com/remove-duplicate-values-from-slice.html
| var selectedCertificates []certificateutil.CertificateInfoModel | ||
|
|
||
| // Codesign method | ||
| codesignMethods := []string{"development", "app-store", "ad-hoc", "enterprise"} |
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.
Can this be a const somewhere?
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.
Golang doesn't allow us to create an array / map as a const:
const initializer []string literal is not a constant
https://groups.google.com/forum/#!topic/golang-nuts/5aynucvg96I
godrei
left a comment
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.
pls fix the package lock file, other than that 👊
|
No additional comments. |
lszucs
left a comment
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.
No additional comments
…es; and it will return a new array of selected certs which needed to append to the selectedCertificates later;
Description:
For iOS Real Device Testing we need to generate an .xcterstrun file which was generated for generic/real device.
For this we need a development provisioning profile for the main target and for the UITest target too.
Feature:
Add a new scan option: xcodeuitests
./codesigndoc scan xcodeuitestsThe scanner scans the provided project / workspace:
https://github.com/bitrise-tools/codesigndoc/pull/94/files#diff-977fdc092f258f73dc948cf69e0a2199R37
The scheme is valid if:
https://github.com/bitrise-tools/codesigndoc/pull/94/files#diff-afd3ea939b886556b2101c19dafba29bR174
The user selects the scheme
Run an xcodebuild build-for-testing command for the selected scheme:
Export the codesigning files:
https://github.com/bitrise-tools/codesigndoc/pull/94/files#diff-4d4b5fa386f84d41d927fb07965ea196R53
https://github.com/bitrise-tools/codesigndoc/pull/94/files#diff-e5a906720c9a9db908dbc488cafdeefcR24
The user selects the codesigning files (certs & profiles) for every UITest target in the scheme:
https://github.com/bitrise-tools/codesigndoc/pull/94/files#diff-4d4b5fa386f84d41d927fb07965ea196R124
How to test:

You will need an iOS app with UITest enabled:
Run the
go run *.go scan xcodeuitestsfrom the root dir.Dependencies:
Merge the dependendent PRs first:
bitrise-io/xcode-project#26 ✅
bitrise-io/go-xcode#72 ✅