branch_io_cli 0.9.3 → 0.9.4

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
  SHA256:
3
- metadata.gz: 2908cdd4340d1d0d43da1875c4e08c2e4f6e46b56836395aaf47f6d401834218
4
- data.tar.gz: bcbfe15c402201a6a6594712b688ca5288a7c54d20a99a9aa0517c6264bbf220
3
+ metadata.gz: 96b0f856a2de3dbd4c63841fd112a8477cdb4694eee1201fd862ee653304160b
4
+ data.tar.gz: abb2546fdb310dea4075e5bc018885974a6e4fd97236c3bc2870a90b61aeab91
5
5
  SHA512:
6
- metadata.gz: b9edff995284b5a31a39cf22bb02a198b775c35a072046d5c2527730e41055d1e1c3f8dc1d800e0d8768809b8f4b35524453cf2c7d4ce8da7a29491d97c340d4
7
- data.tar.gz: 2ea56d6e150521ea6e956584fb0fc8f4c7774702746724eb6d94418840387a2ee0fa42ce2945a34e5d05daddcdb13d81a182e9775be8b99c2f5ad04110c4ec9a
6
+ metadata.gz: 9b1a6513a50d3dc45ac060759de51964d51dd51752517b6d7ccb8d77e00922c580cdb76c3384a489766ee57ce59642ee722354f4d298bdee4292f0e04ec8c42b
7
+ data.tar.gz: fdd5c4d1d8c5c08ce0b2601ed4b413644b5ad7097a32628276733d06fed649de5e6ab8baa95fb236430b5112bb4acd17328b80d480ba4cd4db9f3cd8086357e8
@@ -1,5 +1,6 @@
1
1
  require "cocoapods-core"
2
2
  require "branch_io_cli/helper/methods"
3
+ require "plist"
3
4
 
4
5
  module BranchIOCLI
5
6
  module Command
@@ -216,11 +217,20 @@ EOF
216
217
 
217
218
  header += `xcodebuild -version`
218
219
 
220
+ bundle_identifier = helper.expanded_build_setting config.target, "PRODUCT_BUNDLE_IDENTIFIER", config.configuration
221
+ dev_team = helper.expanded_build_setting config.target, "DEVELOPMENT_TEAM", config.configuration
222
+ infoplist_path = helper.expanded_build_setting config.target, "INFOPLIST_FILE", config.configuration
223
+ entitlements_path = helper.expanded_build_setting config.target, "CODE_SIGN_ENTITLEMENTS", config.configuration
224
+
219
225
  header += "\nTarget #{config.target.name}:\n"
226
+ header += " Bundle identifier: #{bundle_identifier || '(none)'}\n"
227
+ header += " Development team: #{dev_team || '(none)'}\n"
220
228
  header += " Deployment target: #{config.target.deployment_target}\n"
221
229
  header += " Modules #{config.modules_enabled? ? '' : 'not '}enabled\n"
222
230
  header += " Swift #{config.swift_version}\n" if config.swift_version
223
231
  header += " Bridging header: #{config.bridging_header_path}\n" if config.bridging_header_path
232
+ header += " Info.plist: #{infoplist_path || '(none)'}\n"
233
+ header += " Entitlements file: #{entitlements_path || '(none)'}\n"
224
234
 
225
235
  if config.podfile_path
226
236
  begin
@@ -244,9 +254,7 @@ EOF
244
254
  header += "\n"
245
255
  end
246
256
 
247
- # Already verified existence.
248
- podfile = Pod::Podfile.from_file Pathname.new config.podfile_path
249
- target_definition = podfile.target_definitions[config.target.name]
257
+ target_definition = config.podfile.target_definitions[config.target.name]
250
258
  if target_definition
251
259
  branch_deps = target_definition.dependencies.select { |p| p.name =~ %r{^(Branch|Branch-SDK)(/.*)?$} }
252
260
  header += "Podfile target #{target_definition.name}:"
@@ -285,9 +293,61 @@ EOF
285
293
  header += "\nBranch SDK not found.\n"
286
294
  end
287
295
 
296
+ header += "\n#{branch_report}"
297
+
288
298
  header
289
299
  end
290
300
  # rubocop: enable Metrics/PerceivedComplexity
301
+
302
+ # String containing information relevant to Branch setup
303
+ def branch_report
304
+ infoplist_path = helper.expanded_build_setting config.target, "INFOPLIST_FILE", config.configuration
305
+
306
+ report = "Branch configuration:\n"
307
+
308
+ begin
309
+ info_plist = File.open(infoplist_path) { |f| Plist.parse_xml f }
310
+ branch_key = info_plist["branch_key"]
311
+ report += " Branch key(s) (Info.plist):\n"
312
+ if branch_key.kind_of? Hash
313
+ branch_key.each_key do |key|
314
+ report += " #{key.capitalize}: #{branch_key[key]}\n"
315
+ end
316
+ elsif branch_key
317
+ report += " #{branch_key}\n"
318
+ else
319
+ report += " (none found)\n"
320
+ end
321
+
322
+ branch_universal_link_domains = info_plist["branch_universal_link_domains"]
323
+ if branch_universal_link_domains
324
+ if branch_universal_link_domains.kind_of? Array
325
+ report += " branch_universal_link_domains (Info.plist):\n"
326
+ branch_universal_link_domains.each do |domain|
327
+ report += " #{domain}\n"
328
+ end
329
+ else
330
+ report += " branch_universal_link_domains (Info.plist): #{branch_universal_link_domains}\n"
331
+ end
332
+ end
333
+ rescue StandardError => e
334
+ report += " (Failed to open Info.plist: #{e.message})\n"
335
+ end
336
+
337
+ unless config.target.extension_target_type?
338
+ begin
339
+ domains = helper.domains_from_project config.configuration
340
+ report += " Universal Link domains (entitlements):\n"
341
+ domains.each do |domain|
342
+ report += " #{domain}\n"
343
+ end
344
+ rescue StandardError => e
345
+ report += " (Failed to get Universal Link domains from entitlements file: #{e.message})\n"
346
+ end
347
+ end
348
+
349
+ report
350
+ end
291
351
  end
292
352
  end
293
353
  end
@@ -91,8 +91,9 @@ module BranchIOCLI
91
91
  choice = choose do |menu|
92
92
  menu.header = "There are uncommitted changes in this repo. It's best to stash or commit them before continuing."
93
93
  menu.choice "Stash"
94
- menu.choice "Commit (you will be prompted for a commit message)"
94
+ menu.choice "Commit (You will be prompted for a commit message.)"
95
95
  menu.choice "Quit"
96
+ menu.choice "Ignore and continue"
96
97
  menu.prompt = "Please enter one of the options above: "
97
98
  end
98
99
 
@@ -102,7 +103,7 @@ module BranchIOCLI
102
103
  when /^Commit/
103
104
  message = ask "Please enter a commit message: "
104
105
  sh "git commit -aqm #{Shellwords.escape(message)}"
105
- else
106
+ when /^Quit/
106
107
  say "Please stash or commit your changes before continuing."
107
108
  exit(-1)
108
109
  end
@@ -137,7 +137,7 @@ EOF
137
137
  @sdk_integration_mode = filename == "Podfile" ? :cocoapods : :carthage
138
138
  end
139
139
 
140
- def open_podfile(path)
140
+ def open_podfile(path = @podfile_path)
141
141
  @podfile = Pod::Podfile.from_file path
142
142
  @podfile_path = path
143
143
  true
@@ -404,8 +404,7 @@ module BranchIOCLI
404
404
  text: "\n\\1pod \"Branch\""
405
405
  ).apply podfile_path
406
406
  # Store a Pod::Podfile representation of this file.
407
- # TODO: Might want to move this to Configuration.
408
- config.podfile = Pod::Podfile.from_file Pathname.new "Podfile"
407
+ config.open_podfile
409
408
  sh install_command
410
409
  end
411
410
 
@@ -651,7 +650,7 @@ EOF
651
650
  exit(-1)
652
651
  end
653
652
 
654
- gem_home = ENV["GEM_HOME"]
653
+ gem_home = Gem.dir
655
654
  if gem_home && File.writable?(gem_home)
656
655
  sh "gem install cocoapods"
657
656
  else
@@ -1,3 +1,3 @@
1
1
  module BranchIOCLI
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branch_io_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Branch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-08 00:00:00.000000000 Z
12
+ date: 2017-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: CFPropertyList