fastlane 2.79.0.beta.20180124010003 → 2.79.0.beta.20180125010002

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/credentials_manager/lib/credentials_manager/appfile_config.rb +1 -1
  3. data/deliver/lib/deliver/loader.rb +1 -1
  4. data/fastlane/lib/fastlane/actions/apteligent.rb +1 -1
  5. data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +1 -1
  6. data/fastlane/lib/fastlane/actions/get_build_number.rb +1 -1
  7. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  8. data/fastlane/lib/fastlane/actions/get_version_number.rb +1 -1
  9. data/fastlane/lib/fastlane/actions/hg_add_tag.rb +1 -1
  10. data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +5 -5
  11. data/fastlane/lib/fastlane/actions/hg_push.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/increment_build_number.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +1 -1
  15. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/reset_git_repo.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/set_build_number_repository.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/setup_jenkins.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/setup_travis.rb +1 -1
  21. data/fastlane/lib/fastlane/actions/slack.rb +1 -1
  22. data/fastlane/lib/fastlane/actions/splunkmint.rb +1 -1
  23. data/fastlane/lib/fastlane/actions/update_app_group_identifiers.rb +1 -1
  24. data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +1 -1
  25. data/fastlane/lib/fastlane/command_line_handler.rb +1 -1
  26. data/fastlane/lib/fastlane/commands_generator.rb +1 -1
  27. data/fastlane/lib/fastlane/configuration_helper.rb +1 -1
  28. data/fastlane/lib/fastlane/environment_printer.rb +2 -2
  29. data/fastlane/lib/fastlane/fast_file.rb +1 -1
  30. data/fastlane/lib/fastlane/helper/gem_helper.rb +1 -1
  31. data/fastlane/lib/fastlane/setup/setup.rb +1 -1
  32. data/fastlane/lib/fastlane/swift_lane_manager.rb +1 -1
  33. data/fastlane/lib/fastlane/version.rb +1 -1
  34. data/fastlane_core/lib/fastlane_core.rb +1 -0
  35. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +1 -1
  36. data/fastlane_core/lib/fastlane_core/command_executor.rb +3 -3
  37. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +2 -2
  38. data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +1 -1
  39. data/fastlane_core/lib/fastlane_core/fastlane_pty.rb +22 -0
  40. data/fastlane_core/lib/fastlane_core/helper.rb +122 -89
  41. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +7 -7
  42. data/fastlane_core/lib/fastlane_core/project.rb +1 -1
  43. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  44. data/fastlane_core/lib/fastlane_core/tool_collector.rb +1 -1
  45. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +1 -1
  46. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +3 -3
  47. data/gym/lib/gym/runner.rb +0 -1
  48. data/match/lib/match/encrypt.rb +1 -1
  49. data/scan/lib/scan/runner.rb +1 -2
  50. data/screengrab/lib/screengrab/android_environment.rb +2 -1
  51. data/snapshot/lib/snapshot/screenshot_rotate.rb +2 -2
  52. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 579b61a800e044e85c68ad8e8f2e530f0b134c0a
4
- data.tar.gz: fc82399a894d4d8f3cb0bbe8c56a7dc6991e251e
3
+ metadata.gz: 11e6756a9c895869f254e318c69c43ed3baaa59e
4
+ data.tar.gz: 8055f34b7f3e1867796fb9b3c7f843f7357d5b60
5
5
  SHA512:
6
- metadata.gz: d8629c6772657921a0f464128416520994af79754ba2c79d6fb1fd79382149971c37bb4c7a6593f44070cc124138a60dbf9ee7c0b126069d906e02c11ee3890c
7
- data.tar.gz: a8a726bd15f676bba4a319d6804377958bc78162a76ff909baf7f32e8d6af29891f06c4ee5368b60a59c0666985b90064a522efa422ef13a2b4d3b823e26e72c
6
+ metadata.gz: 9a5e32e2274caace14cb5077d37800c5127ed8387d9c02f49692b2153c7fdd4ec84fb4e64d97d93ea2f8f3114de16d048eae3550e824afc130c6a487f00e81c1
7
+ data.tar.gz: 7533072ceaa9eacb2008edcfc70703bb9c4a3e67adfead9d3d5655a8bc258285d79a51675987d37c841ce240a7b4b46e12a3823f89838ed33e3034cf338ce1cb
@@ -32,7 +32,7 @@ module CredentialsManager
32
32
  if path and File.exist?(path) # it might not exist, we still want to use the default values
33
33
  full_path = File.expand_path(path)
34
34
  Dir.chdir(File.expand_path('..', path)) do
35
- content = File.read(full_path)
35
+ content = File.read(full_path, encoding: "utf-8")
36
36
 
37
37
  # From https://github.com/orta/danger/blob/master/lib/danger/danger_core/dangerfile.rb
38
38
  if content.tr!('“”‘’‛', %(""'''))
@@ -22,7 +22,7 @@ module Deliver
22
22
  def self.language_folders(root, ignore_validation)
23
23
  folders = Dir.glob(File.join(root, '*'))
24
24
 
25
- if Helper.is_test?
25
+ if Helper.test?
26
26
  available_languages = FastlaneCore::Languages::ALL_LANGUAGES
27
27
  else
28
28
  available_languages = Spaceship::Tunes.client.available_languages.sort
@@ -11,7 +11,7 @@ module Fastlane
11
11
  # will reanable it when it is fixed
12
12
  # result = Fastlane::Actions.sh(command.join(' '), log: false)
13
13
  shell_command = command.join(' ')
14
- return shell_command if Helper.is_test?
14
+ return shell_command if Helper.test?
15
15
  result = Actions.sh(shell_command)
16
16
  fail_on_error(result)
17
17
  end
@@ -28,7 +28,7 @@ module Fastlane
28
28
  end
29
29
  end
30
30
 
31
- return command if Helper.is_test?
31
+ return command if Helper.test?
32
32
 
33
33
  UI.important(command)
34
34
  results = `#{command}` # we don't use `sh` as the return code of grep is wrong for some reason
@@ -61,7 +61,7 @@ module Fastlane
61
61
  optional: true,
62
62
  verify_block: proc do |value|
63
63
  UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace")
64
- UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.is_test?
64
+ UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.test?
65
65
  end),
66
66
  FastlaneCore::ConfigItem.new(key: :hide_error_when_versioning_disabled,
67
67
  env_name: "FL_BUILD_NUMBER_HIDE_ERROR_WHEN_VERSIONING_DISABLED",
@@ -10,7 +10,7 @@ module Fastlane
10
10
 
11
11
  PEM.config = params
12
12
 
13
- if Helper.is_test?
13
+ if Helper.test?
14
14
  profile_path = './test.pem'
15
15
  else
16
16
  profile_path = PEM::Manager.start
@@ -113,7 +113,7 @@ module Fastlane
113
113
  optional: true,
114
114
  verify_block: proc do |value|
115
115
  UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace")
116
- UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
116
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.test?
117
117
  end),
118
118
  FastlaneCore::ConfigItem.new(key: :scheme,
119
119
  env_name: "FL_VERSION_NUMBER_SCHEME",
@@ -8,7 +8,7 @@ module Fastlane
8
8
  UI.message("Adding mercurial tag '#{tag}' 🎯.")
9
9
 
10
10
  command = "hg tag \"#{tag}\""
11
- return command if Helper.is_test?
11
+ return command if Helper.test?
12
12
 
13
13
  Actions.sh(command)
14
14
  end
@@ -10,17 +10,17 @@ module Fastlane
10
10
 
11
11
  xcodeproj_path = params[:xcodeproj] ? File.expand_path(File.join('.', params[:xcodeproj])) : nil
12
12
 
13
- if Helper.is_test?
13
+ if Helper.test?
14
14
  xcodeproj_path = "/tmp/Test.xcodeproj"
15
15
  end
16
16
 
17
17
  # get the repo root path
18
- repo_path = Helper.is_test? ? '/tmp/repo' : Actions.sh('hg root').strip
18
+ repo_path = Helper.test? ? '/tmp/repo' : Actions.sh('hg root').strip
19
19
  repo_pathname = Pathname.new(repo_path)
20
20
 
21
21
  if xcodeproj_path
22
22
  # ensure that the xcodeproj passed in was OK
23
- unless Helper.is_test?
23
+ unless Helper.test?
24
24
  UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path)
25
25
  end
26
26
  else
@@ -42,7 +42,7 @@ module Fastlane
42
42
  end
43
43
 
44
44
  # find the pbxproj path, relative to hg directory
45
- if Helper.is_test?
45
+ if Helper.test?
46
46
  hg_dirty_files = params[:test_dirty_files].split(",")
47
47
  expected_changed_files = params[:test_expected_files].split(",")
48
48
  else
@@ -94,7 +94,7 @@ module Fastlane
94
94
 
95
95
  # create a commit with a message
96
96
  command = "hg commit -m '#{params[:message]}'"
97
- return command if Helper.is_test?
97
+ return command if Helper.test?
98
98
  begin
99
99
  Actions.sh(command)
100
100
 
@@ -8,7 +8,7 @@ module Fastlane
8
8
  command << '--force' if params[:force]
9
9
  command << params[:destination] unless params[:destination].empty?
10
10
 
11
- return command.join(' ') if Helper.is_test?
11
+ return command.join(' ') if Helper.test?
12
12
 
13
13
  Actions.sh(command.join(' '))
14
14
  UI.success('Successfully pushed changes to remote 🚀.')
@@ -74,7 +74,7 @@ module Fastlane
74
74
  optional: true,
75
75
  verify_block: proc do |value|
76
76
  UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace")
77
- UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.is_test?
77
+ UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.test?
78
78
  end)
79
79
  ]
80
80
  end
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class IsCiAction < Action
4
4
  def self.run(params)
5
- Helper.is_ci?
5
+ Helper.ci?
6
6
  end
7
7
 
8
8
  #####################################################
@@ -7,7 +7,7 @@ module Fastlane
7
7
 
8
8
  changelog = ""
9
9
 
10
- if Helper.is_ci? || Helper.is_test?
10
+ if Helper.ci? || Helper.test?
11
11
  # The "BUILD_URL" environment variable is set automatically by Jenkins in every build
12
12
  jenkins_api_url = URI(ENV["BUILD_URL"] + "api/json\?wrapper\=changes\&xpath\=//changeSet//comment")
13
13
  begin
@@ -25,7 +25,7 @@ module Fastlane
25
25
 
26
26
  # execute our command
27
27
  Actions.sh('pwd')
28
- return command.join(' ') if Helper.is_test?
28
+ return command.join(' ') if Helper.test?
29
29
 
30
30
  Actions.sh(command.join(' '))
31
31
  UI.message('Successfully pushed to remote.')
@@ -8,7 +8,7 @@ module Fastlane
8
8
  if params[:force] || Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START]
9
9
  paths = params[:files]
10
10
 
11
- return paths if Helper.is_test?
11
+ return paths if Helper.test?
12
12
 
13
13
  if paths.nil?
14
14
  Actions.sh('git reset --hard HEAD')
@@ -50,7 +50,7 @@ module Fastlane
50
50
  verify_block: proc do |value|
51
51
  path = File.expand_path(value)
52
52
  UI.user_error!("Please pass the path to the project, not the workspace") if path.end_with?(".xcworkspace")
53
- UI.user_error!("Could not find Xcode project at #{path}") unless Helper.is_test? || File.exist?(path)
53
+ UI.user_error!("Could not find Xcode project at #{path}") unless Helper.test? || File.exist?(path)
54
54
  end)
55
55
  ]
56
56
  end
@@ -49,7 +49,7 @@ module Fastlane
49
49
  end
50
50
 
51
51
  def self.should_run?(params)
52
- Helper.is_ci? || params[:force]
52
+ Helper.ci? || params[:force]
53
53
  end
54
54
 
55
55
  #####################################################
@@ -19,7 +19,7 @@ module Fastlane
19
19
 
20
20
  def self.run(params)
21
21
  # Stop if not executed by CI
22
- if !Helper.is_ci? && !params[:force]
22
+ if !Helper.ci? && !params[:force]
23
23
  UI.important("Not executed by Continuous Integration system.")
24
24
  return
25
25
  end
@@ -3,7 +3,7 @@ module Fastlane
3
3
  class SetupTravisAction < Action
4
4
  def self.run(params)
5
5
  # Stop if not executed by CI
6
- if !Helper.is_ci? && !params[:force]
6
+ if !Helper.ci? && !params[:force]
7
7
  UI.message("Currently not running on CI system, skipping travis setup")
8
8
  return
9
9
  end
@@ -37,7 +37,7 @@ module Fastlane
37
37
 
38
38
  slack_attachment = generate_slack_attachments(options)
39
39
 
40
- return [notifier, slack_attachment] if Helper.is_test? # tests will verify the slack attachments and other properties
40
+ return [notifier, slack_attachment] if Helper.test? # tests will verify the slack attachments and other properties
41
41
 
42
42
  begin
43
43
  results = notifier.ping('', icon_url: icon_url, attachments: [slack_attachment])
@@ -14,7 +14,7 @@ module Fastlane
14
14
  # will reanable it when it is fixed
15
15
  # result = Fastlane::Actions.sh(command.join(' '), log: false)
16
16
  shell_command = command.join(' ')
17
- result = Helper.is_test? ? shell_command : `#{shell_command}`
17
+ result = Helper.test? ? shell_command : `#{shell_command}`
18
18
  fail_on_error(result)
19
19
 
20
20
  result
@@ -48,7 +48,7 @@ module Fastlane
48
48
  description: "The path to the entitlement file which contains the app group identifiers", # a short description of this parameter
49
49
  verify_block: proc do |value|
50
50
  UI.user_error!("Please pass a path to an entitlements file. ") unless value.include?(".entitlements")
51
- UI.user_error!("Could not find entitlements file") if !File.exist?(value) and !Helper.is_test?
51
+ UI.user_error!("Could not find entitlements file") if !File.exist?(value) and !Helper.test?
52
52
  end),
53
53
  FastlaneCore::ConfigItem.new(key: :app_group_identifiers,
54
54
  env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_APP_GROUP_IDENTIFIERS",
@@ -56,7 +56,7 @@ module Fastlane
56
56
  description: "The path to the entitlement file which contains the iCloud container identifiers",
57
57
  verify_block: proc do |value|
58
58
  UI.user_error!("Please pass a path to an entitlements file. ") unless value.include?(".entitlements")
59
- UI.user_error!("Could not find entitlements file") if !File.exist?(value) and !Helper.is_test?
59
+ UI.user_error!("Could not find entitlements file") if !File.exist?(value) and !Helper.test?
60
60
  end),
61
61
  FastlaneCore::ConfigItem.new(key: :icloud_container_identifiers,
62
62
  env_name: "FL_UPDATE_ICLOUD_CONTAINER_IDENTIFIERS_IDENTIFIERS",
@@ -26,7 +26,7 @@ module Fastlane
26
26
  lane = platform_lane_info[0]
27
27
  end
28
28
 
29
- dot_env = Helper.is_test? ? nil : options.env
29
+ dot_env = Helper.test? ? nil : options.env
30
30
 
31
31
  if FastlaneCore::FastlaneFolder.swift?
32
32
  disable_runner_upgrades = options.disable_runner_upgrades || false
@@ -56,7 +56,7 @@ module Fastlane
56
56
  end
57
57
 
58
58
  def self.confirm_troubleshoot
59
- if Helper.is_ci?
59
+ if Helper.ci?
60
60
  UI.error("---")
61
61
  UI.error("You are trying to use '--troubleshoot' on CI")
62
62
  UI.error("this option is not usable in CI, as it is insecure")
@@ -7,7 +7,7 @@ module Fastlane
7
7
  # default use case
8
8
  return FastlaneCore::Configuration.create(action.available_options, params)
9
9
  elsif first_element
10
- UI.error("Old configuration format for action '#{action}'") if Helper.is_test?
10
+ UI.error("Old configuration format for action '#{action}'") if Helper.test?
11
11
  return params
12
12
  else
13
13
 
@@ -258,7 +258,7 @@ module Fastlane
258
258
  env_output << "<summary>`#{fastlane_path}`</summary>\n"
259
259
  env_output << "\n"
260
260
  env_output << "```ruby\n"
261
- env_output << File.read(fastlane_path)
261
+ env_output << File.read(fastlane_path, encoding: "utf-8")
262
262
  env_output << "\n```\n"
263
263
  env_output << "</details>"
264
264
  else
@@ -272,7 +272,7 @@ module Fastlane
272
272
  env_output << "<summary>`#{appfile_path}`</summary>\n"
273
273
  env_output << "\n"
274
274
  env_output << "```ruby\n"
275
- env_output << File.read(appfile_path)
275
+ env_output << File.read(appfile_path, encoding: "utf-8")
276
276
  env_output << "\n```\n"
277
277
  env_output << "</details>"
278
278
  else
@@ -16,7 +16,7 @@ module Fastlane
16
16
  return unless (path || '').length > 0
17
17
  UI.user_error!("Could not find Fastfile at path '#{path}'") unless File.exist?(path)
18
18
  @path = File.expand_path(path)
19
- content = File.read(path)
19
+ content = File.read(path, encoding: "utf-8")
20
20
 
21
21
  # From https://github.com/orta/danger/blob/master/lib/danger/Dangerfile.rb
22
22
  if content.tr!('“”‘’‛', %(""'''))
@@ -18,7 +18,7 @@ module Fastlane
18
18
  UI.important(" gem '#{gem_name}'")
19
19
  UI.error("and run `bundle install`")
20
20
 
21
- UI.user_error!("You have to install the `#{gem_name}` gem on this machine") unless Helper.is_test?
21
+ UI.user_error!("You have to install the `#{gem_name}` gem on this machine") unless Helper.test?
22
22
  end
23
23
  true
24
24
  end
@@ -34,7 +34,7 @@ module Fastlane
34
34
  # Start the setup process
35
35
  # rubocop:disable Metrics/BlockNesting
36
36
  def self.start(user: nil, is_swift_fastfile: false)
37
- if FastlaneCore::FastlaneFolder.setup? and !Helper.is_test?
37
+ if FastlaneCore::FastlaneFolder.setup? and !Helper.test?
38
38
  require 'fastlane/lane_list'
39
39
  Fastlane::LaneList.output(FastlaneCore::FastlaneFolder.fastfile_path)
40
40
  UI.important("------------------")
@@ -26,7 +26,7 @@ module Fastlane
26
26
  display_upgraded_message = false
27
27
  if disable_runner_upgrades
28
28
  UI.verbose("disable_runner_upgrades is true, not attempting to update the FastlaneRunner project".yellow)
29
- elsif Helper.is_ci?
29
+ elsif Helper.ci?
30
30
  UI.verbose("Running in CI, not attempting to update the FastlaneRunner project".yellow)
31
31
  else
32
32
  display_upgraded_message = self.ensure_runner_up_to_date_fastlane!
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.79.0.beta.20180124010003'.freeze
2
+ VERSION = '2.79.0.beta.20180125010002'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -39,6 +39,7 @@ require_relative 'fastlane_core/analytics/analytics_event_builder'
39
39
  require_relative 'fastlane_core/analytics/analytics_ingester_client'
40
40
  require_relative 'fastlane_core/analytics/analytics_session'
41
41
  require_relative 'fastlane_core/tag_version'
42
+ require_relative 'fastlane_core/fastlane_pty'
42
43
 
43
44
  # Third Party code
44
45
  require 'colored'
@@ -190,7 +190,7 @@ module FastlaneCore
190
190
  end
191
191
 
192
192
  def ci?
193
- return Helper.is_ci?
193
+ return Helper.ci?
194
194
  end
195
195
 
196
196
  def operating_system_version
@@ -1,5 +1,6 @@
1
1
  require_relative 'ui/ui'
2
2
  require_relative 'globals'
3
+ require_relative 'fastlane_pty'
3
4
 
4
5
  module FastlaneCore
5
6
  # Executes commands and takes care of error handling and more
@@ -19,7 +20,7 @@ module FastlaneCore
19
20
  ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
20
21
  exts.each do |ext|
21
22
  cmd_path = File.join(path, "#{cmd}#{ext}")
22
- return cmd_path if File.executable?(cmd_path) && !File.directory?(cmd_path)
23
+ return cmd_path if Helper.executable?(cmd_path)
23
24
  end
24
25
  end
25
26
 
@@ -46,8 +47,7 @@ module FastlaneCore
46
47
  end
47
48
 
48
49
  begin
49
- require 'pty'
50
- PTY.spawn(command) do |stdin, stdout, pid|
50
+ FastlaneCore::FastlanePty.spawn(command) do |stdin, stdout, pid|
51
51
  begin
52
52
  stdin.each do |l|
53
53
  line = l.strip # strip so that \n gets removed
@@ -198,7 +198,7 @@ module FastlaneCore
198
198
  paths += Dir["./fastlane/#{config_file_name}"]
199
199
  paths += Dir["./.fastlane/#{config_file_name}"]
200
200
  paths += Dir["./#{config_file_name}"]
201
- paths += Dir["./fastlane_core/spec/fixtures/#{config_file_name}"] if Helper.is_test?
201
+ paths += Dir["./fastlane_core/spec/fixtures/#{config_file_name}"] if Helper.test?
202
202
  return nil if paths.count == 0
203
203
  return paths.first
204
204
  end
@@ -231,7 +231,7 @@ module FastlaneCore
231
231
  return value unless value.nil? and !option.optional and ask
232
232
 
233
233
  # fallback to asking
234
- if Helper.is_test? or !UI.interactive?
234
+ if Helper.test? or !UI.interactive?
235
235
  # Since we don't want to be asked on tests, we'll just call the verify block with no value
236
236
  # to raise the exception that is shown when the user passes an invalid value
237
237
  set(key, '')
@@ -31,7 +31,7 @@ module FastlaneCore
31
31
  self.options = {}
32
32
 
33
33
  @block_for_missing = block_for_missing
34
- content = File.read(path)
34
+ content = File.read(path, encoding: "utf-8")
35
35
 
36
36
  # From https://github.com/orta/danger/blob/master/lib/danger/Dangerfile.rb
37
37
  if content.tr!('“”‘’‛', %(""'''))
@@ -0,0 +1,22 @@
1
+ # Source: Mix of https://github.com/fastlane/fastlane/pull/7202/files,
2
+ # https://github.com/fastlane/fastlane/pull/11384#issuecomment-356084518 and
3
+ # https://github.com/DragonBox/u3d/blob/59e471ad78ac00cb629f479dbe386c5ad2dc5075/lib/u3d_core/command_runner.rb#L88-L96
4
+ module FastlaneCore
5
+ class FastlanePty
6
+ def self.spawn(*command, &block)
7
+ require 'pty'
8
+ PTY.spawn(command) do |stdout, stdin, pid|
9
+ block.call(stdin, stdout, pid)
10
+ end
11
+ rescue LoadError
12
+ require 'open3'
13
+ Open3.popen2e(command) do |r, w, p|
14
+ yield(w, r, p.value.pid) # note the inversion
15
+
16
+ r.close
17
+ w.close
18
+ p.value.exitstatus
19
+ end
20
+ end
21
+ end
22
+ end
@@ -9,48 +9,21 @@ require_relative 'env'
9
9
 
10
10
  module FastlaneCore
11
11
  module Helper
12
- # This method is deprecated, use the `UI` class
13
- # https://docs.fastlane.tools/advanced/#user-input-and-output
14
- def self.log
15
- UI.deprecated("Helper.log is deprecated. Use `UI` class instead")
16
- UI.current.log
17
- end
18
-
19
- # Runs a given command using backticks (`)
20
- # and prints them out using the UI.command method
21
- def self.backticks(command, print: true)
22
- UI.command(command) if print
23
- result = `#{command}`
24
- UI.command_output(result) if print
25
- return result
26
- end
27
-
28
- # @return true if the currently running program is a unit test
29
- def self.test?
30
- Object.const_defined?("SpecHelper")
31
- end
12
+ # fastlane
13
+ #
32
14
 
33
- # @return true if it is enabled to execute external commands
34
- def self.sh_enabled?
35
- !self.test?
15
+ def self.fastlane_enabled?
16
+ # This is called from the root context on the first start
17
+ @enabled ||= !FastlaneCore::FastlaneFolder.path.nil?
36
18
  end
37
19
 
38
- # removes ANSI colors from string
39
- def self.strip_ansi_colors(str)
40
- str.gsub(/\e\[([;\d]+)?m/, '')
20
+ # Checks if fastlane is enabled for this project and returns the folder where the configuration lives
21
+ def self.fastlane_enabled_folder_path
22
+ fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
41
23
  end
42
24
 
43
- # checks if given file is a valid json file
44
- # base taken from: http://stackoverflow.com/a/26235831/1945875
45
- def self.json_file?(filename)
46
- return false unless File.exist?(filename)
47
- begin
48
- JSON.parse(File.read(filename))
49
- return true
50
- rescue JSON::ParserError
51
- return false
52
- end
53
- end
25
+ # fastlane installation method
26
+ #
54
27
 
55
28
  # @return [boolean] true if executing with bundler (like 'bundle exec fastlane [action]')
56
29
  def self.bundler?
@@ -83,6 +56,19 @@ module FastlaneCore
83
56
  !self.bundler? && !self.contained_fastlane? && !self.homebrew? && !self.mac_app?
84
57
  end
85
58
 
59
+ # environment
60
+ #
61
+
62
+ # @return true if the currently running program is a unit test
63
+ def self.test?
64
+ Object.const_defined?("SpecHelper")
65
+ end
66
+
67
+ # @return true if it is enabled to execute external commands
68
+ def self.sh_enabled?
69
+ !self.test?
70
+ end
71
+
86
72
  # @return [boolean] true if building in a known CI environment
87
73
  def self.ci?
88
74
  # Check for Jenkins, Travis CI, ... environment variables
@@ -113,23 +99,6 @@ module FastlaneCore
113
99
  (/darwin/ =~ RUBY_PLATFORM) != nil
114
100
  end
115
101
 
116
- # Use Helper.test? and Helper.ci? instead (legacy calls)
117
- def self.is_test?
118
- self.test?
119
- end
120
-
121
- def self.is_ci?
122
- ci?
123
- end
124
-
125
- def self.is_mac?
126
- self.mac?
127
- end
128
-
129
- def self.is_windows?
130
- self.windows?
131
- end
132
-
133
102
  # Do we want to disable the colored output?
134
103
  def self.colors_disabled?
135
104
  FastlaneCore::Env.truthy?("FASTLANE_DISABLE_COLORS")
@@ -145,13 +114,13 @@ module FastlaneCore
145
114
  return ENV["FL_BUILDLOG_PATH"] || "~/Library/Logs"
146
115
  end
147
116
 
148
- # All Xcode Related things
117
+ # Xcode
149
118
  #
150
119
 
151
120
  # @return the full path to the Xcode developer tools of the currently
152
121
  # running system
153
122
  def self.xcode_path
154
- return "" unless self.is_mac?
123
+ return "" unless self.mac?
155
124
 
156
125
  if self.xcode_server?
157
126
  # Xcode server always creates a link here
@@ -170,7 +139,7 @@ module FastlaneCore
170
139
 
171
140
  # @return The version of the currently used Xcode installation (e.g. "7.0")
172
141
  def self.xcode_version
173
- return nil unless self.is_mac?
142
+ return nil unless self.mac?
174
143
  return @xcode_version if @xcode_version && @developer_dir == ENV['DEVELOPER_DIR']
175
144
 
176
145
  xcodebuild_path = "#{xcode_path}/usr/bin/xcodebuild"
@@ -199,6 +168,9 @@ module FastlaneCore
199
168
  Gem::Version.new(v) >= Gem::Version.new(version)
200
169
  end
201
170
 
171
+ # iTMSTransporter
172
+ #
173
+
202
174
  def self.transporter_java_executable_path
203
175
  return File.join(self.transporter_java_path, 'bin', 'java')
204
176
  end
@@ -224,6 +196,24 @@ module FastlaneCore
224
196
  return File.join(self.itms_path, 'bin', 'iTMSTransporter')
225
197
  end
226
198
 
199
+ # @return the full path to the iTMSTransporter executable
200
+ def self.itms_path
201
+ return ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"] if FastlaneCore::Env.truthy?("FASTLANE_ITUNES_TRANSPORTER_PATH")
202
+ return '' unless self.mac? # so tests work on Linux and Windows too
203
+
204
+ [
205
+ "../Applications/Application Loader.app/Contents/MacOS/itms",
206
+ "../Applications/Application Loader.app/Contents/itms"
207
+ ].each do |path|
208
+ result = File.expand_path(File.join(self.xcode_path, path))
209
+ return result if File.exist?(result)
210
+ end
211
+ UI.user_error!("Could not find transporter at #{self.xcode_path}. Please make sure you set the correct path to your Xcode installation.")
212
+ end
213
+
214
+ # keychain
215
+ #
216
+
227
217
  def self.keychain_path(keychain_name)
228
218
  # Existing code expects that a keychain name will be expanded into a default path to Library/Keychains
229
219
  # in the user's home directory. However, this will not allow the user to pass an absolute path
@@ -259,44 +249,25 @@ module FastlaneCore
259
249
  keychain_path
260
250
  end
261
251
 
262
- # @return the full path to the iTMSTransporter executable
263
- def self.itms_path
264
- return ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"] if FastlaneCore::Env.truthy?("FASTLANE_ITUNES_TRANSPORTER_PATH")
265
- return '' unless self.is_mac? # so tests work on Linx too
266
-
267
- [
268
- "../Applications/Application Loader.app/Contents/MacOS/itms",
269
- "../Applications/Application Loader.app/Contents/itms"
270
- ].each do |path|
271
- result = File.expand_path(File.join(self.xcode_path, path))
272
- return result if File.exist?(result)
273
- end
274
- UI.user_error!("Could not find transporter at #{self.xcode_path}. Please make sure you set the correct path to your Xcode installation.")
275
- end
252
+ # helper methods
253
+ #
276
254
 
277
- def self.fastlane_enabled?
278
- # This is called from the root context on the first start
279
- @enabled ||= !FastlaneCore::FastlaneFolder.path.nil?
255
+ # Runs a given command using backticks (`)
256
+ # and prints them out using the UI.command method
257
+ def self.backticks(command, print: true)
258
+ UI.command(command) if print
259
+ result = `#{command}`
260
+ UI.command_output(result) if print
261
+ return result
280
262
  end
281
263
 
282
- # Checks if fastlane is enabled for this project and returns the folder where the configuration lives
283
- def self.fastlane_enabled_folder_path
284
- fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
264
+ # removes ANSI colors from string
265
+ def self.strip_ansi_colors(str)
266
+ str.gsub(/\e\[([;\d]+)?m/, '')
285
267
  end
286
268
 
287
- # <b>DEPRECATED:</b> Use the `ROOT` constant from the appropriate tool module instead
288
- # e.g. File.join(Sigh::ROOT, 'lib', 'assets', 'resign.sh')
269
+ # loading indicator
289
270
  #
290
- # Path to the installed gem to load resources (e.g. resign.sh)
291
- def self.gem_path(gem_name)
292
- UI.deprecated('`Helper.gem_path` is deprecated. Use the `ROOT` constant from the appropriate tool module instead.')
293
-
294
- if !Helper.is_test? and Gem::Specification.find_all_by_name(gem_name).any?
295
- return Gem::Specification.find_by_name(gem_name).gem_dir
296
- else
297
- return './'
298
- end
299
- end
300
271
 
301
272
  def self.should_show_loading_indicator?
302
273
  return false if FastlaneCore::Env.truthy?("FASTLANE_DISABLE_ANIMATION")
@@ -322,5 +293,67 @@ module FastlaneCore
322
293
  @require_fastlane_spinner.success
323
294
  end
324
295
  end
296
+
297
+ # files
298
+ #
299
+
300
+ # checks if a given path is an executable file
301
+ def self.executable?(cmd_path)
302
+ # no executable files on Windows, so existing is enough there
303
+ cmd_path && !File.directory?(cmd_path) && (File.executable?(cmd_path) || (self.windows? && File.exist?(cmd_path)))
304
+ end
305
+
306
+ # checks if given file is a valid json file
307
+ # base taken from: http://stackoverflow.com/a/26235831/1945875
308
+ def self.json_file?(filename)
309
+ return false unless File.exist?(filename)
310
+ begin
311
+ JSON.parse(File.read(filename))
312
+ return true
313
+ rescue JSON::ParserError
314
+ return false
315
+ end
316
+ end
317
+
318
+ # deprecated
319
+ #
320
+
321
+ # Use Helper.test?, Helper.ci?, Helper.mac? or Helper.windows? instead (legacy calls)
322
+ def self.is_test?
323
+ self.test?
324
+ end
325
+
326
+ def self.is_ci?
327
+ ci?
328
+ end
329
+
330
+ def self.is_mac?
331
+ self.mac?
332
+ end
333
+
334
+ def self.is_windows?
335
+ self.windows?
336
+ end
337
+
338
+ # <b>DEPRECATED:</b> Use the `ROOT` constant from the appropriate tool module instead
339
+ # e.g. File.join(Sigh::ROOT, 'lib', 'assets', 'resign.sh')
340
+ #
341
+ # Path to the installed gem to load resources (e.g. resign.sh)
342
+ def self.gem_path(gem_name)
343
+ UI.deprecated('`Helper.gem_path` is deprecated. Use the `ROOT` constant from the appropriate tool module instead.')
344
+
345
+ if !Helper.test? and Gem::Specification.find_all_by_name(gem_name).any?
346
+ return Gem::Specification.find_by_name(gem_name).gem_dir
347
+ else
348
+ return './'
349
+ end
350
+ end
351
+
352
+ # This method is deprecated, use the `UI` class
353
+ # https://docs.fastlane.tools/advanced/#user-input-and-output
354
+ def self.log
355
+ UI.deprecated("Helper.log is deprecated. Use `UI` class instead")
356
+ UI.current.log
357
+ end
325
358
  end
326
359
  end
@@ -1,10 +1,10 @@
1
- require 'pty'
2
1
  require 'shellwords'
3
2
  require 'fileutils'
4
3
  require 'credentials_manager/account_manager'
5
4
 
6
5
  require_relative 'features'
7
6
  require_relative 'helper'
7
+ require_relative 'fastlane_pty'
8
8
 
9
9
  module FastlaneCore
10
10
  # The TransporterInputError occurs when you passed wrong inputs to the {Deliver::ItunesTransporter}
@@ -31,7 +31,7 @@ module FastlaneCore
31
31
  private_constant :ERROR_REGEX, :WARNING_REGEX, :OUTPUT_REGEX, :RETURN_VALUE_REGEX, :SKIP_ERRORS
32
32
 
33
33
  def execute(command, hide_output)
34
- return command if Helper.is_test?
34
+ return command if Helper.test?
35
35
 
36
36
  @errors = []
37
37
  @warnings = []
@@ -44,7 +44,7 @@ module FastlaneCore
44
44
  end
45
45
 
46
46
  begin
47
- PTY.spawn(command) do |stdin, stdout, pid|
47
+ FastlaneCore::FastlanePty.spawn(command) do |stdin, stdout, pid|
48
48
  begin
49
49
  stdin.each do |line|
50
50
  @all_lines << line
@@ -113,7 +113,7 @@ module FastlaneCore
113
113
  if $1.include?("Your Apple ID or password was entered incorrectly") or
114
114
  $1.include?("This Apple ID has been locked for security reasons")
115
115
 
116
- unless Helper.is_test?
116
+ unless Helper.test?
117
117
  CredentialsManager::AccountManager.new(user: @user).invalid_credentials
118
118
  UI.error("Please run this tool again to apply the new password")
119
119
  end
@@ -255,7 +255,7 @@ module FastlaneCore
255
255
  end
256
256
 
257
257
  def java_code_option
258
- if Helper.is_mac? && Helper.xcode_at_least?(9)
258
+ if Helper.mac? && Helper.xcode_at_least?(9)
259
259
  return "-jar #{Helper.transporter_java_jar_path.shellescape}"
260
260
  else
261
261
  return "-classpath #{Helper.transporter_java_jar_path.shellescape} com.apple.transporter.Application"
@@ -337,7 +337,7 @@ module FastlaneCore
337
337
  return download(app_id, dir)
338
338
  end
339
339
 
340
- return result if Helper.is_test?
340
+ return result if Helper.test?
341
341
 
342
342
  itmsp_path = File.join(dir, "#{app_id}.itmsp")
343
343
  successful = result && File.directory?(itmsp_path)
@@ -376,7 +376,7 @@ module FastlaneCore
376
376
  if result
377
377
  UI.header("Successfully uploaded package to iTunes Connect. It might take a few minutes until it's visible online.")
378
378
 
379
- FileUtils.rm_rf(actual_dir) unless Helper.is_test? # we don't need the package any more, since the upload was successful
379
+ FileUtils.rm_rf(actual_dir) unless Helper.test? # we don't need the package any more, since the upload was successful
380
380
  else
381
381
  handle_error(@password)
382
382
  end
@@ -131,7 +131,7 @@ module FastlaneCore
131
131
  elsif automated_scheme_selection? && schemes.include?(project_name)
132
132
  UI.important("Using scheme matching project name (#{project_name}).")
133
133
  options[:scheme] = project_name
134
- elsif Helper.is_ci?
134
+ elsif Helper.ci?
135
135
  UI.error("Multiple schemes found but you haven't specified one.")
136
136
  UI.error("Since this is a CI, please pass one using the `scheme` option")
137
137
  show_scheme_shared_information
@@ -38,7 +38,7 @@ module FastlaneCore
38
38
 
39
39
  def self.should_be_shown?
40
40
  return false unless FastlaneCore::Env.truthy?("FL_ENABLE_LOGO_ANIMATION")
41
- return false if Helper.is_ci?
41
+ return false if Helper.ci?
42
42
  return false unless UI.interactive?
43
43
  return true
44
44
  end
@@ -59,7 +59,7 @@ module FastlaneCore
59
59
  def did_finish
60
60
  return false if FastlaneCore::Env.truthy?("FASTLANE_OPT_OUT_USAGE")
61
61
 
62
- if !did_show_message? and !Helper.is_ci?
62
+ if !did_show_message? and !Helper.ci?
63
63
  show_message
64
64
  end
65
65
 
@@ -15,7 +15,7 @@ module FastlaneCore
15
15
 
16
16
  $stdout.sync = true
17
17
 
18
- if Helper.is_test? && !ENV.key?('DEBUG')
18
+ if Helper.test? && !ENV.key?('DEBUG')
19
19
  $stdout.puts("Logging disabled while running tests. Force them by setting the DEBUG environment variable")
20
20
  @log ||= Logger.new(nil) # don't show any logs when running tests
21
21
  else
@@ -10,7 +10,7 @@ module FastlaneCore
10
10
  # Verifies, the user runs the latest version of this gem
11
11
  class UpdateChecker
12
12
  def self.start_looking_for_update(gem_name)
13
- return if Helper.is_test?
13
+ return if Helper.test?
14
14
  return if FastlaneCore::Env.truthy?("FASTLANE_SKIP_UPDATE_CHECK")
15
15
 
16
16
  @start_time = Time.now
@@ -124,7 +124,7 @@ module FastlaneCore
124
124
 
125
125
  def self.send_launch_analytic_events_for(gem_name)
126
126
  return if FastlaneCore::Env.truthy?("FASTLANE_OPT_OUT_USAGE")
127
- ci = Helper.is_ci?.to_s
127
+ ci = Helper.ci?.to_s
128
128
  app_id_guesser = FastlaneCore::AppIdentifierGuesser.new(args: ARGV, gem_name: gem_name)
129
129
  project_hash = app_id_guesser.p_hash
130
130
  p_hash = project_hash if project_hash
@@ -198,7 +198,7 @@ module FastlaneCore
198
198
  def self.send_completion_events_for(gem_name)
199
199
  return if FastlaneCore::Env.truthy?("FASTLANE_OPT_OUT_USAGE")
200
200
 
201
- ci = Helper.is_ci?.to_s
201
+ ci = Helper.ci?.to_s
202
202
  install_method = if Helper.rubygems?
203
203
  'gem'
204
204
  elsif Helper.bundler?
@@ -1,4 +1,3 @@
1
- require 'pty'
2
1
  require 'open3'
3
2
  require 'fileutils'
4
3
  require 'shellwords'
@@ -108,7 +108,7 @@ module Match
108
108
 
109
109
  # On non-Mac systems (more specific Ubuntu Linux) it might take some time for the file to actually be there (see #11182).
110
110
  # To try to circumvent this flakyness (in tests), we wait a bit until the file appears (max 2s) (usually only 0.1 is actually waited)
111
- unless FastlaneCore::Helper.is_mac?
111
+ unless FastlaneCore::Helper.mac?
112
112
  count = 0
113
113
  # sleep until file exists or 20*0.1s (=2s) passed
114
114
  until File.exist?(tmpfile) || count == 20
@@ -1,4 +1,3 @@
1
- require 'pty'
2
1
  require 'open3'
3
2
  require 'fileutils'
4
3
  require 'terminal-table'
@@ -88,7 +87,7 @@ module Scan
88
87
  UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}")
89
88
  end
90
89
 
91
- if !Helper.is_ci? && Scan.cache[:open_html_report_path]
90
+ if !Helper.ci? && Scan.cache[:open_html_report_path]
92
91
  `open --hide '#{Scan.cache[:open_html_report_path]}'`
93
92
  end
94
93
  end
@@ -1,3 +1,4 @@
1
+ require_relative 'module'
1
2
  require 'fastlane_core/command_executor'
2
3
 
3
4
  module Screengrab
@@ -84,7 +85,7 @@ module Screengrab
84
85
  end
85
86
 
86
87
  def executable_command?(cmd_path)
87
- cmd_path && File.executable?(cmd_path) && !File.directory?(cmd_path)
88
+ Helper.executable?(cmd_path)
88
89
  end
89
90
  end
90
91
  end
@@ -1,10 +1,10 @@
1
1
  require_relative 'module'
2
+ require 'fastlane_core/fastlane_pty'
2
3
 
3
4
  module Snapshot
4
5
  # This class takes care of rotating images
5
6
  class ScreenshotRotate
6
7
  require 'shellwords'
7
- require 'pty'
8
8
 
9
9
  # @param (String) The path in which the screenshots are located in
10
10
  def run(path)
@@ -28,7 +28,7 @@ module Snapshot
28
28
  next unless command
29
29
 
30
30
  # Only rotate if we need to
31
- PTY.spawn(command) do |r, w, pid|
31
+ FastlaneCore::FastlanePty.spawn(command) do |r, w, pid|
32
32
  r.sync
33
33
  r.each do |line|
34
34
  # We need to read this otherwise things hang
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.79.0.beta.20180124010003
4
+ version: 2.79.0.beta.20180125010002
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Holtz
@@ -25,7 +25,7 @@ authors:
25
25
  autorequire:
26
26
  bindir: bin
27
27
  cert_chain: []
28
- date: 2018-01-24 00:00:00.000000000 Z
28
+ date: 2018-01-25 00:00:00.000000000 Z
29
29
  dependencies:
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: slack-notifier
@@ -1270,6 +1270,7 @@ files:
1270
1270
  - fastlane_core/lib/fastlane_core/device_manager.rb
1271
1271
  - fastlane_core/lib/fastlane_core/env.rb
1272
1272
  - fastlane_core/lib/fastlane_core/fastlane_folder.rb
1273
+ - fastlane_core/lib/fastlane_core/fastlane_pty.rb
1273
1274
  - fastlane_core/lib/fastlane_core/feature/feature.rb
1274
1275
  - fastlane_core/lib/fastlane_core/features.rb
1275
1276
  - fastlane_core/lib/fastlane_core/globals.rb