Class: FastlaneCore::ProvisioningProfile
- Inherits:
-
Object
- Object
- FastlaneCore::ProvisioningProfile
- Defined in:
- fastlane_core/lib/fastlane_core/provisioning_profile.rb
Class Method Summary collapse
-
.install(path, keychain_path = nil) ⇒ Object
Installs a provisioning profile for Xcode to use.
- .mac?(path, keychain_path = nil) ⇒ Boolean
-
.name(path, keychain_path = nil) ⇒ String
The Name of the given provisioning profile.
-
.parse(path, keychain_path = nil) ⇒ Hash
The hash with the data of the provisioning profile.
- .profile_filename(path, keychain_path = nil) ⇒ Object
- .profiles_path ⇒ Object
-
.uuid(path, keychain_path = nil) ⇒ String
The UUID of the given provisioning profile.
Class Method Details
.install(path, keychain_path = nil) ⇒ Object
Installs a provisioning profile for Xcode to use
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 71 def install(path, keychain_path = nil) UI.("Installing provisioning profile...") destination = File.join(profiles_path, profile_filename(path, keychain_path)) if path != destination # copy to Xcode provisioning profile directory FileUtils.copy(path, destination) unless File.exist?(destination) UI.user_error!("Failed installation of provisioning profile at location: '#{destination}'") end end destination end |
.mac?(path, keychain_path = nil) ⇒ Boolean
47 48 49 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 47 def mac?(path, keychain_path = nil) parse(path, keychain_path).fetch("Platform", []).include?('OSX') end |
.name(path, keychain_path = nil) ⇒ String
Returns The Name of the given provisioning profile.
43 44 45 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 43 def name(path, keychain_path = nil) parse(path, keychain_path).fetch("Name") end |
.parse(path, keychain_path = nil) ⇒ Hash
Returns The hash with the data of the provisioning profile.
26 27 28 29 30 31 32 33 34 35 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 26 def parse(path, keychain_path = nil) require 'plist' plist = Plist.parse_xml(decode(path, keychain_path)) if (plist || []).count > 5 plist else UI.crash!("Error parsing provisioning profile at path '#{path}'") end end |
.profile_filename(path, keychain_path = nil) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 51 def profile_filename(path, keychain_path = nil) basename = uuid(path, keychain_path) if mac?(path, keychain_path) basename + ".provisionprofile" else basename + ".mobileprovision" end end |
.profiles_path ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 60 def profiles_path path = File.("~") + "/Library/MobileDevice/Provisioning Profiles/" # If the directory doesn't exist, create it first unless File.directory?(path) FileUtils.mkdir_p(path) end return path end |
.uuid(path, keychain_path = nil) ⇒ String
Returns The UUID of the given provisioning profile.
38 39 40 |
# File 'fastlane_core/lib/fastlane_core/provisioning_profile.rb', line 38 def uuid(path, keychain_path = nil) parse(path, keychain_path).fetch("UUID") end |