Class: Fastlane::Actions::UpdateProjectCodeSigningAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/update_project_code_signing.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

available_options, output, sh

Class Method Details

.authorObject



31
32
33
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 31

def self.author
  "KrauseFx"
end

.descriptionObject



23
24
25
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 23

def self.description
  "Updated code signing settings from 'Automatic' to a specific profile"
end

.detailsObject



27
28
29
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 27

def self.details
  "This feature is not yet 100% finished"
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 7

def self.run(params)
  path = params.first
  path = File.join(path, "project.pbxproj")
  raise "Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!".red unless File.exists?(path)

  udid = (params[1] rescue nil)
  udid ||= ENV["SIGH_UDID"]

  Helper.log.info("Updating provisioning profile UDID (#{udid}) for the given project '#{path}'")

  p = File.read(path)
  File.write(path, p.gsub(/PROVISIONING_PROFILE = ".*";/, "PROVISIONING_PROFILE = \"#{udid}\";"))

  Helper.log.info("Successfully updated project settings to use UDID '#{udid}'".green)
end