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

action_name, authors, output, return_value, sh, step_text

Class Method Details

.authorObject



47
48
49
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 47

def self.author
  "KrauseFx"
end

.available_optionsObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 32

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
                                 description: "Path to your Xcode project",
                                 verify_block: proc do |value|
                                   UI.user_error!("Path is invalid") unless File.exist?(value)
                                 end),
    FastlaneCore::ConfigItem.new(key: :udid,
                                 env_name: "FL_PROJECT_SIGNING_UDID",
                                 description: "The UDID of the provisioning profile you want to use",
                                 default_value: ENV["SIGH_UDID"])
  ]
end

.descriptionObject



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

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

.detailsObject



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

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 51

def self.is_supported?(platform)
  platform == :ios
end

.run(params) ⇒ Object



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

def self.run(params)
  UI.message("You shouldn't use update_project_code_signing")
  UI.message("Have you considered using the recommended way to do code sining?")
  UI.message("https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md")

  path = params[:path]
  path = File.join(path, "project.pbxproj")
  UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)

  UI.message("Updating provisioning profile UDID (#{params[:udid]}) for the given project '#{path}'")

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

  UI.success("Successfully updated project settings to use UDID '#{params[:udid]}'")
end