Class: Fastlane::Actions::ProduceAction

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, sh

Class Method Details

.authorObject



70
71
72
# File 'lib/fastlane/actions/produce.rb', line 70

def self.author
  "KrauseFx"
end

.available_optionsObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fastlane/actions/produce.rb', line 49

def self.available_options
  [
    ['produce_app_identifier', 'The App Identifier of your app', 'PRODUCE_APP_IDENTIFIER'],
    ['produce_app_name', 'The name of your app', 'PRODUCE_APP_NAME'],
    ['produce_language', 'The app\'s default language', 'PRODUCE_LANGUAGE'],
    ['produce_version', 'The initial version of your app', 'PRODUCE_VERSION'],
    ['produce_sku', 'The SKU number of the app if it gets created', 'PRODUCE_SKU'],
    ['produce_team_name', 'optional: the name of your team', 'PRODUCE_TEAM_NAME'],
    ['produce_team_id', 'optional: the ID of your team', 'PRODUCE_TEAM_ID'],
    ['produce_username', 'optional: your Apple ID', 'PRODUCE_USERNAME'],
    ['produce_skip_itc', 'Skip the creation on iTunes Connect', 'PRODUCE_SKIP_ITC'],
    ['produce_skip_devcenter', 'Skip the creation on the Apple Developer Portal', 'PRODUCE_SKIP_DEVCENTER']
  ]
end

.descriptionObject



38
39
40
# File 'lib/fastlane/actions/produce.rb', line 38

def self.description
  "Makes sure the given app identifier is created on the Dev Portal"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/fastlane/actions/produce.rb', line 74

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

.outputObject



64
65
66
67
68
# File 'lib/fastlane/actions/produce.rb', line 64

def self.output
  [
    ['PRODUCE_APPLE_ID', 'The Apple ID of the newly created app. You probably need it for `deliver`']
  ]
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fastlane/actions/produce.rb', line 8

def self.run(params)
  require 'produce'

  raise 'Parameter of produce must be a hash'.red unless params.is_a?(Hash)

  params.each do |key, value|
    ENV[key.to_s.upcase] = value.to_s
  end

  return if Helper.test?

  FastlaneCore::UpdateChecker.start_looking_for_update('produce') unless Helper.is_test?

  begin
    Dir.chdir(FastlaneFolder.path || Dir.pwd) do
      # This should be executed in the fastlane folder

      CredentialsManager::PasswordManager.shared_manager(ENV['PRODUCE_USERNAME']) if ENV['PRODUCE_USERNAME']
      Produce::Config.shared_config # to ask for missing information right in the beginning

      apple_id = Produce::Manager.start_producing.to_s

      Actions.lane_context[SharedValues::PRODUCE_APPLE_ID] = apple_id
      ENV['PRODUCE_APPLE_ID'] = apple_id
    end
  ensure
    FastlaneCore::UpdateChecker.show_update_status('produce', Produce::VERSION)
  end
end

Instance Method Details

#detailsObject



42
43
44
45
46
47
# File 'lib/fastlane/actions/produce.rb', line 42

def details
  [
    'For more information about produce, visit its GitHub page:',
    'https://github.com/KrauseFx/produce'
  ].join(' ')
end