Class: Fastlane::Actions::CreateAppOnlineAction

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

Direct Known Subclasses

ProduceAction

Constant Summary

Constants inherited from Fastlane::Action

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorObject



48
49
50
# File 'fastlane/lib/fastlane/actions/create_app_online.rb', line 48

def self.author
  "KrauseFx"
end

.available_optionsObject



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

def self.available_options
  require 'produce'
  Produce::Options.available_options
end

.categoryObject



71
72
73
# File 'fastlane/lib/fastlane/actions/create_app_online.rb', line 71

def self.category
  :misc
end

.descriptionObject



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

def self.description
  "Creates the given application on iTC and the Dev Portal (via _produce_)"
end

.example_codeObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'fastlane/lib/fastlane/actions/create_app_online.rb', line 56

def self.example_code
  [
    'create_app_online(
      username: "[email protected]",
      app_identifier: "com.krausefx.app",
      app_name: "MyApp",
      language: "English",
      app_version: "1.0",
      sku: "123",
      team_name: "SunApps GmbH" # Only necessary when in multiple teams.
    )',
    'produce   # alias for "create_app_online"'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



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

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

.outputObject



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

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
# File 'fastlane/lib/fastlane/actions/create_app_online.rb', line 8

def self.run(params)
  require 'produce'

  return if Helper.test?

  Produce.config = params # we alread have the finished config

  Dir.chdir(FastlaneCore::FastlaneFolder.path || Dir.pwd) do
    # This should be executed in the fastlane folder
    apple_id = Produce::Manager.start_producing.to_s

    Actions.lane_context[SharedValues::PRODUCE_APPLE_ID] = apple_id
    ENV['PRODUCE_APPLE_ID'] = apple_id
  end
end

Instance Method Details

#detailsObject



28
29
30
31
32
33
34
35
# File 'fastlane/lib/fastlane/actions/create_app_online.rb', line 28

def details
  [
    'Create new apps on iTunes Connect and Apple Developer Portal via _produce_.',
    'If the app already exists, `create_app_online` will not do anything.',
    'For more information about produce, visit its documentation page:',
    'https://docs.fastlane.tools/actions/produce/'
  ].join(' ')
end