fastlane 2.60.0.beta.20171002010004 → 2.60.0.beta.20171003010003

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: 00cc61a0fde36d402aff41fe7755076cbc6c1609
4
- data.tar.gz: ec991523fe16c9c650eccb5f6abb0a9567593260
3
+ metadata.gz: 790b0387d44023f9553c452fb1882209294de7bc
4
+ data.tar.gz: 68cda47f53a256bd990be4bc2331e889075ef759
5
5
  SHA512:
6
- metadata.gz: 72db96cea2ded8d230d36702e41a69e1698a80db3dbe72129e207f237a44e7f2bf3c1afb7b7bd147d96ec1605a83a59e6aefa2d6255714e0b13ed468e48771c3
7
- data.tar.gz: 852ccbd46a9a2043952e1b8b0c0a80739405fbd18eda77732d5fb67fa49ce2d6a3d9ad167666c59ed02fe92d81e9af76e346d7d1476539c66ae1791d5bf703a9
6
+ metadata.gz: feb072975461efd0c496e94315bcbbe6f4d393c7c039b1f991aee7dc0dfb2dd600f149983ee4c920b9614bc299001eba578f54882c87ce7b3ddd93f2b25867ba
7
+ data.tar.gz: 66b232a7b6622ddc05bf3f2145a49fa6f332766eb93a47712b0ded475596b5101bd30db73bfd1b5d676b8bdccc8dc9e9dfc1d83303b84c3534f20791bf5688b3
@@ -1,5 +1,5 @@
1
1
  # Customise this file, documentation can be found here:
2
- # https://github.com/fastlane/fastlane/tree/master/fastlane/docs
2
+ # https://docs.fastlane.tools/actions/
3
3
  # All available actions: https://docs.fastlane.tools/actions
4
4
  # can also be listed using the `fastlane actions` command
5
5
 
@@ -1,5 +1,5 @@
1
1
  # Customise this file, documentation can be found here:
2
- # https://github.com/fastlane/fastlane/tree/master/fastlane/docs
2
+ # https://docs.fastlane.tools/actions/
3
3
  # All available actions: https://docs.fastlane.tools/actions
4
4
  # can also be listed using the `fastlane actions` command
5
5
 
@@ -85,7 +85,7 @@ module Fastlane
85
85
  def ensure_name_not_conflicts(name)
86
86
  # First, check if there is a predefined method in the actions folder
87
87
  return unless Actions.action_class_ref(name)
88
- UI.error("Name of the lane '#{name}' is already taken by the action named '#{name}'")
88
+ UI.important("Name of the lane '#{name}' is already taken by the action named '#{name}'")
89
89
  end
90
90
  end
91
91
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.60.0.beta.20171002010004'.freeze
2
+ VERSION = '2.60.0.beta.20171003010003'.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
  end
@@ -0,0 +1,74 @@
1
+ module FastlaneCore
2
+ class AndroidPackageNameGuesser
3
+ class << self
4
+ def android_package_name_arg?(gem_name, arg)
5
+ return arg == "--package_name" ||
6
+ arg == "--app_package_name" ||
7
+ (arg == '-p' && gem_name == 'supply') ||
8
+ (arg == '-a' && gem_name == 'screengrab')
9
+ end
10
+
11
+ def guess_package_name_from_args(gem_name, args)
12
+ # args example: ["-a", "com.krausefx.app"]
13
+ package_name = nil
14
+ args.each_with_index do |current, index|
15
+ next unless android_package_name_arg?(gem_name, current)
16
+ # argument names are followed by argument values in the args array;
17
+ # use [index + 1] to find the package name (range check the array
18
+ # to avoid array bounds errors)
19
+ package_name = args[index + 1] if args.count > index
20
+ break
21
+ end
22
+ package_name
23
+ end
24
+
25
+ def guess_package_name_from_environment
26
+ package_name = nil
27
+ package_name ||= ENV["SUPPLY_PACKAGE_NAME"] if FastlaneCore::Env.truthy?("SUPPLY_PACKAGE_NAME")
28
+ package_name ||= ENV["SCREENGRAB_APP_PACKAGE_NAME"] if FastlaneCore::Env.truthy?("SCREENGRAB_APP_PACKAGE_NAME")
29
+ package_name
30
+ end
31
+
32
+ def guess_package_name_from_appfile
33
+ CredentialsManager::AppfileConfig.try_fetch_value(:package_name)
34
+ end
35
+
36
+ def fetch_package_name_from_file(file_name, package_name_key)
37
+ # we only care about the package name item in the configuration file, so
38
+ # build an options array & Configuration with just that one key and it will
39
+ # be fetched if it is present in the config file
40
+ genericfile_options = [FastlaneCore::ConfigItem.new(key: package_name_key)]
41
+ options = FastlaneCore::Configuration.create(genericfile_options, {})
42
+ # pass the empty proc to disable options validation, otherwise this will fail
43
+ # when the other (non-package name) keys are encountered in the config file;
44
+ # 3rd parameter "true" disables the printout of the contents of the
45
+ # configuration file, which is noisy and confusing in this case
46
+ options.load_configuration_file(file_name, proc {}, true)
47
+ return options.fetch(package_name_key, ask: false)
48
+ rescue
49
+ # any option/file error here should just be treated as identifier not found
50
+ nil
51
+ end
52
+
53
+ def guess_package_name_from_config_files
54
+ package_name = nil
55
+ package_name ||= fetch_package_name_from_file("Supplyfile", :package_name)
56
+ package_name ||= fetch_package_name_from_file("Screengrabfile", :app_package_name)
57
+ package_name
58
+ end
59
+
60
+ # make a best-guess for the package_name for this project, using most-reliable signals
61
+ # first and then using less accurate ones afterwards; because this method only returns
62
+ # a GUESS for the package_name, it is only useful for metrics or other places where
63
+ # absolute accuracy is not required
64
+ def guess_package_name(gem_name, args)
65
+ package_name = nil
66
+ package_name ||= guess_package_name_from_args(gem_name, args)
67
+ package_name ||= guess_package_name_from_environment
68
+ package_name ||= guess_package_name_from_appfile
69
+ package_name ||= guess_package_name_from_config_files
70
+ package_name
71
+ end
72
+ end
73
+ end
74
+ end
@@ -158,7 +158,7 @@ module FastlaneCore
158
158
  # @param config_file_name [String] The name of the configuration file to use (optional)
159
159
  # @param block_for_missing [Block] A ruby block that is called when there is an unknown method
160
160
  # in the configuration file
161
- def load_configuration_file(config_file_name = nil, block_for_missing = nil)
161
+ def load_configuration_file(config_file_name = nil, block_for_missing = nil, skip_printing_values = false)
162
162
  return unless config_file_name
163
163
 
164
164
  self.config_file_name = config_file_name
@@ -171,7 +171,7 @@ module FastlaneCore
171
171
  return if paths.count == 0
172
172
 
173
173
  path = paths.first
174
- configuration_file = ConfigurationFile.new(self, path, block_for_missing)
174
+ configuration_file = ConfigurationFile.new(self, path, block_for_missing, skip_printing_values)
175
175
  verify_conflicts # important, since user can set conflicting options in configuration file
176
176
  configuration_file
177
177
  end
@@ -9,7 +9,7 @@ module FastlaneCore
9
9
 
10
10
  # @param config [FastlaneCore::Configuration] is stored to save the resulting values
11
11
  # @param path [String] The path to the configuration file to use
12
- def initialize(config, path, block_for_missing)
12
+ def initialize(config, path, block_for_missing, skip_printing_values = false)
13
13
  self.config = config
14
14
  self.configfile_path = path
15
15
 
@@ -29,7 +29,7 @@ module FastlaneCore
29
29
  eval(content) # this is okay in this case
30
30
  # rubocop:enable Security/Eval
31
31
 
32
- print_resulting_config_values # only on success
32
+ print_resulting_config_values unless skip_printing_values # only on success
33
33
  rescue SyntaxError => ex
34
34
  line = ex.to_s.match(/\(eval\):(\d+)/)[1]
35
35
  UI.user_error!("Syntax error in your configuration file '#{path}' on line #{line}: #{ex}")
@@ -0,0 +1,66 @@
1
+ module FastlaneCore
2
+ class IOSAppIdentifierGuesser
3
+ class << self
4
+ def guess_app_identifier_from_args(args)
5
+ # args example: ["-a", "com.krausefx.app", "--team_id", "5AA97AAHK2"]
6
+ args.each_with_index do |current, index|
7
+ next unless current == "-a" || current == "--app_identifier"
8
+ # argument names are followed by argument values in the args array;
9
+ # use [index + 1] to find the package name (range check the array
10
+ # to avoid array bounds errors)
11
+ return args[index + 1] if args.count > index
12
+ end
13
+ nil
14
+ end
15
+
16
+ def guess_app_identifier_from_environment
17
+ ["FASTLANE", "DELIVER", "PILOT", "PRODUCE", "PEM", "SIGH", "SNAPSHOT", "MATCH"].each do |current|
18
+ return ENV["#{current}_APP_IDENTIFIER"] if FastlaneCore::Env.truthy?("#{current}_APP_IDENTIFIER")
19
+ end
20
+ nil
21
+ end
22
+
23
+ def guess_app_identifier_from_appfile
24
+ CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
25
+ end
26
+
27
+ def fetch_app_identifier_from_file(file_name)
28
+ # we only care about the app_identifier item in the configuration file, so
29
+ # build an options array & Configuration with just that one key and it will
30
+ # be fetched if it is present in the config file
31
+ genericfile_options = [FastlaneCore::ConfigItem.new(key: :app_identifier)]
32
+ options = FastlaneCore::Configuration.create(genericfile_options, {})
33
+ # pass the empty proc to disable options validation, otherwise this will fail
34
+ # when the other (non-app_identifier) keys are encountered in the config file;
35
+ # 3rd parameter "true" disables the printout of the contents of the
36
+ # configuration file, which is noisy and confusing in this case
37
+ options.load_configuration_file(file_name, proc {}, true)
38
+ return options.fetch(:app_identifier, ask: false)
39
+ rescue
40
+ # any option/file error here should just be treated as identifier not found
41
+ nil
42
+ end
43
+
44
+ def guess_app_identifier_from_config_files
45
+ ["Deliverfile", "Gymfile", "Snapfile", "Matchfile"].each do |current|
46
+ app_identifier = self.fetch_app_identifier_from_file(current)
47
+ return app_identifier if app_identifier
48
+ end
49
+ nil
50
+ end
51
+
52
+ # make a best-guess for the app_identifier for this project, using most-reliable signals
53
+ # first and then using less accurate ones afterwards; because this method only returns
54
+ # a GUESS for the app_identifier, it is only useful for metrics or other places where
55
+ # absolute accuracy is not required
56
+ def guess_app_identifier(args)
57
+ app_identifier = nil
58
+ app_identifier ||= guess_app_identifier_from_args(args)
59
+ app_identifier ||= guess_app_identifier_from_environment
60
+ app_identifier ||= guess_app_identifier_from_appfile
61
+ app_identifier ||= guess_app_identifier_from_config_files
62
+ app_identifier
63
+ end
64
+ end
65
+ end
66
+ end
@@ -2,6 +2,8 @@ require 'excon'
2
2
  require 'digest'
3
3
 
4
4
  require 'fastlane_core/update_checker/changelog'
5
+ require 'fastlane_core/ios_app_identifier_guesser'
6
+ require 'fastlane_core/android_package_name_guesser'
5
7
 
6
8
  module FastlaneCore
7
9
  # Verifies, the user runs the latest version of this gem
@@ -121,18 +123,7 @@ module FastlaneCore
121
123
 
122
124
  # (optional) Returns the app identifier for the current tool
123
125
  def self.ios_app_identifier(args)
124
- # args example: ["-a", "com.krausefx.app", "--team_id", "5AA97AAHK2"]
125
- args.each_with_index do |current, index|
126
- if current == "-a" || current == "--app_identifier"
127
- return args[index + 1] if args.count > index
128
- end
129
- end
130
-
131
- ["FASTLANE", "DELIVER", "PILOT", "PRODUCE", "PEM", "SIGH", "SNAPSHOT", "MATCH"].each do |current|
132
- return ENV["#{current}_APP_IDENTIFIER"] if FastlaneCore::Env.truthy?("#{current}_APP_IDENTIFIER")
133
- end
134
-
135
- return CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
126
+ return FastlaneCore::IOSAppIdentifierGuesser.guess_app_identifier(args)
136
127
  rescue
137
128
  nil # we don't want this method to cause a crash
138
129
  end
@@ -143,18 +134,7 @@ module FastlaneCore
143
134
  # fastlane supply --skip_upload_screenshots -a beta -p com.test.app should return com.test.app
144
135
  # screengrab -a com.test.app should return com.test.app
145
136
  def self.android_app_identifier(args, gem_name)
146
- app_identifier = nil
147
- # args example: ["-a", "com.krausefx.app"]
148
- args.each_with_index do |current, index|
149
- if android_app_identifier_arg?(gem_name, current)
150
- app_identifier = args[index + 1] if args.count > index
151
- break
152
- end
153
- end
154
-
155
- app_identifier ||= ENV["SUPPLY_PACKAGE_NAME"] if FastlaneCore::Env.truthy?("SUPPLY_PACKAGE_NAME")
156
- app_identifier ||= ENV["SCREENGRAB_APP_PACKAGE_NAME"] if FastlaneCore::Env.truthy?("SCREENGRAB_APP_PACKAGE_NAME")
157
- app_identifier ||= CredentialsManager::AppfileConfig.try_fetch_value(:package_name)
137
+ app_identifier = FastlaneCore::AndroidPackageNameGuesser.guess_package_name(gem_name, args)
158
138
 
159
139
  # Add Android prefix to prevent collisions if there is an iOS app with the same identifier
160
140
  app_identifier ? "android_project_#{app_identifier}" : nil
@@ -162,13 +142,6 @@ module FastlaneCore
162
142
  nil # we don't want this method to cause a crash
163
143
  end
164
144
 
165
- def self.android_app_identifier_arg?(gem_name, arg)
166
- return arg == "--package_name" ||
167
- arg == "--app_package_name" ||
168
- (arg == '-p' && gem_name == 'supply') ||
169
- (arg == '-a' && gem_name == 'screengrab')
170
- end
171
-
172
145
  # To not count the same projects multiple time for the number of launches
173
146
  # Learn more at https://github.com/fastlane/fastlane#metrics
174
147
  # Use the `FASTLANE_OPT_OUT_USAGE` variable to opt out
@@ -1,5 +1,7 @@
1
1
  module Match
2
2
  class GitHelper
3
+ MATCH_VERSION_FILE_NAME = "match_version.txt"
4
+
3
5
  def self.clone(git_url,
4
6
  shallow_clone,
5
7
  manual_password: nil,
@@ -62,7 +64,6 @@ module Match
62
64
  return self.clone(git_url, shallow_clone)
63
65
  end
64
66
 
65
- copy_readme(@dir) unless skip_docs
66
67
  Encrypt.new.decrypt_repo(path: @dir, git_url: git_url, manual_password: manual_password)
67
68
 
68
69
  return @dir
@@ -80,21 +81,45 @@ module Match
80
81
  end
81
82
 
82
83
  def self.match_version(workspace)
83
- path = File.join(workspace, "match_version.txt")
84
+ path = File.join(workspace, MATCH_VERSION_FILE_NAME)
84
85
  if File.exist?(path)
85
86
  Gem::Version.new(File.read(path))
86
87
  end
87
88
  end
88
89
 
89
- def self.commit_changes(path, message, git_url, branch = "master")
90
+ def self.commit_changes(path, message, git_url, branch = "master", files_to_commmit = nil)
91
+ files_to_commmit ||= []
90
92
  Dir.chdir(path) do
91
93
  return if `git status`.include?("nothing to commit")
92
94
 
93
95
  Encrypt.new.encrypt_repo(path: path, git_url: git_url)
94
- File.write("match_version.txt", Fastlane::VERSION) # unencrypted
95
-
96
96
  commands = []
97
- commands << "git add -A"
97
+
98
+ if files_to_commmit.count > 0 # e.g. for nuke this is treated differently
99
+ if !File.exist?(MATCH_VERSION_FILE_NAME) || File.read(MATCH_VERSION_FILE_NAME) != Fastlane::VERSION.to_s
100
+ files_to_commmit << MATCH_VERSION_FILE_NAME
101
+ File.write(MATCH_VERSION_FILE_NAME, Fastlane::VERSION) # stored unencrypted
102
+ end
103
+
104
+ template = File.read("#{Match::ROOT}/lib/assets/READMETemplate.md")
105
+ readme_path = "README.md"
106
+ if !File.exist?(readme_path) || File.read(readme_path) != template
107
+ files_to_commmit << readme_path
108
+ File.write(readme_path, template)
109
+ end
110
+
111
+ # `git add` each file we want to commit
112
+ # - Fixes https://github.com/fastlane/fastlane/issues/8917
113
+ # - Fixes https://github.com/fastlane/fastlane/issues/8793
114
+ # - Replaces, closes and fixes https://github.com/fastlane/fastlane/pull/8919
115
+ commands += files_to_commmit.map do |current_file|
116
+ "git add #{current_file.shellescape}"
117
+ end
118
+ else
119
+ # No specific list given, e.g. this happens on `fastlane match nuke`
120
+ # We just want to run `git add -A` to commit everything
121
+ commands << "git add -A"
122
+ end
98
123
  commands << "git commit -m #{message.shellescape}"
99
124
  commands << "GIT_TERMINAL_PROMPT=0 git push origin #{branch.shellescape}"
100
125
 
@@ -158,12 +183,6 @@ module Match
158
183
  return !result.empty?
159
184
  end
160
185
 
161
- # Copies the README.md into the git repo
162
- def self.copy_readme(directory)
163
- template = File.read("#{Match::ROOT}/lib/assets/READMETemplate.md")
164
- File.write(File.join(directory, "README.md"), template)
165
- end
166
-
167
186
  def self.add_user_config(user_name, user_email)
168
187
  # Add git config if needed
169
188
  commands = []
@@ -1,9 +1,11 @@
1
1
  module Match
2
2
  class Runner
3
- attr_accessor :changes_to_commit
3
+ attr_accessor :files_to_commmit
4
4
  attr_accessor :spaceship
5
5
 
6
6
  def run(params)
7
+ self.files_to_commmit = []
8
+
7
9
  FastlaneCore::PrintTable.print_values(config: params,
8
10
  hide_keys: [:workspace],
9
11
  title: "Summary for match #{Fastlane::VERSION}")
@@ -50,9 +52,9 @@ module Match
50
52
  end
51
53
 
52
54
  # Done
53
- if self.changes_to_commit and !params[:readonly]
55
+ if self.files_to_commmit.count > 0 and !params[:readonly]
54
56
  message = GitHelper.generate_commit_message(params)
55
- GitHelper.commit_changes(params[:workspace], message, params[:git_url], params[:git_branch])
57
+ GitHelper.commit_changes(params[:workspace], message, params[:git_url], params[:git_branch], self.files_to_commmit)
56
58
  end
57
59
 
58
60
  # Print a summary table for each app_identifier
@@ -81,7 +83,7 @@ module Match
81
83
  UI.important "Couldn't find a valid code signing identity in the git repo for #{cert_type}... creating one for you now"
82
84
  UI.crash!("No code signing identity found and can not create a new one because you enabled `readonly`") if params[:readonly]
83
85
  cert_path = Generator.generate_certificate(params, cert_type)
84
- self.changes_to_commit = true
86
+ self.files_to_commmit << cert_path
85
87
  else
86
88
  cert_path = certs.last
87
89
  UI.message "Installing certificate..."
@@ -144,7 +146,7 @@ module Match
144
146
  prov_type: prov_type,
145
147
  certificate_id: certificate_id,
146
148
  app_identifier: app_identifier)
147
- self.changes_to_commit = true
149
+ self.files_to_commmit << profile
148
150
  end
149
151
 
150
152
  installed_profile = FastlaneCore::ProvisioningProfile.install(profile)
@@ -155,7 +157,7 @@ module Match
155
157
  if spaceship && !spaceship.profile_exists(username: params[:username], uuid: uuid)
156
158
  # This profile is invalid, let's remove the local file and generate a new one
157
159
  File.delete(profile)
158
- self.changes_to_commit = true
160
+ # This method will be called again, no need to modify `files_to_commmit`
159
161
  return nil
160
162
  end
161
163
 
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.60.0.beta.20171002010004
4
+ version: 2.60.0.beta.20171003010003
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-10-02 00:00:00.000000000 Z
18
+ date: 2017-10-03 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier
@@ -1121,6 +1121,7 @@ files:
1121
1121
  - fastlane_core/README.md
1122
1122
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1123
1123
  - fastlane_core/lib/fastlane_core.rb
1124
+ - fastlane_core/lib/fastlane_core/android_package_name_guesser.rb
1124
1125
  - fastlane_core/lib/fastlane_core/build_watcher.rb
1125
1126
  - fastlane_core/lib/fastlane_core/cert_checker.rb
1126
1127
  - fastlane_core/lib/fastlane_core/command_executor.rb
@@ -1139,6 +1140,7 @@ files:
1139
1140
  - fastlane_core/lib/fastlane_core/features.rb
1140
1141
  - fastlane_core/lib/fastlane_core/globals.rb
1141
1142
  - fastlane_core/lib/fastlane_core/helper.rb
1143
+ - fastlane_core/lib/fastlane_core/ios_app_identifier_guesser.rb
1142
1144
  - fastlane_core/lib/fastlane_core/ipa_file_analyser.rb
1143
1145
  - fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb
1144
1146
  - fastlane_core/lib/fastlane_core/itunes_search_api.rb