-
Notifications
You must be signed in to change notification settings - Fork 37
MacOS archive fix #73
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
cmd/common.go
Outdated
| func collectIpaExportCodeSignGroups(tool Tool, archive xcarchive.IosArchive, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel) ([]export.IosCodeSignGroup, error) { | ||
| iosCodeSignGroups := []export.IosCodeSignGroup{} | ||
| func collectIpaExportCodeSignGroups(tool Tool, archive Archive, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel) ([]interface{}, error) { | ||
| iosCodeSignGroups := []interface{}{} |
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.
this is not the best.
i think we should introduce a new interface for the codesigngroups.
I would modify the ios and macos codesigngroups.
Both have the same properties:
Certificate certificateutil.CertificateInfoModel
BundleIDProfileMap map[string]profileutil.ProvisioningProfileInfoModel
make them unexported and create a function to access them.
macos has an extra field:
InstallerCertificate *certificateutil.CertificateInfoModel
i would recommend to also make this unexported and create an accessor function for this and also create it for ios and always return nil. This way we can define a common interface for them:
Also if we add IsMacos function to the structs and to the interface it would be cast them later.
Codesigngroup {
Certificate() certificateutil.CertificateInfoModel
BundleIDProfileMap() map[string]profileutil.ProvisioningProfileInfoModel
InstallerCertificate() *certificateutil.CertificateInfoModel
}
cmd/common.go
Outdated
| BundleIDProfileMap: selectedBundleIDProfileMap, | ||
| var collectedCodeSignGroup export.CodeSignGroup | ||
| if isMacArchive { | ||
| collectedCodeSignGroup = export.NewMacGroup(*selectedCertificate, nil, selectedBundleIDProfileMap) |
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.
we should handle the installerCertificate for mac as well
cmd/common.go
Outdated
| fmt.Println() | ||
| fmt.Println() | ||
| log.Infof("Codesign settings will be used for %s ipa export:", exportMethod(iosCodeSignGroup)) | ||
| log.Infof("Codesign settings will be used for %s ipa export:", exportMethod(collectedCodeSignGroup)) |
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.
in case of macos, we do not export and ipa file.
| return nil | ||
| } | ||
|
|
||
| func getFilesToExport(archivePath string, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel, tool Tool) ([]certificateutil.CertificateInfoModel, []profileutil.ProvisioningProfileInfoModel, error) { |
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.
should handle the macos installer certificate as well?
cmd/common.go
Outdated
| return certificatesToExport, profilesToExport, nil | ||
| } | ||
|
|
||
| func exportCertificatesOnly(tool Tool, certificate certificateutil.CertificateInfoModel, installedCertificates []certificateutil.CertificateInfoModel, certificatesToExport []certificateutil.CertificateInfoModel) ([]certificateutil.CertificateInfoModel, error) { |
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 is it moved to a separate function?
cmd/common.go
Outdated
| return certificatesToExport, profilesToExport, nil | ||
| } | ||
|
|
||
| func exportCertificatesAndProfiles(macOS bool, archive Archive, tool Tool, certificate certificateutil.CertificateInfoModel, |
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.
it just collects, but not exports these files
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.
macOS can be detected based on the archive, no need for this input.
cmd/common.go
Outdated
| return nil, nil, err | ||
| } | ||
|
|
||
| var ipaExportCodeSignGroups []export.CodeSignGroup |
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.
there is no ipa in case of macos, use just exportCodesignGroup for ex.
| ) | ||
|
|
||
| func extractCertificatesAndProfiles(codeSignGroups ...export.IosCodeSignGroup) ([]certificateutil.CertificateInfoModel, []profileutil.ProvisioningProfileInfoModel) { | ||
| func extractCertificatesAndProfiles(codeSignGroups ...export.CodeSignGroup) ([]certificateutil.CertificateInfoModel, []profileutil.ProvisioningProfileInfoModel) { |
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.
should handle installer certs as well
| return certificatesByTeam | ||
| } | ||
|
|
||
| func getIOSCodeSignGroup(archivePath string, installedCertificates []certificateutil.CertificateInfoModel) (xcarchive.IosArchive, *export.IosCodeSignGroup, error) { |
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 is there separate function for getIOSCodeSignGroup and getMacOSCodeSignGroup?
cmd/utils.go
Outdated
| return codeSignGroups | ||
| } | ||
|
|
||
| func analyzeArchive(signingIdentity string, bundleIDProfileInfoMap map[string]profileutil.ProvisioningProfileInfoModel, installedCertificates []certificateutil.CertificateInfoModel) (certificateutil.CertificateInfoModel, map[string]profileutil.ProvisioningProfileInfoModel, error) { |
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.
do we need this function?
|
please remove |
| func collectIpaExportCodeSignGroups(tool Tool, archive xcarchive.IosArchive, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel) ([]export.IosCodeSignGroup, error) { | ||
| iosCodeSignGroups := []export.IosCodeSignGroup{} | ||
| func collectIpaExportCodeSignGroups(tool Tool, archive Archive, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel) ([]export.CodeSignGroup, error) { | ||
| collectedCodeSignGroups := []export.CodeSignGroup{} |
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.
var collectedCodeSignGroups []export.CodeSignGroup
| iosCodeSignGroups := []export.IosCodeSignGroup{} | ||
| func collectIpaExportCodeSignGroups(tool Tool, archive Archive, installedCertificates []certificateutil.CertificateInfoModel, installedProfiles []profileutil.ProvisioningProfileInfoModel) ([]export.CodeSignGroup, error) { | ||
| collectedCodeSignGroups := []export.CodeSignGroup{} | ||
| _, isMacArchive := archive.(xcarchive.MacosArchive) |
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.
in case of macos export we have different possible export methods: https://github.com/bitrise-steplib/steps-xcode-archive-mac/blob/master/step.yml#L40
| BundleIDProfileMap: selectedBundleIDProfileMap, | ||
| var collectedCodeSignGroup export.CodeSignGroup | ||
| if isMacArchive { | ||
| installedInstallerCertificates := []certificateutil.CertificateInfoModel{} |
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.
var installedInstallerCertificates []certificateutil.CertificateInfoModel
|
Merged in other PR: #83 |
No description provided.