Skip to content

Conversation

@BirmacherAkos
Copy link
Contributor

No description provided.

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{}{}
Copy link
Contributor

@godrei godrei Apr 13, 2018

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)

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))
Copy link
Contributor

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) {
Copy link
Contributor

@godrei godrei Apr 23, 2018

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) {
Copy link
Contributor

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,
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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?

@godrei
Copy link
Contributor

godrei commented Apr 25, 2018

please remove appSelectionError

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{}
Copy link
Contributor

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)
Copy link
Contributor

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{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var installedInstallerCertificates []certificateutil.CertificateInfoModel

@BirmacherAkos
Copy link
Contributor Author

Merged in other PR: #83

@BirmacherAkos BirmacherAkos deleted the birmachera branch July 6, 2018 09:07
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

Successfully merging this pull request may close these issues.

4 participants