Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
Support for mulitple certificates for development profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed Jul 5, 2015
1 parent ae8eda0 commit 1cecd12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/spaceship/provisioning_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def pretty_type
# @param name (String): The name of the provisioning profile on the Dev Portal
# @param bundle_id (String): The app identifier, this paramter is required
# @param certificate (Certificate): The certificate that should be used with this
# provisioning profile
# provisioning profile. You can also pass an array of certificates to this method. This will
# only work for development profiles
# @param devices (Array) (optional): An array of Device objects that should be used in this profile.
# It is recommend to not pass devices as spaceship will automatically add all devices for AdHoc
# and Development profiles and add none for AppStore and Enterprise Profiles
Expand All @@ -202,6 +203,9 @@ def create!(name: nil, bundle_id: nil, certificate: nil, devices: [])

devices = [] if self == AppStore # App Store Profiles MUST NOT have devices

certificate_parameter = certificate.collect { |c| c.id } if certificate.kind_of?Array
certificate_parameter ||= [certificate.id]

if devices.nil? or devices.count == 0
if self == Development or self == AdHoc
# For Development and AdHoc we usually want all devices by default
Expand All @@ -212,7 +216,7 @@ def create!(name: nil, bundle_id: nil, certificate: nil, devices: [])
profile = client.create_provisioning_profile!(name,
self.type,
app.app_id,
[certificate.id],
certificate_parameter,
devices.map {|d| d.id} )
self.new(profile)
end
Expand Down

0 comments on commit 1cecd12

Please sign in to comment.