fastlane 1.51.0 → 1.52.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 425eade5eb4d86ec9e784f5fe925bc3cd11e9ea7
4
- data.tar.gz: d7b3dd59c112dbc7fe07d800d5c6d067e880640b
3
+ metadata.gz: 0eef57cf820287dc23b305623b627f04b20832ab
4
+ data.tar.gz: 7956d0ea24c1d4aea981407e3856486d40737584
5
5
  SHA512:
6
- metadata.gz: f883a21a5c848f2f78709ac09990d1bb3337f9500bcf01338fd8c6227a577fa5c8e03a431b6326a36b7c4ad25a6487df7e62ad485a39b89ddfd065bd23bea1a3
7
- data.tar.gz: 3f51fd1a89aed0babac095dd93544774733c0637d80e31cffa3d348658a81188288e38fbc18e2c0214c022c05af93698f8c4b320991dafe3275ede59ac7cd07a
6
+ metadata.gz: 60b37543949c6ff0fd439775c6fdbe1cbdae1f2f820f3edd4d2648114ec2b7be27d05d3d4050e304eaf47083611e71c78ebad33513964192865755a508aa1c77
7
+ data.tar.gz: 414ee0d9279a5507b78fbfb03f07374da0b57be587051815962566bc0cc5926f52af7c367ab332b736eab9caf525ad1130dfdca5ce0979071907f63d228e2d89
@@ -1,14 +1,7 @@
1
1
  app_identifier "[[APP_IDENTIFIER]]" # The bundle identifier of your app
2
2
  apple_id "[[APPLE_ID]]" # Your Apple email address
3
3
 
4
- # You can uncomment any of the lines below and add your own
5
- # team selection in case you're in multiple teams
6
- # team_name "Felix Krause"
7
- # team_id "Q2CBPJ58CA"
8
-
9
- # To select a team for iTunes Connect use
10
- # itc_team_name "Company Name"
11
- # itc_team_id "18742801
12
-
4
+ team_id "[[DEV_PORTAL_TEAM_ID]]" # Developer Portal Team ID
5
+ [[ITC_TEAM]]
13
6
  # you can even provide different app identifiers, Apple IDs and team names per lane:
14
- # https://github.com/fastlane/fastlane/blob/master/docs/Appfile.md
7
+ # More information: https://github.com/fastlane/fastlane/blob/master/docs/Appfile.md
@@ -20,37 +20,33 @@ fastlane_version "[[FASTLANE_VERSION]]"
20
20
 
21
21
  default_platform :ios
22
22
 
23
-
24
23
  platform :ios do
25
24
  before_all do
26
25
  # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
27
26
  cocoapods
28
27
  carthage
29
- # increment_build_number
30
-
31
- xctool # run the tests of your app
32
28
  end
33
29
 
34
30
  desc "Runs all the tests"
35
31
  lane :test do
36
- snapshot
32
+ scan
37
33
  end
38
34
 
39
35
  desc "Submit a new Beta Build to Apple TestFlight"
40
36
  desc "This will also make sure the profile is up to date"
41
37
  lane :beta do
42
- sigh
38
+ # match(type: "appstore") # more information: https://codesigning.guide
43
39
  gym[[SCHEME]] # Build your app - more options available
44
40
  pilot
45
41
 
46
42
  # sh "your_script.sh"
47
- # You can also use other beta testing services here
43
+ # You can also use other beta testing services here (run `fastlane actions`)
48
44
  end
49
45
 
50
46
  desc "Deploy a new version to the App Store"
51
- lane :deploy do
47
+ lane :appstore do
48
+ # match(type: "appstore")
52
49
  snapshot
53
- sigh
54
50
  gym[[SCHEME]] # Build your app - more options available
55
51
  deliver(force: true)
56
52
  # frameit
@@ -60,7 +56,7 @@ platform :ios do
60
56
 
61
57
  after_all do |lane|
62
58
  # This block is called, only if the executed lane was successful
63
-
59
+
64
60
  # slack(
65
61
  # message: "Successfully deployed new App Update."
66
62
  # )
@@ -86,14 +86,12 @@ module Fastlane
86
86
  if key != :input
87
87
  cli_args << value
88
88
  end
89
- else
90
- if value.kind_of?(Array)
91
- value.each do |v|
92
- cli_args << cli_param(args, v)
93
- end
94
- else
95
- cli_args << cli_param(args, value)
89
+ elsif value.kind_of?(Array)
90
+ value.each do |v|
91
+ cli_args << cli_param(args, v)
96
92
  end
93
+ else
94
+ cli_args << cli_param(args, value)
97
95
  end
98
96
  end
99
97
 
@@ -16,7 +16,17 @@ module Fastlane
16
16
 
17
17
  Helper.log.info "Collecting Git commits between #{from} and #{to}".green
18
18
 
19
- changelog = Actions.git_log_between(params[:pretty], from, to, params[:include_merges])
19
+ # Normally it is not good practice to take arbitrary input and convert it to a symbol
20
+ # because prior to Ruby 2.2, symbols are never garbage collected. However, we've
21
+ # already validated that the input matches one of our allowed values, so this is OK
22
+ merge_commit_filtering = params[:merge_commit_filtering].to_sym
23
+
24
+ # We want to be specific and exclude nil for this comparison
25
+ if params[:include_merges] == false
26
+ merge_commit_filtering = :exclude_merges
27
+ end
28
+
29
+ changelog = Actions.git_log_between(params[:pretty], from, to, merge_commit_filtering)
20
30
  changelog = changelog.gsub("\n\n", "\n") if changelog # as there are duplicate newlines
21
31
  Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog
22
32
 
@@ -65,10 +75,22 @@ module Fastlane
65
75
  is_string: false),
66
76
  FastlaneCore::ConfigItem.new(key: :include_merges,
67
77
  env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_INCLUDE_MERGES',
68
- description: 'Whether or not to include any commits that are merges',
78
+ description: "Whether or not to include any commits that are merges\n" + '(DEPRECATED - use :merge_commit_filtering)'.red,
69
79
  optional: true,
70
- default_value: true,
71
- is_string: false)
80
+ is_string: false,
81
+ verify_block: proc do |value|
82
+ UI.important "The :include_merges option is deprecated. Please use :merge_commit_filtering instead" unless value.nil?
83
+ end),
84
+ FastlaneCore::ConfigItem.new(key: :merge_commit_filtering,
85
+ env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_MERGE_COMMIT_FILTERING',
86
+ description: "Controls inclusion of merge commits when collecting the changelog.\nValid values: #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map {|o| "'#{o}'" }.join(', ')}",
87
+ optional: true,
88
+ default_value: 'include_merges',
89
+ verify_block: proc do |value|
90
+ matches_option = GIT_MERGE_COMMIT_FILTERING_OPTIONS.any? { |opt| opt.to_s == value }
91
+ raise "Valid values for :merge_commit_filtering are #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map {|o| "'#{o}'" }.join(', ')}".red unless matches_option
92
+ end
93
+ )
72
94
  ]
73
95
  end
74
96
 
@@ -32,10 +32,8 @@ module Fastlane
32
32
  Helper.log.info "Successfully created pull request ##{number}. You can see it at '#{html_url}'".green
33
33
 
34
34
  Actions.lane_context[SharedValues::CREATE_PULL_REQUEST_HTML_URL] = html_url
35
- else
36
- if response[:status] != 200
37
- Helper.log.error "GitHub responded with #{response[:status]}: #{response[:body]}".red
38
- end
35
+ elsif response[:status] != 200
36
+ Helper.log.error "GitHub responded with #{response[:status]}: #{response[:body]}".red
39
37
  end
40
38
  end
41
39
 
@@ -43,7 +43,6 @@ module Fastlane
43
43
  else
44
44
  ########## running on V2 ##########
45
45
  if user?(channel)
46
- channel.slice!(0)
47
46
  params = { 'message' => message, 'message_format' => message_format }
48
47
  json_headers = { 'Content-Type' => 'application/json',
49
48
  'Accept' => 'application/json', 'Authorization' => "Bearer #{api_token}" }
@@ -45,7 +45,7 @@ module Fastlane
45
45
  end
46
46
 
47
47
  def self.details
48
- "Provides a way to have increment_build_number base the incremented value on the latest value in iTunesConnect by looking up the latest version in TestFlight and the latest build number for that version"
48
+ "Provides a way to have increment_build_number be based on the latest build you uploaded to iTC."
49
49
  end
50
50
 
51
51
  def self.available_options
@@ -27,7 +27,12 @@ module Fastlane
27
27
 
28
28
  notifier = Slack::Notifier.new(options[:slack_url])
29
29
 
30
- notifier.username = 'fastlane'
30
+ if options[:username].to_s.length > 0
31
+ notifier.username = options[:username]
32
+ else
33
+ notifier.username = 'fastlane'
34
+ end
35
+
31
36
  if options[:channel].to_s.length > 0
32
37
  notifier.channel = options[:channel]
33
38
  notifier.channel = ('#' + notifier.channel) unless ['#', '@'].include?(notifier.channel[0]) # send message to channel by default
@@ -37,9 +42,15 @@ module Fastlane
37
42
 
38
43
  return [notifier, slack_attachment] if Helper.is_test? # tests will verify the slack attachments and other properties
39
44
 
40
- result = notifier.ping '',
41
- icon_url: 'https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png',
42
- attachments: [slack_attachment]
45
+ if options[:icon_url].to_s.length > 0
46
+ result = notifier.ping '',
47
+ icon_url: options[:icon_url],
48
+ attachments: [slack_attachment]
49
+ else
50
+ result = notifier.ping '',
51
+ icon_url: 'https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png',
52
+ attachments: [slack_attachment]
53
+ end
43
54
 
44
55
  if result.code.to_i == 200
45
56
  Helper.log.info 'Successfully sent Slack notification'.green
@@ -55,6 +66,14 @@ module Fastlane
55
66
 
56
67
  def self.available_options
57
68
  [
69
+ FastlaneCore::ConfigItem.new(key: :username,
70
+ env_name: "FL_SLACK_USERNAME",
71
+ description: "The username that should be displayed on Slack",
72
+ optional: true),
73
+ FastlaneCore::ConfigItem.new(key: :icon_url,
74
+ env_name: "FL_SLACK_ICON_URL",
75
+ description: "The URL of the icon that should be displayed on Slack",
76
+ optional: true),
58
77
  FastlaneCore::ConfigItem.new(key: :message,
59
78
  env_name: "FL_SLACK_MESSAGE",
60
79
  description: "The message that should be displayed on Slack. This supports the standard Slack markup language",
@@ -41,8 +41,8 @@ module Fastlane
41
41
 
42
42
  if params[:notes_path]
43
43
  options[:notes] = File.read(params[:notes_path])
44
- else
45
- options[:notes] = params[:notes] if params[:notes]
44
+ elsif params[:notes]
45
+ options[:notes] = params[:notes]
46
46
  end
47
47
 
48
48
  options[:notify] = params[:notify].to_s
@@ -46,7 +46,7 @@ module Fastlane
46
46
 
47
47
  project = Xcodeproj::Project.open(folder)
48
48
  project.targets.each do |target|
49
- if !target_filter || target.product_name.match(target_filter) || target.product_type.match(target_filter)
49
+ if !target_filter || target.product_name.match(target_filter) || (target.respond_to?(:product_type) && target.product_type.match(target_filter))
50
50
  Helper.log.info "Updating target #{target.product_name}...".green
51
51
  else
52
52
  Helper.log.info "Skipping target #{target.product_name} as it doesn't match the filter '#{target_filter}'".yellow
@@ -26,22 +26,29 @@ module Fastlane
26
26
  configuration: "-configuration",
27
27
  derivedDataPath: "-derivedDataPath",
28
28
  destination_timeout: "-destination-timeout",
29
+ dry_run: "-dry-run",
30
+ enableAddressSanitizer: "-enableAddressSanitizer",
31
+ enableCodeCoverage: "-enableCodeCoverage",
29
32
  export_archive: "-exportArchive",
30
33
  export_format: "-exportFormat",
31
34
  export_installer_identity: "-exportInstallerIdentity",
35
+ export_options_plist: "-exportOptionsPlist",
32
36
  export_path: "-exportPath",
33
37
  export_profile: "-exportProvisioningProfile",
34
38
  export_signing_identity: "-exportSigningIdentity",
35
39
  export_with_original_signing_identity: "-exportWithOriginalSigningIdentity",
40
+ hide_shell_script_environment: "-hideShellScriptEnvironment",
41
+ jobs: "-jobs",
42
+ parallelize_targets: "-parallelizeTargets",
36
43
  project: "-project",
37
44
  result_bundle_path: "-resultBundlePath",
38
45
  scheme: "-scheme",
39
46
  sdk: "-sdk",
40
47
  skip_unavailable_actions: "-skipUnavailableActions",
41
48
  target: "-target",
49
+ toolchain: "-toolchain",
42
50
  workspace: "-workspace",
43
- xcconfig: "-xcconfig",
44
- enableCodeCoverage: "-enableCodeCoverage"
51
+ xcconfig: "-xcconfig"
45
52
  }
46
53
 
47
54
  def self.is_supported?(platform)
@@ -85,17 +92,17 @@ module Fastlane
85
92
  # If not passed, retrieve path from previous xcodebuild call
86
93
  params[:archive_path] ||= Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE]
87
94
 
88
- # Default to ipa as export format
89
- params[:export_format] ||= "ipa"
90
-
91
95
  # If not passed, construct export path from env vars
92
96
  if params[:export_path].nil?
93
97
  ipa_filename = scheme ? scheme : File.basename(params[:archive_path], ".*")
94
98
  params[:export_path] = "#{build_path}#{ipa_filename}"
95
99
  end
96
100
 
101
+ # Default to ipa as export format
102
+ export_format = params[:export_format] || "ipa"
103
+
97
104
  # Store IPA path for later deploy steps (i.e. Crashlytics)
98
- Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = params[:export_path] + "." + params[:export_format].downcase
105
+ Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = params[:export_path] + "." + export_format.downcase
99
106
  else
100
107
  # If not passed, check for archive scheme & workspace/project env vars
101
108
  params[:scheme] ||= scheme
@@ -117,6 +124,13 @@ module Fastlane
117
124
  Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] = params[:archive_path]
118
125
  end
119
126
 
127
+ if params.key? :enable_address_sanitizer
128
+ params[:enableAddressSanitizer] = params[:enable_address_sanitizer] ? 'YES' : 'NO'
129
+ end
130
+ if params.key? :enable_code_coverage
131
+ params[:enableCodeCoverage] = params[:enable_code_coverage] ? 'YES' : 'NO'
132
+ end
133
+
120
134
  # Maps parameter hash to CLI args
121
135
  if hash_args = hash_to_args(params)
122
136
  xcodebuild_args += hash_args
@@ -273,7 +287,7 @@ module Fastlane
273
287
  # Add more xcodebuild arguments
274
288
  "#{v}"
275
289
  end
276
- end.compact.sort
290
+ end.compact
277
291
  end
278
292
 
279
293
  def self.detect_workspace
@@ -466,10 +480,6 @@ module Fastlane
466
480
  params_hash[:build] = true
467
481
  params_hash[:test] = true
468
482
 
469
- if params.key? :enable_code_coverage
470
- params[:enableCodeCoverage] = params[:enable_code_coverage] ? 'YES' : 'NO'
471
- end
472
-
473
483
  XcodebuildAction.run(params_hash)
474
484
  end
475
485
 
@@ -1,9 +1,12 @@
1
1
  module Fastlane
2
2
  module Actions
3
- def self.git_log_between(pretty_format, from, to, include_merges)
3
+ GIT_MERGE_COMMIT_FILTERING_OPTIONS = [:include_merges, :exclude_merges, :only_include_merges].freeze
4
+
5
+ def self.git_log_between(pretty_format, from, to, merge_commit_filtering)
4
6
  command = 'git log'
5
7
  command << " --pretty=\"#{pretty_format}\" #{from.shellescape}...#{to.shellescape}"
6
- command << " --no-merges" unless include_merges
8
+ command << " --no-merges" if merge_commit_filtering == :exclude_merges
9
+ command << " --merges" if merge_commit_filtering == :only_include_merges
7
10
  Actions.sh(command, log: false).chomp
8
11
  rescue
9
12
  nil
@@ -69,12 +69,10 @@ module Fastlane
69
69
  if error
70
70
  Helper.log.fatal 'fastlane finished with errors'.red
71
71
  raise error
72
+ elsif duration > 5
73
+ Helper.log.info "fastlane.tools just saved you #{duration} minutes! 🎉".green
72
74
  else
73
- if duration > 5
74
- Helper.log.info "fastlane.tools just saved you #{duration} minutes! 🎉".green
75
- else
76
- Helper.log.info 'fastlane.tools finished successfully 🎉'.green
77
- end
75
+ Helper.log.info 'fastlane.tools finished successfully 🎉'.green
78
76
  end
79
77
  end
80
78
 
@@ -31,10 +31,9 @@ module Fastlane
31
31
  Helper.log.info "Created new action file '#{path}'. Edit it to implement your custom action.".green
32
32
  end
33
33
 
34
- private
35
-
36
34
  def self.name_valid?(name)
37
35
  name == name.downcase && name.length > 0 && !name.include?('.')
38
36
  end
37
+ private_class_method :name_valid?
39
38
  end
40
39
  end
@@ -22,7 +22,6 @@ module Fastlane
22
22
  else
23
23
  raise "Couldn't find platform '#{platform}'"
24
24
  end
25
- ask_for_crash_reporting
26
25
  end
27
26
 
28
27
  def is_ios?
@@ -1,7 +1,18 @@
1
1
  module Fastlane
2
2
  class SetupIos < Setup
3
3
  # the tools that are already enabled
4
- attr_reader :tools
4
+ attr_accessor :tools
5
+ attr_accessor :project
6
+ attr_accessor :apple_id
7
+
8
+ attr_accessor :portal_ref
9
+ attr_accessor :itc_ref
10
+
11
+ attr_accessor :dev_portal_team
12
+ attr_accessor :itc_team
13
+
14
+ attr_accessor :app_identifier
15
+ attr_accessor :app_name
5
16
 
6
17
  def run
7
18
  if FastlaneFolder.setup? and !Helper.is_test?
@@ -10,21 +21,28 @@ module Fastlane
10
21
  end
11
22
 
12
23
  show_infos
13
- response = agree('Do you have everything commited in version control? If not please do so now! (y/n)'.yellow, true)
14
- return unless response
15
24
 
16
- # rubocop:disable Lint/RescueException
17
25
  begin
18
26
  FastlaneFolder.create_folder! unless Helper.is_test?
19
- copy_existing_files
20
- generate_appfile
21
- detect_installed_tools # after copying the existing files
22
- ask_to_enable_other_tools
23
- FileUtils.mkdir(File.join(FastlaneFolder.path, 'actions'))
24
- generate_fastfile
25
- show_analytics
27
+ setup_project
28
+ ask_for_apple_id
29
+ detect_if_app_is_available
30
+ print_config_table
31
+
32
+ if UI.confirm("Please confirm the above values")
33
+ copy_existing_files
34
+ generate_appfile
35
+ detect_installed_tools # after copying the existing files
36
+ create_app_if_necessary
37
+ enable_deliver
38
+ FileUtils.mkdir(File.join(FastlaneFolder.path, 'actions'))
39
+ generate_fastfile
40
+ show_analytics
41
+ else
42
+ UI.user_error!("Setup cancelled by user")
43
+ end
26
44
  Helper.log.info 'Successfully finished setting up fastlane'.green
27
- rescue Exception => ex # this will also be caused by Ctrl + C
45
+ rescue => ex # this will also be caused by Ctrl + C
28
46
  # Something went wrong with the setup, clear the folder again
29
47
  # and restore previous files
30
48
  Helper.log.fatal 'Error occurred with the setup program! Reverting changes now!'.red
@@ -34,16 +52,42 @@ module Fastlane
34
52
  # rubocop:enable Lint/RescueException
35
53
  end
36
54
 
55
+ def setup_project
56
+ config = {}
57
+ FastlaneCore::Project.detect_projects(config)
58
+ self.project = FastlaneCore::Project.new(config)
59
+ self.app_identifier = self.project.default_app_identifier # These two vars need to be accessed in order to be set
60
+ self.app_name = self.project.default_app_name # They are set as a side effect, this could/should be changed down the road
61
+ end
62
+
63
+ def print_config_table
64
+ rows = []
65
+ rows << ["Apple ID", self.apple_id]
66
+ rows << ["App Name", self.app_name]
67
+ rows << ["App Identifier", self.app_identifier]
68
+ rows << [(self.project.is_workspace ? "Workspace" : "Project"), self.project.path]
69
+ require 'terminal-table'
70
+ puts ""
71
+ puts Terminal::Table.new(rows: rows, title: "Detected Values")
72
+ puts ""
73
+
74
+ unless self.itc_ref
75
+ UI.important "This app identifier doesn't exist on iTunes Connect yet, it will be created for you"
76
+ end
77
+
78
+ unless self.portal_ref
79
+ UI.important "This app identifier doesn't exist on the Apple Developer Portal yet, it will be created for you"
80
+ end
81
+ end
82
+
37
83
  def show_infos
38
84
  Helper.log.info 'This setup will help you get up and running in no time.'.green
39
- Helper.log.info 'First, it will move the config files from `deliver` and `snapshot`'.green
40
- Helper.log.info "into the subfolder `fastlane`.\n".green
41
85
  Helper.log.info "fastlane will check what tools you're already using and set up".green
42
86
  Helper.log.info 'the tool automatically for you. Have fun! '.green
43
87
  end
44
88
 
45
89
  def files_to_copy
46
- ['Deliverfile', 'deliver', 'screenshots']
90
+ ['Deliverfile', 'deliver', 'screenshots', 'metadata']
47
91
  end
48
92
 
49
93
  def copy_existing_files
@@ -57,81 +101,97 @@ module Fastlane
57
101
  end
58
102
  end
59
103
 
60
- def generate_appfile
61
- Helper.log.info '------------------------------'
62
- Helper.log.info 'To not re-enter your username and app identifier every time you run one of the fastlane tools or fastlane, these will be stored from now on.'.green
63
-
64
- app_identifier = ask('App Identifier (com.krausefx.app): '.yellow)
65
- apple_id = ask('Your Apple ID (fastlane@krausefx.com): '.yellow)
104
+ def ask_for_apple_id
105
+ self.apple_id = ask('Your Apple ID (e.g. fastlane@krausefx.com): '.yellow)
106
+ end
66
107
 
108
+ def generate_appfile
67
109
  template = File.read("#{Helper.gem_path('fastlane')}/lib/assets/AppfileTemplate")
68
- template.gsub!('[[APP_IDENTIFIER]]', app_identifier)
69
- template.gsub!('[[APPLE_ID]]', apple_id)
110
+ template.gsub!('[[APP_IDENTIFIER]]', self.app_identifier)
111
+ template.gsub!('[[APPLE_ID]]', self.apple_id)
112
+ template.gsub!('[[DEV_PORTAL_TEAM_ID]]', self.dev_portal_team)
113
+ if self.itc_team
114
+ template.gsub!('[[ITC_TEAM]]', "itc_team_id \"#{self.itc_team}\" # iTunes Connect Team ID\n")
115
+ else
116
+ template.gsub!('[[ITC_TEAM]]', "")
117
+ end
70
118
  path = File.join(folder, 'Appfile')
71
119
  File.write(path, template)
72
120
  Helper.log.info "Created new file '#{path}'. Edit it to manage your preferred app metadata information.".green
73
121
  end
74
122
 
75
- def detect_installed_tools
76
- @tools = {}
77
- @tools[:deliver] = File.exist?(File.join(folder, 'Deliverfile'))
78
- @tools[:snapshot] = File.exist?(File.join(folder, 'Snapfile'))
79
- @tools[:xctool] = File.exist?(File.join(File.expand_path('..', folder), '.xctool-args'))
80
- @tools[:cocoapods] = File.exist?(File.join(File.expand_path('..', folder), 'Podfile'))
81
- @tools[:carthage] = File.exist?(File.join(File.expand_path('..', folder), 'Cartfile'))
82
- @tools[:sigh] = false
83
- end
84
-
85
- def ask_to_enable_other_tools
86
- if @tools[:deliver] # deliver already enabled
87
- Helper.log.info 'Since all files are moved into the `fastlane` subfolder, you have to adapt your Deliverfile'.yellow
88
- else
89
- if agree("Do you want to setup 'deliver', which is used to upload app screenshots, app metadata and app updates to the App Store? This requires the app to be in the App Store already. (y/n)".yellow, true)
90
- Helper.log.info "Loading up 'deliver', this might take a few seconds"
91
- require 'deliver'
92
- require 'deliver/setup'
93
- options = FastlaneCore::Configuration.create(Deliver::Options.available_options, {})
94
- Deliver::Runner.new(options) # to login...
95
- Deliver::Setup.new.run(options)
96
-
97
- @tools[:deliver] = true
98
- end
99
- end
123
+ # Detect if the app was created on the Dev Portal / iTC
124
+ def detect_if_app_is_available
125
+ require 'spaceship'
100
126
 
101
- unless @tools[:snapshot]
102
- if Helper.mac? and agree("Do you want to setup 'snapshot', which will help you to automatically take screenshots of your iOS app in all languages/devices? (y/n)".yellow, true)
103
- Helper.log.info "Loading up 'snapshot', this might take a few seconds"
127
+ UI.important "Verifying if app is available on the Apple Developer Portal and iTunes Connect..."
128
+ UI.message "Starting login with user '#{self.apple_id}'"
129
+ Spaceship.login(self.apple_id, nil)
130
+ self.dev_portal_team = Spaceship.select_team
131
+ self.portal_ref = Spaceship::App.find(self.app_identifier)
104
132
 
105
- require 'snapshot'
106
- require 'snapshot/setup'
107
- Snapshot::Setup.create(folder)
133
+ Spaceship::Tunes.login(@apple_id, nil)
134
+ self.itc_team = Spaceship::Tunes.select_team
135
+ self.itc_ref = Spaceship::Application.find(self.app_identifier)
136
+ end
108
137
 
109
- @tools[:snapshot] = true
138
+ def create_app_if_necessary
139
+ UI.important "Creating the app on iTunes Connect and the Apple Developer Portal"
140
+ require 'produce'
141
+ config = {} # this has to be done like this
142
+ FastlaneCore::Project.detect_projects(config)
143
+ project = FastlaneCore::Project.new(config)
144
+
145
+ produce_options_hash = {
146
+ app_name: project.app_name,
147
+ app_identifier: self.app_identifier
148
+ }
149
+ Produce.config = FastlaneCore::Configuration.create(Produce::Options.available_options, produce_options_hash)
150
+ begin
151
+ ENV['PRODUCE_APPLE_ID'] = Produce::Manager.start_producing
152
+ rescue => exception
153
+ if exception.to_s.include?("The App Name you entered has already been used")
154
+ Helper.log.info "It looks like that #{project.app_name} has already been taken by someone else, please enter an alternative.".yellow
155
+ Produce.config[:app_name] = ask("App Name: ".yellow)
156
+ Produce.config[:skip_devcenter] = true # since we failed on iTC
157
+ ENV['PRODUCE_APPLE_ID'] = Produce::Manager.start_producing
110
158
  end
111
159
  end
160
+ end
161
+
162
+ def detect_installed_tools
163
+ self.tools = {}
164
+ self.tools[:snapshot] = File.exist?(File.join(folder, 'Snapfile'))
165
+ self.tools[:cocoapods] = File.exist?(File.join(File.expand_path('..', folder), 'Podfile'))
166
+ self.tools[:carthage] = File.exist?(File.join(File.expand_path('..', folder), 'Cartfile'))
167
+ end
112
168
 
113
- @tools[:sigh] = true if agree("Do you want to use 'sigh', which will maintain and download the provisioning profile for your app? (y/n)".yellow, true)
169
+ def enable_deliver
170
+ Helper.log.info "Loading up 'deliver', this might take a few seconds"
171
+ require 'deliver'
172
+ require 'deliver/setup'
173
+ options = FastlaneCore::Configuration.create(Deliver::Options.available_options, {})
174
+ Deliver::Runner.new(options) # to login...
175
+ Deliver::Setup.new.run(options)
114
176
  end
115
177
 
116
178
  def generate_fastfile
117
- template = File.read("#{Helper.gem_path('fastlane')}/lib/assets/FastfileTemplate")
179
+ scheme = self.project.schemes.first
180
+ template = File.read("#{Helper.gem_path('fastlane')}/lib/assets/DefaultFastfileTemplate")
118
181
 
119
- scheme = ask("Optional: The scheme name of your app (If you don't need one, just hit Enter): ").to_s.strip
182
+ scheme = ask("Optional: The scheme name of your app (If you don't need one, just hit Enter): ").to_s.strip unless scheme
120
183
  if scheme.length > 0
121
184
  template.gsub!('[[SCHEME]]', "(scheme: \"#{scheme}\")")
122
185
  else
123
186
  template.gsub!('[[SCHEME]]', "")
124
187
  end
125
188
 
126
- template.gsub!('deliver', '# deliver') unless @tools[:deliver]
127
- template.gsub!('snapshot', '# snapshot') unless @tools[:snapshot]
128
- template.gsub!('sigh', '# sigh') unless @tools[:sigh]
129
- template.gsub!('xctool', '# xctool') unless @tools[:xctool]
130
- template.gsub!('cocoapods', '') unless @tools[:cocoapods]
131
- template.gsub!('carthage', '') unless @tools[:carthage]
189
+ template.gsub!('snapshot', '# snapshot') unless self.tools[:snapshot]
190
+ template.gsub!('cocoapods', '') unless self.tools[:cocoapods]
191
+ template.gsub!('carthage', '') unless self.tools[:carthage]
132
192
  template.gsub!('[[FASTLANE_VERSION]]', Fastlane::VERSION)
133
193
 
134
- @tools.each do |key, value|
194
+ self.tools.each do |key, value|
135
195
  Helper.log.info "'#{key}' enabled.".magenta if value
136
196
  Helper.log.info "'#{key}' not enabled.".yellow unless value
137
197
  end
@@ -1,3 +1,3 @@
1
1
  module Fastlane
2
- VERSION = '1.51.0'
2
+ VERSION = '1.52.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.51.0
4
+ version: 1.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: krausefx-shenzhen
@@ -148,7 +148,7 @@ dependencies:
148
148
  requirements:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 0.33.0
151
+ version: 0.35.0
152
152
  - - "<"
153
153
  - !ruby/object:Gem::Version
154
154
  version: 1.0.0
@@ -158,7 +158,7 @@ dependencies:
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 0.33.0
161
+ version: 0.35.0
162
162
  - - "<"
163
163
  - !ruby/object:Gem::Version
164
164
  version: 1.0.0
@@ -208,7 +208,7 @@ dependencies:
208
208
  requirements:
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
- version: 1.7.0
211
+ version: 1.8.0
212
212
  - - "<"
213
213
  - !ruby/object:Gem::Version
214
214
  version: 2.0.0
@@ -218,7 +218,7 @@ dependencies:
218
218
  requirements:
219
219
  - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: 1.7.0
221
+ version: 1.8.0
222
222
  - - "<"
223
223
  - !ruby/object:Gem::Version
224
224
  version: 2.0.0
@@ -546,14 +546,14 @@ dependencies:
546
546
  requirements:
547
547
  - - "~>"
548
548
  - !ruby/object:Gem::Version
549
- version: '0.29'
549
+ version: 0.35.1
550
550
  type: :development
551
551
  prerelease: false
552
552
  version_requirements: !ruby/object:Gem::Requirement
553
553
  requirements:
554
554
  - - "~>"
555
555
  - !ruby/object:Gem::Version
556
- version: '0.29'
556
+ version: 0.35.1
557
557
  - !ruby/object:Gem::Dependency
558
558
  name: appium_lib
559
559
  requirement: !ruby/object:Gem::Requirement
@@ -581,7 +581,7 @@ files:
581
581
  - bin/fastlane
582
582
  - lib/assets/AppfileTemplate
583
583
  - lib/assets/AppfileTemplateAndroid
584
- - lib/assets/FastfileTemplate
584
+ - lib/assets/DefaultFastfileTemplate
585
585
  - lib/assets/FastfileTemplateAndroid
586
586
  - lib/assets/custom_action_template.rb
587
587
  - lib/assets/mailgun_html_template.erb
@@ -777,7 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
777
777
  version: '0'
778
778
  requirements: []
779
779
  rubyforge_project:
780
- rubygems_version: 2.4.0
780
+ rubygems_version: 2.4.5
781
781
  signing_key:
782
782
  specification_version: 4
783
783
  summary: Connect all iOS deployment tools into one streamlined workflow