Class: Fastlane::Actions::UpdateProjectTeamAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorObject



43
44
45
# File 'lib/fastlane/actions/update_project_team.rb', line 43

def self.author
  "lgaches"
end

.available_optionsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fastlane/actions/update_project_team.rb', line 28

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: :teamid,
                                 env_name: "FL_PROJECT_TEAM_ID",
                                 description: "The Team ID  you want to use",
                                 default_value: ENV["TEAM_ID"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_id))
  ]
end

.categoryObject



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

def self.category
  :project
end

.descriptionObject



20
21
22
# File 'lib/fastlane/actions/update_project_team.rb', line 20

def self.description
  "Update Xcode Development Team ID"
end

.detailsObject



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

def self.details
  "This action update the Developer Team ID of your Xcode Project."
end

.example_codeObject



51
52
53
54
55
56
57
58
# File 'lib/fastlane/actions/update_project_team.rb', line 51

def self.example_code
  [
    'update_project_team(
      path: "Example.xcodeproj",
      teamid: "A3ZZVJ7CNY"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.run(params) ⇒ Object



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

def self.run(params)
  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 development team (#{params[:teamid]}) for the given project '#{path}'")

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

  UI.success("Successfully updated project settings to use Developer Team ID '#{params[:teamid]}'")
end