Class: Fastlane::Actions::UpdateProjectCodeSigningAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject


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

def self.author
  "KrauseFx"
end

.available_optionsObject


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'fastlane/lib/fastlane/actions/update_project_code_signing.rb', line 29

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,
                                 deprecated: "Use `:uuid` instead",
                                 env_name: "FL_PROJECT_SIGNING_UDID",
                                 code_gen_sensitive: true,
                                 default_value: ENV["SIGH_UUID"],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :uuid,
                                 env_name: "FL_PROJECT_SIGNING_UUID",
                                 description: "The UUID of the provisioning profile you want to use",
                                 code_gen_sensitive: true,
                                 default_value: ENV["SIGH_UUID"],
                                 default_value_dynamic: true)
  ]
end

.categoryObject


64
65
66
# File 'fastlane/lib/fastlane/actions/update_project_code_signing.rb', line 64

def self.category
  :deprecated
end

.deprecated_notesObject


68
69
70
71
72
73
# File 'fastlane/lib/fastlane/actions/update_project_code_signing.rb', line 68

def self.deprecated_notes
  [
    "You shouldn't use `update_project_code_signing`.",
    "Have you considered using the recommended way to do code signing: [https://docs.fastlane.tools/codesigning/getting-started/](https://docs.fastlane.tools/codesigning/getting-started/)?"
  ].join("\n")
end

.descriptionObject


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

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

.example_codeObject


60
61
62
# File 'fastlane/lib/fastlane/actions/update_project_code_signing.rb', line 60

def self.example_code
  nil
end

.is_supported?(platform) ⇒ Boolean

Returns:


56
57
58
# File 'fastlane/lib/fastlane/actions/update_project_code_signing.rb', line 56

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
23
# File 'fastlane/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 signing?")
  UI.message("https://docs.fastlane.tools/codesigning/getting-started/")

  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)

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

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

  UI.success("Successfully updated project settings to use UUID '#{uuid}'")
end