fastlane 2.76.0.beta.20180111010004 → 2.76.0.beta.20180112010003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -0
  3. data/fastlane/lib/fastlane/command_line_handler.rb +3 -1
  4. data/fastlane/lib/fastlane/commands_generator.rb +1 -0
  5. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +118 -14
  6. data/fastlane/lib/fastlane/swift_lane_manager.rb +49 -4
  7. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +203 -0
  8. data/fastlane/lib/fastlane/version.rb +1 -1
  9. data/fastlane/swift/ArgumentProcessor.swift +8 -1
  10. data/fastlane/swift/ControlCommand.swift +7 -1
  11. data/fastlane/swift/Deliverfile.swift +8 -1
  12. data/fastlane/swift/Fastlane.swift +0 -1
  13. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +8 -0
  14. data/fastlane/swift/FastlaneSwiftRunner/README.txt +10 -0
  15. data/fastlane/swift/Gymfile.swift +8 -1
  16. data/fastlane/swift/GymfileProtocol.swift +0 -1
  17. data/fastlane/swift/LaneFileProtocol.swift +7 -0
  18. data/fastlane/swift/Matchfile.swift +8 -1
  19. data/fastlane/swift/Precheckfile.swift +8 -1
  20. data/fastlane/swift/RubyCommand.swift +8 -1
  21. data/fastlane/swift/RubyCommandable.swift +7 -0
  22. data/fastlane/swift/Runner.swift +7 -0
  23. data/fastlane/swift/RunnerArgument.swift +8 -1
  24. data/fastlane/swift/Scanfile.swift +8 -1
  25. data/fastlane/swift/Screengrabfile.swift +8 -1
  26. data/fastlane/swift/Snapshotfile.swift +8 -1
  27. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  28. data/fastlane/swift/SocketClient.swift +7 -0
  29. data/fastlane/swift/SocketClientDelegateProtocol.swift +8 -1
  30. data/fastlane/swift/SocketResponse.swift +7 -0
  31. data/fastlane/swift/main.swift +7 -0
  32. data/fastlane/swift/upgrade_manifest.json +1 -0
  33. data/frameit/lib/frameit/editor.rb +18 -17
  34. data/match/lib/match/commands_generator.rb +2 -2
  35. data/match/lib/match/nuke.rb +9 -1
  36. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  37. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +1 -1
  38. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27919bd61546ff3153358786ed67746eb04f2e70
4
- data.tar.gz: 9d8cb488b0a8efa4f2b8302d43993ef21d1d5d30
3
+ metadata.gz: d9771e8839c4af51f6061f6d25bf4b2935e681b9
4
+ data.tar.gz: 9565ca7cb8b1770f49567cf0eb613d4b45f1cb57
5
5
  SHA512:
6
- metadata.gz: 66476f36335b5aefa473afede8701fe77513f64e84fcb6938d7a3438e892c6f1553fc4edaed4d82294ece314c34eb0d22401e73b0597c736d5883d92735d9609
7
- data.tar.gz: 4d55b97de4491ca1f17afd695e85977c08a921a513750c81bfcc7e8b612e1a19fbba58d9e09b73c4c4e8a8d96014149f4c1a0b26c3e7b51428a0bc31eb10777f
6
+ metadata.gz: bab080bfc18c8a0c72cfd65f1d7e7a2bb6d150b041cf2128a5c40b1ebb773cdf3e24513c79814ec806b62448907fac6bf64cb44d15ceb191a615a0a6e376e03a
7
+ data.tar.gz: faf0a776c922ede37615402c2c33973ee0cc507d4cb4d928bae4dd5430202627c59d95b6a01d583b40cf44c220632428ec553c929fa1d2d1bd82dcefec3beb69
@@ -292,6 +292,7 @@ To revoke all certificates and provisioning profiles for a specific environment:
292
292
  ```no-highlight
293
293
  fastlane match nuke development
294
294
  fastlane match nuke distribution
295
+ fastlane match nuke enterprise
295
296
  ```
296
297
 
297
298
  <img src="/img/actions/match_nuke.gif" width="550" />
@@ -29,7 +29,9 @@ module Fastlane
29
29
  dot_env = Helper.is_test? ? nil : options.env
30
30
 
31
31
  if FastlaneCore::FastlaneFolder.swift?
32
- Fastlane::SwiftLaneManager.cruise_lane(lane, lane_parameters, dot_env)
32
+ disable_runner_upgrades = options.disable_runner_upgrades || false
33
+
34
+ Fastlane::SwiftLaneManager.cruise_lane(lane, lane_parameters, dot_env, disable_runner_upgrades: disable_runner_upgrades)
33
35
  else
34
36
  Fastlane::LaneManager.cruise_lane(platform, lane, lane_parameters, dot_env)
35
37
  end
@@ -101,6 +101,7 @@ module Fastlane
101
101
  c.syntax = 'fastlane [lane]'
102
102
  c.description = 'Run a specific lane. Pass the lane name and optionally the platform first.'
103
103
  c.option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
104
+ c.option('--disable_runner_upgrades', 'Prevents fastlane from attempting to update FastlaneRunner swift project')
104
105
 
105
106
  c.action do |args, options|
106
107
  if ensure_fastfile
@@ -14,6 +14,7 @@ module Fastlane
14
14
  end
15
15
 
16
16
  class SwiftFastlaneAPIGenerator
17
+ DEFAULT_API_VERSION_STRING = "0.9.1"
17
18
  attr_accessor :tools_option_files
18
19
  attr_accessor :actions_not_supported
19
20
  attr_accessor :action_options_to_ignore
@@ -79,15 +80,29 @@ module Fastlane
79
80
 
80
81
  tool_objects = generate_lanefile_tool_objects(classes: tool_details.map(&:swift_class))
81
82
  file_content << tool_objects
82
- file_content += autogen_version_warning_text_array
83
+ new_file_content = file_content.join("\n")
83
84
 
84
- file_content = file_content.join("\n")
85
85
  fastlane_swift_api_path = File.join(@target_output_path, "Fastlane.swift")
86
- File.write(fastlane_swift_api_path, file_content)
87
- UI.success(fastlane_swift_api_path)
86
+ old_file_content = File.read(fastlane_swift_api_path)
87
+
88
+ # compare old file content to potential new file content
89
+ api_version = determine_api_version(new_file_content: new_file_content, old_file_content: old_file_content)
90
+ old_api_version = find_api_version_string(content: old_file_content)
91
+
92
+ # if there is a change, we need to write out the new file
93
+ if api_version != old_api_version
94
+ new_file_content.concat(autogen_version_warning_text(api_version: api_version))
95
+
96
+ File.write(fastlane_swift_api_path, new_file_content)
97
+ UI.success(fastlane_swift_api_path)
98
+ self.generated_paths << fastlane_swift_api_path
99
+ end
100
+
101
+ default_implementations_path = generate_default_implementations(tool_details: tool_details)
102
+
103
+ # we might not have any changes, like if it's a hotpatch
104
+ self.generated_paths += default_implementations_path if default_implementations_path.length > 0
88
105
 
89
- self.generated_paths << fastlane_swift_api_path
90
- self.generated_paths += generate_default_implementations(tool_details: tool_details)
91
106
  return self.generated_paths
92
107
  end
93
108
 
@@ -120,7 +135,17 @@ module Fastlane
120
135
  def generate_default_implementations(tool_details: nil)
121
136
  files_generated = []
122
137
  tool_details.each do |tool_detail|
123
- lanefile_implementation_opening = "class #{tool_detail.swift_class}: #{tool_detail.swift_protocol} {"
138
+ header = []
139
+ header << "//"
140
+ header << "// ** NOTE **"
141
+ header << "// This file is provided by fastlane and WILL be overwritten in future updates"
142
+ header << "// If you want to add extra functionality to this project, create a new file in a"
143
+ header << "// new group so that it won't be marked for upgrade"
144
+ header << "//"
145
+ header << ""
146
+ header << "class #{tool_detail.swift_class}: #{tool_detail.swift_protocol} {"
147
+ lanefile_implementation_opening = header.join("\n")
148
+
124
149
  files_generated << write_lanefile(
125
150
  lanefile_implementation_opening: lanefile_implementation_opening,
126
151
  class_name: tool_detail.swift_class,
@@ -176,14 +201,73 @@ func parseInt(fromString: String, function: String = #function) -> Int {
176
201
  return objects
177
202
  end
178
203
 
179
- def autogen_version_warning_text_array
204
+ def autogen_version_warning_text(api_version: nil)
180
205
  warning_text_array = []
181
206
  warning_text_array << ""
182
207
  warning_text_array << "// Please don't remove the lines below"
183
208
  warning_text_array << "// They are used to detect outdated files"
184
- warning_text_array << "// FastlaneRunnerAPIVersion [0.9.1]"
209
+ warning_text_array << "// FastlaneRunnerAPIVersion [#{api_version}]"
185
210
  warning_text_array << ""
186
- return warning_text_array
211
+ return warning_text_array.join("\n")
212
+ end
213
+
214
+ # compares the new file content to the old and figures out what api_version the new content should be
215
+ def determine_api_version(new_file_content: nil, old_file_content: nil)
216
+ # we know 100% there is a difference, so no need to compare
217
+ unless old_file_content.length >= new_file_content.length
218
+ old_api_version = find_api_version_string(content: old_file_content)
219
+
220
+ return DEFAULT_API_VERSION_STRING if old_api_version.nil?
221
+
222
+ return increment_api_version_string(api_version_string: old_api_version)
223
+ end
224
+
225
+ relevant_old_file_content = old_file_content[0..(new_file_content.length - 1)]
226
+
227
+ if relevant_old_file_content == new_file_content
228
+ # no changes at all, just return the same old api version string
229
+ return find_api_version_string(content: old_file_content)
230
+ else
231
+ # there are differences, so calculate a new api_version_string
232
+ old_api_version = find_api_version_string(content: old_file_content)
233
+
234
+ return DEFAULT_API_VERSION_STRING if old_api_version.nil?
235
+
236
+ return increment_api_version_string(api_version_string: old_api_version)
237
+ end
238
+ end
239
+
240
+ # expects format to be "X.Y.Z" where each value is a number
241
+ def increment_api_version_string(api_version_string: nil, increment_by: :patch)
242
+ versions = api_version_string.split(".")
243
+ major = versions[0].to_i
244
+ minor = versions[1].to_i
245
+ patch = versions[2].to_i
246
+
247
+ case increment_by
248
+ when :patch
249
+ patch += 1
250
+ when :minor
251
+ minor += 1
252
+ patch = 0
253
+ when :major
254
+ major += 1
255
+ minor = 0
256
+ patch = 0
257
+ end
258
+
259
+ new_version_string = [major, minor, patch].join(".")
260
+ return new_version_string
261
+ end
262
+
263
+ def find_api_version_string(content: nil)
264
+ regex = SwiftRunnerUpgrader::API_VERSION_REGEX
265
+ matches = content.match(regex)
266
+ if matches.length > 0
267
+ return matches[1]
268
+ else
269
+ return nil
270
+ end
187
271
  end
188
272
 
189
273
  def generate_tool_protocol(tool_swift_function: nil)
@@ -199,11 +283,30 @@ func parseInt(fromString: String, function: String = #function) -> Int {
199
283
  protocol_content_array += tool_swift_function.swift_default_implementations
200
284
  protocol_content_array << "}"
201
285
  protocol_content_array << ""
202
- protocol_content_array += autogen_version_warning_text_array
286
+ new_file_content = protocol_content_array.join("\n")
203
287
 
204
288
  target_path = File.join(@target_output_path, "#{protocol_name}.swift")
205
- file_content = protocol_content_array.join("\n")
206
- File.write(target_path, file_content)
289
+
290
+ old_file_content = ""
291
+ # we might have a new file here, unlikely, but possible
292
+ if File.exist?(target_path)
293
+ old_file_content = File.read(target_path)
294
+ end
295
+
296
+ # compare old file content to potential new file content
297
+ api_version = determine_api_version(new_file_content: new_file_content, old_file_content: old_file_content)
298
+ old_api_version = find_api_version_string(content: old_file_content)
299
+
300
+ # we don't need to write this file out because the file versions are exactly the same
301
+ return nil if api_version == old_api_version
302
+
303
+ # use api_version to generate the disclaimer
304
+ api_version_disclaimer = autogen_version_warning_text(api_version: api_version)
305
+ new_file_content.concat(api_version_disclaimer)
306
+
307
+ target_path = File.join(@target_output_path, "#{protocol_name}.swift")
308
+
309
+ File.write(target_path, new_file_content)
207
310
  UI.success(target_path)
208
311
  return target_path
209
312
  end
@@ -256,7 +359,8 @@ func parseInt(fromString: String, function: String = #function) -> Int {
256
359
  key_type_overrides: key_type_overrides,
257
360
  return_type: action_return_type
258
361
  )
259
- self.generated_paths << generate_tool_protocol(tool_swift_function: tool_swift_function)
362
+ generated_protocol_file_path = generate_tool_protocol(tool_swift_function: tool_swift_function)
363
+ self.generated_paths << generated_protocol_file_path unless generated_protocol_file_path.nil?
260
364
  return tool_swift_function
261
365
  else
262
366
  return SwiftFunction.new(
@@ -1,11 +1,12 @@
1
1
  require_relative 'lane_manager_base.rb'
2
+ require_relative 'swift_runner_upgrader.rb'
2
3
 
3
4
  module Fastlane
4
5
  class SwiftLaneManager < LaneManagerBase
5
6
  # @param lane_name The name of the lane to execute
6
7
  # @param parameters [Hash] The parameters passed from the command line to the lane
7
8
  # @param env Dot Env Information
8
- def self.cruise_lane(lane, parameters = nil, env = nil)
9
+ def self.cruise_lane(lane, parameters = nil, env = nil, disable_runner_upgrades: false)
9
10
  UI.user_error!("lane must be a string") unless lane.kind_of?(String) or lane.nil?
10
11
  UI.user_error!("parameters must be a hash") unless parameters.kind_of?(Hash) or parameters.nil?
11
12
 
@@ -22,6 +23,15 @@ module Fastlane
22
23
  started = Time.now
23
24
  e = nil
24
25
  begin
26
+ display_upgraded_message = false
27
+ if disable_runner_upgrades
28
+ UI.verbose("disable_runner_upgrades is true, not attempting to update the FastlaneRunner project".yellow)
29
+ elsif Helper.is_ci?
30
+ UI.verbose("Running in CI, not attempting to update the FastlaneRunner project".yellow)
31
+ else
32
+ display_upgraded_message = self.ensure_runner_up_to_date_fastlane!
33
+ end
34
+
25
35
  self.ensure_runner_built!
26
36
  socket_thread = self.start_socket_thread
27
37
  sleep(0.250) while socket_thread[:ready].nil?
@@ -46,7 +56,13 @@ module Fastlane
46
56
  end
47
57
 
48
58
  skip_message = false
49
- exit_reason = socket_thread[:exit_reason]
59
+
60
+ # if socket_thread is nil, we were probably debugging, or something else weird happened
61
+ exit_reason = :cancelled if socket_thread.nil?
62
+
63
+ # normal exit means we have a reason
64
+ exit_reason ||= socket_thread[:exit_reason]
65
+
50
66
  if exit_reason == :cancelled && e.nil?
51
67
  skip_message = true
52
68
  end
@@ -54,6 +70,11 @@ module Fastlane
54
70
  duration = ((Time.now - started) / 60.0).round
55
71
 
56
72
  finish_fastlane(nil, duration, e, skip_message: skip_message)
73
+
74
+ if display_upgraded_message
75
+ UI.message("We updated your FastlaneRunner project during this run to make it compatible with your current version of fastlane.".yellow)
76
+ UI.message("Please make sure to check the changes into source control.".yellow)
77
+ end
57
78
  end
58
79
 
59
80
  def self.display_lanes
@@ -178,11 +199,11 @@ module Fastlane
178
199
  )
179
200
 
180
201
  # Swap out any configs the user has removed, inserting fastlane defaults
181
- project_modified ||= swap_paths_in_target(
202
+ project_modified = swap_paths_in_target(
182
203
  target: runner_target,
183
204
  file_refs_to_swap: target_file_refs,
184
205
  expected_path_to_replacement_path_tuples: user_tool_files_possibly_removed
185
- )
206
+ ) || project_modified
186
207
 
187
208
  if project_modified
188
209
  fastlane_runner_project.save
@@ -231,6 +252,30 @@ module Fastlane
231
252
  end
232
253
  end
233
254
 
255
+ # do we have the latest FastlaneSwiftRunner code from the current version of fastlane?
256
+ def self.ensure_runner_up_to_date_fastlane!
257
+ upgraded = false
258
+ upgrader = SwiftRunnerUpgrader.new
259
+
260
+ upgrade_needed = upgrader.upgrade_if_needed!(dry_run: true)
261
+ if upgrade_needed
262
+ UI.message("It looks like your `FastlaneSwiftRunner` project is not up-to-date".green)
263
+ UI.message("If you don't update it, fastlane could fail".green)
264
+ UI.message("We can try to automatically update it for you, usually this works 🎈 🐐".green)
265
+ user_wants_upgrade = UI.confirm("Should we try to upgrade just your `FastlaneSwiftRunner` project?")
266
+
267
+ UI.important("Ok, if things break, you can try to run this lane again and you'll be prompted to upgrade another time") unless user_wants_upgrade
268
+
269
+ if user_wants_upgrade
270
+ upgraded = upgrader.upgrade_if_needed!
271
+ UI.success("Updated your FastlaneSwiftRunner project with the newest runner code") if upgraded
272
+ self.build_runner! if upgraded
273
+ end
274
+ end
275
+
276
+ return upgraded
277
+ end
278
+
234
279
  def self.build_runner!
235
280
  UI.verbose("Building FastlaneSwiftRunner")
236
281
  require 'fastlane_core'
@@ -0,0 +1,203 @@
1
+ require 'xcodeproj'
2
+ require 'fileutils'
3
+
4
+ module Fastlane
5
+ # current logic:
6
+ # - find all groups in existing project
7
+ # -- if a group is missing, add it
8
+ # --- add all files for group into new group, build target, and compile phase
9
+ # - iterate through existing groups
10
+ # -- update all files needing updating
11
+ # - iterate through existing groups
12
+ # -- if a file from the manifest is new, add it to group, build target, and compile phase
13
+ # - Save and return true if any action was taken to modify any file (project included)
14
+
15
+ # build project
16
+ class SwiftRunnerUpgrader
17
+ API_VERSION_REGEX = /FastlaneRunnerAPIVersion\s*\[\s*([0-9]+.[0-9]+.[0-9]+)\s*\]/ # also used by SwiftFastlaneAPIGenerator
18
+
19
+ attr_accessor :target_project # project we'll be updating
20
+ attr_accessor :fastlane_runner_target # FastlaneRunner xcodeproj target
21
+ attr_accessor :manifest_hash # hash of file names to group names they belong to
22
+ attr_accessor :manifest_groups # unique list of group names that came from the manifest
23
+ attr_accessor :target_swift_code_file_folder_path # location in filesystem where all swift files should exist when we're done
24
+ attr_accessor :source_swift_code_file_folder_path # source location of where we're copying file from during the upgrade process
25
+
26
+ RELATIVE_SOURCE_FILE_PATH = "../"
27
+
28
+ def initialize
29
+ @source_swift_code_file_folder_path = File.expand_path(File.join(Fastlane::ROOT, "/swift"))
30
+ @target_swift_code_file_folder_path = FastlaneCore::FastlaneFolder.swift_folder_path
31
+
32
+ manifest_file = File.join(@source_swift_code_file_folder_path, "/upgrade_manifest.json")
33
+ UI.success("loading manifest: #{manifest_file}")
34
+ @manifest_hash = JSON.parse(File.read(manifest_file))
35
+ @manifest_groups = @manifest_hash.values.uniq
36
+
37
+ runner_project_path = FastlaneCore::FastlaneFolder.swift_runner_project_path
38
+ @target_project = Xcodeproj::Project.open(runner_project_path)
39
+
40
+ @root_group = @target_project.groups.select { |group| group.name == "Fastlane Runner" }.first
41
+
42
+ @fastlane_runner_target = @target_project.targets.select { |target| target.name == "FastlaneRunner" }.first
43
+ end
44
+
45
+ def upgrade_if_needed!(dry_run: false)
46
+ upgraded = add_missing_groups_and_files!(dry_run: dry_run)
47
+ upgraded = upgrade_files!(dry_run: dry_run) || upgraded
48
+ upgraded = add_new_files_to_groups! || upgraded
49
+
50
+ UI.verbose("FastlaneRunner project has been updated and can be written back to disk") if upgraded
51
+ unless dry_run
52
+ UI.verbose("FastlaneRunner project changes have been stored") if upgraded
53
+ target_project.save if upgraded
54
+ end
55
+
56
+ return upgraded
57
+ end
58
+
59
+ def upgrade_files!(dry_run: false)
60
+ upgraded_anything = false
61
+ self.manifest_hash.each do |filename, group|
62
+ upgraded_anything = copy_file_if_needed!(filename: filename, dry_run: dry_run) || upgraded_anything
63
+ end
64
+ return upgraded_anything
65
+ end
66
+
67
+ def find_missing_groups
68
+ missing_groups = []
69
+
70
+ existing_group_names_set = @root_group.groups.map { |group| group.name.downcase }.to_set
71
+ self.manifest_groups.each do |group_name|
72
+ unless existing_group_names_set.include?(group_name.downcase)
73
+ missing_groups << group_name
74
+ end
75
+ end
76
+ return missing_groups
77
+ end
78
+
79
+ # compares source file against the target file's FastlaneRunnerAPIVersion and returned `true` if there is a difference
80
+ def file_needs_update?(filename: nil)
81
+ # looking for something like: FastlaneRunnerAPIVersion [0.9.1]
82
+ regex_to_use = API_VERSION_REGEX
83
+
84
+ source = File.join(self.source_swift_code_file_folder_path, "/#{filename}")
85
+ target = File.join(self.target_swift_code_file_folder_path, "/#{filename}")
86
+
87
+ # target doesn't have the file yet, so ya, I'd say it needs to be updated
88
+ return true unless File.exist?(target)
89
+
90
+ source_file_content = File.read(source)
91
+ target_file_content = File.read(target)
92
+
93
+ bundled_version = source_file_content.match(regex_to_use)[1]
94
+ target_version = target_file_content.match(regex_to_use)[1]
95
+ file_versions_are_different = bundled_version != target_version
96
+
97
+ UI.verbose("#{filename} FastlaneRunnerAPIVersion (bundled/target): #{bundled_version}/#{target_version}")
98
+ files_are_different = source_file_content != target_file_content
99
+
100
+ if files_are_different && !file_versions_are_different
101
+ UI.verbose("File versions are the same, but the two files are not equal, so that's a problem, setting needs update to 'true'")
102
+ end
103
+
104
+ needs_update = file_versions_are_different || files_are_different
105
+
106
+ return needs_update
107
+ end
108
+
109
+ # currently just copies file, even if not needed.
110
+ def copy_file_if_needed!(filename: nil, dry_run: false)
111
+ needs_update = file_needs_update?(filename: filename)
112
+ UI.verbose("file #{filename} needs an update") if needs_update
113
+
114
+ # Ok, we know if this file needs an update, can return now if it's a dry run
115
+ return needs_update if dry_run
116
+
117
+ unless needs_update
118
+ # no work needed, just return
119
+ return false
120
+ end
121
+
122
+ source = File.join(self.source_swift_code_file_folder_path, "/#{filename}")
123
+ target = File.join(self.target_swift_code_file_folder_path, "/#{filename}")
124
+
125
+ FileUtils.cp(source, target)
126
+ UI.verbose("Copied #{source} to #{target}")
127
+ return true
128
+ end
129
+
130
+ def add_new_files_to_groups!
131
+ inverted_hash = {}
132
+
133
+ # need {group => [file1, file2, etc..]} instead of: {file1 => group, file2 => group, etc...}
134
+ self.manifest_hash.each do |filename, group_name|
135
+ group_name = group_name.downcase
136
+
137
+ files_in_group = inverted_hash[group_name]
138
+ if files_in_group.nil?
139
+ files_in_group = []
140
+ inverted_hash[group_name] = files_in_group
141
+ end
142
+ files_in_group << filename
143
+ end
144
+
145
+ # this helps us signal to the user that we made changes
146
+ updated_project = false
147
+ # iterate through the groups and collect all the swift files in each
148
+ @root_group.groups.each do |group|
149
+ # current group's filenames
150
+ existing_group_files_set = group.files
151
+ .select { |file| !file.name.nil? && file.name.end_with?(".swift") }
152
+ .map(&:name)
153
+ .to_set
154
+
155
+ group_name = group.name.downcase
156
+ manifest_group_filenames = inverted_hash[group_name]
157
+
158
+ # compare the current group files to what the manifest says should minially be there
159
+ manifest_group_filenames.each do |filename|
160
+ # current group is missing a file from the manifest, need to add it
161
+ next if existing_group_files_set.include?(filename)
162
+
163
+ UI.verbose("Adding new file #{filename} to group: `#{group.name}`")
164
+ new_file_reference = group.new_file("#{RELATIVE_SOURCE_FILE_PATH}#{filename}")
165
+
166
+ # add references to the target, and make sure they are added to the build phase to
167
+ self.fastlane_runner_target.source_build_phase.add_file_reference(new_file_reference)
168
+
169
+ updated_project = true
170
+ end
171
+ end
172
+
173
+ return updated_project
174
+ end
175
+
176
+ def add_missing_groups_and_files!(dry_run: false)
177
+ missing_groups = self.find_missing_groups.to_set
178
+ unless missing_groups.length >= 0
179
+ return false
180
+ end
181
+
182
+ # well, we know we have some changes to make, so if this is a dry run,
183
+ # don't bother doing anything and just return true
184
+ return true if dry_run
185
+
186
+ missing_groups.each do |missing_group_name|
187
+ new_group = @root_group.new_group(missing_group_name)
188
+
189
+ # find every file in the manifest that belongs to the new group, and add it to the new group
190
+ self.manifest_hash.each do |filename, group|
191
+ next unless group.casecmp(missing_group_name.downcase).zero?
192
+ # assumes this is a new file, we don't handle moving files between groups
193
+ new_file_reference = new_group.new_file("#{RELATIVE_SOURCE_FILE_PATH}#{filename}")
194
+
195
+ # add references to the target, and make sure they are added to the build phase to
196
+ self.fastlane_runner_target.source_build_phase.add_file_reference(new_file_reference)
197
+ end
198
+ end
199
+
200
+ return true # yup, we definitely updated groups
201
+ end
202
+ end
203
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.76.0.beta.20180111010004'.freeze
2
+ VERSION = '2.76.0.beta.20180112010003'.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
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  struct ArgumentProcessor {
@@ -81,4 +88,4 @@ struct ArgumentProcessor {
81
88
 
82
89
  // Please don't remove the lines below
83
90
  // They are used to detect outdated files
84
- // FastlaneRunnerAPIVersion [0.9.1]
91
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -1,9 +1,15 @@
1
1
  //
2
- // ClientShutdownCommand.swift
2
+ // ControlCommand.swift
3
3
  // FastlaneRunner
4
4
  //
5
5
  // Created by Joshua Liebowitz on 1/3/18.
6
6
  // Copyright © 2018 Joshua Liebowitz. All rights reserved.
7
+
8
+ //
9
+ // ** NOTE **
10
+ // This file is provided by fastlane and WILL be overwritten in future updates
11
+ // If you want to add extra functionality to this project, create a new file in a
12
+ // new group so that it won't be marked for upgrade
7
13
  //
8
14
 
9
15
  import Foundation
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `deliver`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Deliverfile: DeliverfileProtocol {
5
12
  // If you want to enable `deliver`, run `fastlane deliver init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Deliverfile: DeliverfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -3777,7 +3777,6 @@ let precheckfile: Precheckfile = Precheckfile()
3777
3777
  let scanfile: Scanfile = Scanfile()
3778
3778
  let screengrabfile: Screengrabfile = Screengrabfile()
3779
3779
  let snapshotfile: Snapshotfile = Snapshotfile()
3780
-
3781
3780
  // Please don't remove the lines below
3782
3781
  // They are used to detect outdated files
3783
3782
  // FastlaneRunnerAPIVersion [0.9.1]
@@ -45,6 +45,10 @@
45
45
  B30206781F5E3E9000DE6EBD /* ScanfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ScanfileProtocol.swift; path = ../ScanfileProtocol.swift; sourceTree = "<group>"; };
46
46
  B30206791F5E3E9000DE6EBD /* ScreengrabfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ScreengrabfileProtocol.swift; path = ../ScreengrabfileProtocol.swift; sourceTree = "<group>"; };
47
47
  B302067A1F5E3E9000DE6EBD /* DeliverfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DeliverfileProtocol.swift; path = ../DeliverfileProtocol.swift; sourceTree = "<group>"; };
48
+ B3144C072005533400470AFE /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
49
+ B3144C08200553C800470AFE /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
50
+ B3144C09200553D400470AFE /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
51
+ B3144C0A200553DC00470AFE /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
48
52
  B3BA659D1F5A269100B34850 /* Fastlane.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Fastlane.swift; path = ../Fastlane.swift; sourceTree = "<group>"; };
49
53
  B3BA659E1F5A269100B34850 /* LaneFileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LaneFileProtocol.swift; path = ../LaneFileProtocol.swift; sourceTree = "<group>"; };
50
54
  B3BA659F1F5A269100B34850 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = ../main.swift; sourceTree = "<group>"; };
@@ -111,6 +115,7 @@
111
115
  B3BA65B11F5A325E00B34850 /* Networking */ = {
112
116
  isa = PBXGroup;
113
117
  children = (
118
+ B3144C072005533400470AFE /* README.txt */,
114
119
  D5B8A5B21FFDC49D00536B24 /* ControlCommand.swift */,
115
120
  B3BA65A01F5A269100B34850 /* RubyCommand.swift */,
116
121
  D5D1DE981FFEE8E900502A00 /* RubyCommandable.swift */,
@@ -125,6 +130,7 @@
125
130
  B3BA65B21F5A327B00B34850 /* Autogenerated API */ = {
126
131
  isa = PBXGroup;
127
132
  children = (
133
+ B3144C09200553D400470AFE /* README.txt */,
128
134
  B3BA659D1F5A269100B34850 /* Fastlane.swift */,
129
135
  B302067A1F5E3E9000DE6EBD /* DeliverfileProtocol.swift */,
130
136
  B30206751F5E3E9000DE6EBD /* GymfileProtocol.swift */,
@@ -140,6 +146,7 @@
140
146
  B3BA65B31F5A329800B34850 /* Fastfile Components */ = {
141
147
  isa = PBXGroup;
142
148
  children = (
149
+ B3144C08200553C800470AFE /* README.txt */,
143
150
  B3BA659E1F5A269100B34850 /* LaneFileProtocol.swift */,
144
151
  );
145
152
  name = "Fastfile Components";
@@ -148,6 +155,7 @@
148
155
  D512BA011F7C7F40000D2137 /* Runner Code */ = {
149
156
  isa = PBXGroup;
150
157
  children = (
158
+ B3144C0A200553DC00470AFE /* README.txt */,
151
159
  D5BAFD111F7DAAFC0030B324 /* ArgumentProcessor.swift */,
152
160
  B3BA659F1F5A269100B34850 /* main.swift */,
153
161
  B3BA65AE1F5A2D5C00B34850 /* RunnerArgument.swift */,
@@ -0,0 +1,10 @@
1
+ Don't modify the structure of this group including but not limited to:
2
+ - renaming this group
3
+ - adding sub groups
4
+ - removing sub groups
5
+ - adding new files
6
+ - removing files
7
+
8
+ If you modify anything in this folder, future fastlane upgrades may not be able to be applied automatically.
9
+
10
+ If you need to add new groups, please add them at the root of the "Fastlane Runner" group.
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `gym`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Gymfile: GymfileProtocol {
5
12
  // If you want to enable `gym`, run `fastlane gym init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Gymfile: GymfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -80,7 +80,6 @@ extension GymfileProtocol {
80
80
  var skipProfileDetection: Bool { return false }
81
81
  }
82
82
 
83
-
84
83
  // Please don't remove the lines below
85
84
  // They are used to detect outdated files
86
85
  // FastlaneRunnerAPIVersion [0.9.1]
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  public protocol LaneFileProtocol: class {
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `match`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Matchfile: MatchfileProtocol {
5
12
  // If you want to enable `match`, run `fastlane match init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Matchfile: MatchfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `precheck`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Precheckfile: PrecheckfileProtocol {
5
12
  // If you want to enable `precheck`, run `fastlane precheck init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Precheckfile: PrecheckfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  struct RubyCommand: RubyCommandable {
@@ -132,4 +139,4 @@ struct RubyCommand: RubyCommandable {
132
139
 
133
140
  // Please don't remove the lines below
134
141
  // They are used to detect outdated files
135
- // FastlaneRunnerAPIVersion [0.9.1]
142
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2018 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  enum CommandType {
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  let logger: Logger = {
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  struct RunnerArgument {
@@ -15,4 +22,4 @@ struct RunnerArgument {
15
22
 
16
23
  // Please don't remove the lines below
17
24
  // They are used to detect outdated files
18
- // FastlaneRunnerAPIVersion [0.9.1]
25
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `scan`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Scanfile: ScanfileProtocol {
5
12
  // If you want to enable `scan`, run `fastlane scan init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Scanfile: ScanfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `screengrab`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Screengrabfile: ScreengrabfileProtocol {
5
12
  // If you want to enable `screengrab`, run `fastlane screengrab init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Screengrabfile: ScreengrabfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -1,6 +1,13 @@
1
1
  // This class is automatically included in FastlaneRunner during build
2
2
 
3
3
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `snapshot`
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
4
11
  class Snapshotfile: SnapshotfileProtocol {
5
12
  // If you want to enable `snapshot`, run `fastlane snapshot init`
6
13
  // After, this file will be replaced with a custom implementation that contains values you supplied
@@ -11,4 +18,4 @@ class Snapshotfile: SnapshotfileProtocol {
11
18
 
12
19
 
13
20
 
14
- // Generated with fastlane 2.75.0
21
+ // Generated with fastlane 2.75.1
@@ -69,4 +69,4 @@ extension SnapshotfileProtocol {
69
69
 
70
70
  // Please don't remove the lines below
71
71
  // They are used to detect outdated files
72
- // FastlaneRunnerAPIVersion [0.9.1]
72
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  public enum SocketClientResponse: Error {
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  protocol SocketClientDelegateProtocol: class {
@@ -16,4 +23,4 @@ protocol SocketClientDelegateProtocol: class {
16
23
 
17
24
  // Please don't remove the lines below
18
25
  // They are used to detect outdated files
19
- // FastlaneRunnerAPIVersion [0.9.1]
26
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  struct SocketResponse {
@@ -6,6 +6,13 @@
6
6
  // Copyright © 2017 Joshua Liebowitz. All rights reserved.
7
7
  //
8
8
 
9
+ //
10
+ // ** NOTE **
11
+ // This file is provided by fastlane and WILL be overwritten in future updates
12
+ // If you want to add extra functionality to this project, create a new file in a
13
+ // new group so that it won't be marked for upgrade
14
+ //
15
+
9
16
  import Foundation
10
17
 
11
18
  let argumentProcessor = ArgumentProcessor(args: CommandLine.arguments)
@@ -0,0 +1 @@
1
+ {"Fastlane.swift":"Autogenerated API","DeliverfileProtocol.swift":"Autogenerated API","GymfileProtocol.swift":"Autogenerated API","MatchfileProtocol.swift":"Autogenerated API","PrecheckfileProtocol.swift":"Autogenerated API","ScanfileProtocol.swift":"Autogenerated API","ScreengrabfileProtocol.swift":"Autogenerated API","SnapshotfileProtocol.swift":"Autogenerated API","LaneFileProtocol.swift":"Fastfile Components","ControlCommand.swift":"Networking","RubyCommand.swift":"Networking","RubyCommandable.swift":"Networking","Runner.swift":"Networking","SocketClient.swift":"Networking","SocketClientDelegateProtocol.swift":"Networking","SocketResponse.swift":"Networking","ArgumentProcessor.swift":"Runner Code","main.swift":"Runner Code","RunnerArgument.swift":"Runner Code"}
@@ -263,10 +263,10 @@ module Frameit
263
263
  end
264
264
 
265
265
  def put_title_into_background(background, stack_title)
266
- title_images = build_title_images(image.width - 2 * horizontal_frame_padding, image.height - 2 * vertical_frame_padding)
266
+ text_images = build_text_images(image.width - 2 * horizontal_frame_padding, image.height - 2 * vertical_frame_padding)
267
267
 
268
- keyword = title_images[:keyword]
269
- title = title_images[:title]
268
+ keyword = text_images[:keyword]
269
+ title = text_images[:title]
270
270
 
271
271
  if stack_title && !keyword.nil? && !title.nil? && keyword.width > 0 && title.width > 0
272
272
  background = put_title_into_background_stacked(background, title, keyword)
@@ -328,8 +328,8 @@ module Frameit
328
328
  (actual_font_size / 3.0).round
329
329
  end
330
330
 
331
- # This will build 2 individual images with the title, which will then be added to the real image
332
- def build_title_images(max_width, max_height)
331
+ # This will build up to 2 individual images with the title and optional keyword, which will then be added to the real image
332
+ def build_text_images(max_width, max_height)
333
333
  words = [:keyword, :title].keep_if { |a| fetch_text(a) } # optional keyword/title
334
334
  results = {}
335
335
  trim_boxes = {}
@@ -338,9 +338,9 @@ module Frameit
338
338
  words.each do |key|
339
339
  # Create empty background
340
340
  empty_path = File.join(Frameit::ROOT, "lib/assets/empty.png")
341
- title_image = MiniMagick::Image.open(empty_path)
341
+ text_image = MiniMagick::Image.open(empty_path)
342
342
  image_height = max_height # gets trimmed afterwards anyway, and on the iPad the `y` would get cut
343
- title_image.combine_options do |i|
343
+ text_image.combine_options do |i|
344
344
  # Oversize as the text might be larger than the actual image. We're trimming afterwards anyway
345
345
  i.resize("#{max_width * 5.0}x#{image_height}!") # `!` says it should ignore the ratio
346
346
  end
@@ -356,7 +356,7 @@ module Frameit
356
356
  interline_spacing = fetch_config['interline_spacing']
357
357
 
358
358
  # Add the actual title
359
- title_image.combine_options do |i|
359
+ text_image.combine_options do |i|
360
360
  i.font(current_font) if current_font
361
361
  i.gravity("Center")
362
362
  i.pointsize(actual_font_size)
@@ -365,11 +365,11 @@ module Frameit
365
365
  i.fill(fetch_config[key.to_s]['color'])
366
366
  end
367
367
 
368
- results[key] = title_image
368
+ results[key] = text_image
369
369
 
370
370
  # Natively trimming the image with .trim will result in the loss of the common baseline between the text in all images.
371
371
  # Hence retrieve the calculated trim bounding box without actually trimming:
372
- calculated_trim_box = title_image.identify do |b|
372
+ calculated_trim_box = text_image.identify do |b|
373
373
  b.format("%@") # CALCULATED: trim bounding box (without actually trimming), see: http://www.imagemagick.org/script/escape.php
374
374
  end
375
375
 
@@ -441,20 +441,21 @@ module Frameit
441
441
  strings_path = File.join(File.expand_path("..", screenshot.path), "#{type}.strings")
442
442
  if File.exist?(strings_path)
443
443
  parsed = StringsParser.parse(strings_path)
444
- result = parsed.find { |k, v| screenshot.path.upcase.include?(k.upcase) }
445
- return result.last if result
444
+ text_array = parsed.find { |k, v| screenshot.path.upcase.include?(k.upcase) }
445
+ return text_array.last if text_array && text_array.last.length > 0 # Ignore empty string
446
446
  end
447
447
 
448
+ UI.verbose("Falling back to text in Framefile.json as there was nothing specified in the #{type}.strings file")
449
+
448
450
  # No string files, fallback to Framefile config
449
- result = fetch_config[type.to_s]['text'] if fetch_config[type.to_s]
450
- UI.verbose("Falling back to default text as there was nothing specified in the .strings file")
451
+ text = fetch_config[type.to_s]['text'] if fetch_config[type.to_s] && fetch_config[type.to_s]['text'] && fetch_config[type.to_s]['text'].length > 0 # Ignore empty string
451
452
 
452
- if type == :title and !result
453
+ if type == :title and !text
453
454
  # title is mandatory
454
- UI.user_error!("Could not get title for screenshot #{screenshot.path}. Please provide one in your Framefile.json")
455
+ UI.user_error!("Could not get title for screenshot #{screenshot.path}. Please provide one in your Framefile.json or title.strings")
455
456
  end
456
457
 
457
- return result
458
+ return text
458
459
  end
459
460
 
460
461
  # The font we want to use
@@ -122,11 +122,11 @@ module Match
122
122
  c.syntax = "fastlane match nuke"
123
123
  c.description = "Delete all certificates and provisioning profiles from the Apple Dev Portal"
124
124
  c.action do |args, options|
125
- FastlaneCore::UI.user_error!("Please run `fastlane match nuke [type], allowed values: distribution and development. For the 'adhoc' type, please use 'distribution' instead.")
125
+ FastlaneCore::UI.user_error!("Please run `fastlane match nuke [type], allowed values: development, distribution and enterprise. For the 'adhoc' type, please use 'distribution' instead.")
126
126
  end
127
127
  end
128
128
 
129
- ["development", "distribution"].each do |type|
129
+ ["development", "distribution", "enterprise"].each do |type|
130
130
  command "nuke #{type}" do |c|
131
131
  c.syntax = "fastlane match nuke #{type}"
132
132
  c.description = "Delete all certificates and provisioning profiles from the Apple Dev Portal of the type #{type}"
@@ -73,7 +73,15 @@ module Match
73
73
  Spaceship.login(params[:username])
74
74
  Spaceship.select_team
75
75
 
76
- UI.user_error!("`fastlane match nuke` doesn't support enterprise accounts") if Spaceship.client.in_house?
76
+ if Spaceship.client.in_house? && (type == "distribution" || type == "enterprise")
77
+ UI.error("---")
78
+ UI.error("⚠️ Warning: This seems to be an Enterprise account!")
79
+ UI.error("By nuking your account's distribution, all your apps deployed via ad-hoc will stop working!") if type == "distribution"
80
+ UI.error("By nuking your account's enterprise, all your in-house apps will stop working!") if type == "enterprise"
81
+ UI.error("---")
82
+
83
+ UI.user_error!("Enterprise account nuke cancelled") unless UI.confirm("Do you really want to nuke your Enterprise account?")
84
+ end
77
85
 
78
86
  self.certs = certificate_type(cert_type).all
79
87
  self.profiles = []
@@ -166,7 +166,7 @@ open class Snapshot: NSObject {
166
166
  throw SnapshotError.cannotDetectUser
167
167
  }
168
168
 
169
- guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
169
+ guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
170
170
  throw SnapshotError.cannotFindHomeDirectory
171
171
  }
172
172
 
@@ -137,7 +137,7 @@ open class Snapshot: NSObject {
137
137
  return nil
138
138
  }
139
139
 
140
- guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
140
+ guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
141
141
  print("Couldn't find Snapshot configuration files - can't detect `Users` dir")
142
142
  return nil
143
143
  }
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.76.0.beta.20180111010004
4
+ version: 2.76.0.beta.20180112010003
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: 2018-01-11 00:00:00.000000000 Z
18
+ date: 2018-01-12 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier
@@ -1197,6 +1197,7 @@ files:
1197
1197
  - fastlane/lib/fastlane/swift_fastlane_api_generator.rb
1198
1198
  - fastlane/lib/fastlane/swift_fastlane_function.rb
1199
1199
  - fastlane/lib/fastlane/swift_lane_manager.rb
1200
+ - fastlane/lib/fastlane/swift_runner_upgrader.rb
1200
1201
  - fastlane/lib/fastlane/tools.rb
1201
1202
  - fastlane/lib/fastlane/version.rb
1202
1203
  - fastlane/swift/Appfile.swift
@@ -1209,6 +1210,7 @@ files:
1209
1210
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj
1210
1211
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
1211
1212
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme
1213
+ - fastlane/swift/FastlaneSwiftRunner/README.txt
1212
1214
  - fastlane/swift/Gymfile.swift
1213
1215
  - fastlane/swift/GymfileProtocol.swift
1214
1216
  - fastlane/swift/LaneFileProtocol.swift
@@ -1230,6 +1232,7 @@ files:
1230
1232
  - fastlane/swift/SocketClientDelegateProtocol.swift
1231
1233
  - fastlane/swift/SocketResponse.swift
1232
1234
  - fastlane/swift/main.swift
1235
+ - fastlane/swift/upgrade_manifest.json
1233
1236
  - fastlane_core/README.md
1234
1237
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1235
1238
  - fastlane_core/lib/fastlane_core.rb