branch_io_cli 0.12.1 → 0.12.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1614c75a346bfa728be2437d7e729a54c381199c1786699210defc36a33e390
4
- data.tar.gz: '0334849b987d626b6e606972c552a1ae2e737aad2746b96519da1402a8a48c85'
3
+ metadata.gz: 1fdec6cc2dfb747d21b5289bb907cdc3a0726d9b09cc489e7fa1d345da843745
4
+ data.tar.gz: af5b660dceb286f2f0d2b923944cfd447812d2be25243dfeef4beabbabf68a4c
5
5
  SHA512:
6
- metadata.gz: d6ddacc36d94b84d8fa6f90b7a80c1964915e9a3b174d2d0928b53be0112cc31de7758a0f441e7c89adb1d0ce3baea2cb74ed5d7b4220dc770b43664ccfb512f
7
- data.tar.gz: 29f548ba0c9c57583682f80c0f633cd8ef837f342342ba32ba8472a6f55554efe7a92b38e98ab5902c08c5bc39097251436fade3e53e542af8d0a41c52cc6603
6
+ metadata.gz: c134396f2768b91d8a157967f524136cd10a4d3b4b8358ce15830a6c99250af358fdb606c7192092dda158bed11d69ca94d9a9dcd30b78985e325ee9155514ba
7
+ data.tar.gz: 734523ffb51d4615e456056b81f8ecdff2c73278970f1114487a7b9765ba32a94348d1921d6c2148374d94796f411f98800a599ebd1f7b95efa346000fd4d9da
data/README.md CHANGED
@@ -208,11 +208,17 @@ Only app targets are supported for this command. By default, it will validate th
208
208
  If your project has multiple app targets, specify the `--target` option to validate other
209
209
  targets.
210
210
 
211
- All parameters are optional. If `--domains` is specified, the list of Universal Link domains in
212
- the Associated Domains entitlement must exactly match this list, without regard to order. If
213
- no `--domains` are provided, validation passes if at least one Universal Link domain is
214
- configured and passes validation, and no Universal Link domain is present that does not pass
215
- validation.
211
+ By default, all build configurations in the project are validated. To validate a different list
212
+ of configurations, including a single configuration, specify the `--configurations` option.
213
+
214
+ If `--domains` is specified, the list of Universal Link domains in the Associated
215
+ Domains entitlement must exactly match this list, without regard to order, for all
216
+ configurations under validation. If no `--domains` are provided, validation passes
217
+ if at least one Universal Link domain is configured for each configuration and passes
218
+ validation, and no Universal Link domain is present in anyconfiguration that does not
219
+ pass validation.
220
+
221
+ All parameters are optional.
216
222
 
217
223
  See https://github.com/BranchMetrics/branch_io_cli#validate-command for more information.
218
224
 
@@ -227,6 +233,7 @@ See https://github.com/BranchMetrics/branch_io_cli#validate-command for more inf
227
233
  |-D, --domains example.com,www.example.com|Comma-separated list of domains to validate (Branch domains or non-Branch domains) (default: [])|BRANCH_DOMAINS|
228
234
  |--xcodeproj MyProject.xcodeproj|Path to an Xcode project to update|BRANCH_XCODEPROJ|
229
235
  |--target MyAppTarget|Name of a target to validate in the Xcode project|BRANCH_TARGET|
236
+ |--configurations Debug,Release|Comma-separated list of configurations to validate (default: all)|BRANCH_CONFIGURATIONS|
230
237
 
231
238
 
232
239
 
@@ -238,11 +245,12 @@ See https://github.com/BranchMetrics/branch_io_cli#validate-command for more inf
238
245
  branch_io report [OPTIONS]
239
246
  ```
240
247
 
241
- _Work in progress_
242
-
243
248
  This command optionally cleans and then builds a workspace or project, generating a verbose
244
249
  report with additional diagnostic information suitable for opening a support ticket.
245
250
 
251
+ Use the `--header-only` option to output only a brief diagnostic report without
252
+ building.
253
+
246
254
 
247
255
  #### Options
248
256
 
@@ -17,7 +17,7 @@ _branch_io_complete()
17
17
 
18
18
  report_opts="--workspace --xcodeproj --scheme --target --configuration --sdk --podfile --cartfile --no-clean -H --header-only --no-pod-repo-update -o --out"
19
19
 
20
- validate_opts="-D --domains --xcodeproj --target"
20
+ validate_opts="-D --domains --xcodeproj --target --configurations"
21
21
 
22
22
 
23
23
  if [[ ${cur} == -* ]] ; then
@@ -1,4 +1,5 @@
1
- <%= italics 'Work in progress' %>
2
-
3
1
  This command optionally cleans and then builds a workspace or project, generating a verbose
4
2
  report with additional diagnostic information suitable for opening a support ticket.
3
+
4
+ Use the <%= option :header_only %> option to output only a brief diagnostic report without
5
+ building.
@@ -9,10 +9,16 @@ Only app targets are supported for this command. By default, it will validate th
9
9
  If your project has multiple app targets, specify the <%= option :target %> option to validate other
10
10
  targets.
11
11
 
12
- All parameters are optional. If <%= option :domains %> is specified, the list of Universal Link domains in
13
- the Associated Domains entitlement must exactly match this list, without regard to order. If
14
- no <%= option :domains %> are provided, validation passes if at least one Universal Link domain is
15
- configured and passes validation, and no Universal Link domain is present that does not pass
16
- validation.
12
+ By default, all build configurations in the project are validated. To validate a different list
13
+ of configurations, including a single configuration, specify the <%= option :configurations %> option.
14
+
15
+ If <%= option :domains %> is specified, the list of Universal Link domains in the Associated
16
+ Domains entitlement must exactly match this list, without regard to order, for all
17
+ configurations under validation. If no <%= option :domains %> are provided, validation passes
18
+ if at least one Universal Link domain is configured for each configuration and passes
19
+ validation, and no Universal Link domain is present in anyconfiguration that does not
20
+ pass validation.
21
+
22
+ All parameters are optional.
17
23
 
18
24
  See https://github.com/BranchMetrics/branch_io_cli#validate-command for more information.
@@ -45,8 +45,12 @@ module BranchIOCLI
45
45
  helper.add_branch_universal_link_domains_to_info_plist @domains if is_app_target
46
46
  helper.ensure_uri_scheme_in_info_plist if is_app_target # does nothing if already present
47
47
 
48
- new_path = helper.add_universal_links_to_project @domains, false if is_app_target
49
- sh ["git", "add", new_path] if config.commit && new_path
48
+ if is_app_target
49
+ config.xcodeproj.build_configurations.each do |c|
50
+ new_path = helper.add_universal_links_to_project @domains, false, c.name
51
+ sh ["git", "add", new_path] if config.commit && new_path
52
+ end
53
+ end
50
54
 
51
55
  config_helper.target.add_system_frameworks config.frameworks unless config.frameworks.nil? || config.frameworks.empty?
52
56
 
@@ -4,28 +4,39 @@ module BranchIOCLI
4
4
  def run!
5
5
  valid = true
6
6
 
7
- unless config.domains.nil? || config.domains.empty?
8
- domains_valid = helper.validate_project_domains(config.domains)
7
+ configurations = config.configurations || config.xcodeproj.build_configurations.map(&:name)
9
8
 
10
- if domains_valid
11
- say "Project domains match :domains parameter: ✅"
12
- else
13
- say "Project domains do not match specified :domains"
14
- helper.errors.each { |error| say " #{error}" }
9
+ configurations.each do |configuration|
10
+ message = "Validating #{configuration} configuration"
11
+ say "\n<%= color('#{message}', [BOLD, CYAN]) %>\n\n"
12
+
13
+ config_valid = true
14
+
15
+ unless config.domains.blank?
16
+ domains_valid = helper.validate_project_domains(config.domains, configuration)
17
+
18
+ if domains_valid
19
+ say "Project domains match :domains parameter: ✅"
20
+ else
21
+ say "Project domains do not match specified :domains"
22
+ helper.errors.each { |error| say " #{error}" }
23
+ end
24
+
25
+ config_valid &&= domains_valid
15
26
  end
16
27
 
17
- valid &&= domains_valid
18
- end
28
+ entitlements_valid = helper.validate_team_and_bundle_ids_from_aasa_files [], false, configuration
29
+ unless entitlements_valid
30
+ say "Universal Link configuration failed validation for #{configuration} configuration."
31
+ helper.errors.each { |error| say " #{error}" }
32
+ end
19
33
 
20
- configuration_valid = helper.validate_team_and_bundle_ids_from_aasa_files
21
- unless configuration_valid
22
- say "Universal Link configuration failed validation."
23
- helper.errors.each { |error| say " #{error}" }
24
- end
34
+ config_valid &&= entitlements_valid
25
35
 
26
- valid &&= configuration_valid
36
+ say "Universal Link configuration passed validation for #{configuration} configuration. ✅" if config_valid
27
37
 
28
- say "Universal Link configuration passed validation. ✅" if valid
38
+ valid &&= config_valid
39
+ end
29
40
 
30
41
  valid ? 0 : 1
31
42
  end
@@ -31,6 +31,12 @@ module BranchIOCLI
31
31
  description: "Name of a target to validate in the Xcode project",
32
32
  type: String,
33
33
  example: "MyAppTarget"
34
+ ),
35
+ Option.new(
36
+ name: :configurations,
37
+ description: "Comma-separated list of configurations to validate (default: all)",
38
+ type: Array,
39
+ example: "Debug,Release"
34
40
  )
35
41
  ]
36
42
  end
@@ -52,6 +58,7 @@ module BranchIOCLI
52
58
  <%= color('Xcode project:', BOLD) %> #{xcodeproj_path}
53
59
  <%= color('Target:', BOLD) %> #{target.name}
54
60
  <%= color('Domains:', BOLD) %> #{domains || '(none)'}
61
+ <%= color('Configurations:', BOLD) %> #{(configurations || xcodeproj.build_configurations.map(&:name)).join(',')}
55
62
  EOF
56
63
  end
57
64
  end
@@ -392,7 +392,10 @@ module BranchIOCLI
392
392
  entitlements = File.open(entitlements_path) { |f| Plist.parse_xml f }
393
393
  raise "Failed to parse entitlements file #{entitlements_path}" if entitlements.nil?
394
394
 
395
- entitlements[ASSOCIATED_DOMAINS].select { |d| d =~ /^applinks:/ }.map { |d| d.sub(/^applinks:/, "") }
395
+ associated_domains = entitlements[ASSOCIATED_DOMAINS]
396
+ return [] if associated_domains.nil?
397
+
398
+ associated_domains.select { |d| d =~ /^applinks:/ }.map { |d| d.sub(/^applinks:/, "") }
396
399
  end
397
400
 
398
401
  def add_cocoapods(options)
@@ -7,7 +7,8 @@ module BranchIOCLI
7
7
  extend PatternPatch::Methods
8
8
 
9
9
  # Set the patch_dir for PatternPatch
10
- @patch_dir = File.expand_path(File.join('..', '..', '..', 'assets', 'patches'), __FILE__)
10
+ self.patch_dir = File.expand_path(File.join('..', '..', '..', 'assets', 'patches'), __FILE__)
11
+ self.trim_mode = "<>"
11
12
 
12
13
  class << self
13
14
  def config
@@ -61,7 +61,6 @@ module BranchIOCLI
61
61
 
62
62
  bundle_identifier = config.target.expanded_build_setting "PRODUCT_BUNDLE_IDENTIFIER", configuration
63
63
  dev_team = config.target.expanded_build_setting "DEVELOPMENT_TEAM", configuration
64
- entitlements_path = config.target.expanded_build_setting "CODE_SIGN_ENTITLEMENTS", configuration
65
64
 
66
65
  header += "\nTarget #{config.target.name}:\n"
67
66
  header += " Bundle identifier: #{bundle_identifier || '(none)'}\n"
@@ -76,7 +75,10 @@ module BranchIOCLI
76
75
  header += " #{c}: #{config.target.expanded_build_setting 'INFOPLIST_FILE', c}\n"
77
76
  end
78
77
 
79
- header += " Entitlements file: #{config.relative_path(entitlements_path) || '(none)'}\n"
78
+ header += " Entitlements file\n"
79
+ configurations.each do |c|
80
+ header += " #{c}: #{config.target.expanded_build_setting 'CODE_SIGN_ENTITLEMENTS', c}\n"
81
+ end
80
82
 
81
83
  if config.podfile_path
82
84
  begin
@@ -196,12 +198,13 @@ module BranchIOCLI
196
198
 
197
199
  unless config.target.extension_target_type?
198
200
  begin
199
- # This isn't likely to vary by configuration, so just report for one, either
200
- # whatever was passed or Release.
201
- domains = helper.domains_from_project config.configuration || config.configurations_from_scheme.first
202
- report += " Universal Link domains (entitlements):\n"
203
- domains.each do |domain|
204
- report += " #{domain}\n"
201
+ configurations = config.configuration ? [config.configuration] : config.configurations_from_scheme
202
+ configurations.each do |configuration|
203
+ domains = helper.domains_from_project configuration
204
+ report += " Universal Link domains (entitlements:#{configuration}):\n"
205
+ domains.each do |domain|
206
+ report += " #{domain}\n"
207
+ end
205
208
  end
206
209
  rescue StandardError => e
207
210
  report += " (Failed to get Universal Link domains from entitlements file: #{e.message})\n"
@@ -1,3 +1,3 @@
1
1
  module BranchIOCLI
2
- VERSION = "0.12.1"
2
+ VERSION = "0.12.2"
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.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Branch
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 0.5.3
62
+ version: 0.5.4
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.5.3
69
+ version: 0.5.4
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: plist
72
72
  requirement: !ruby/object:Gem::Requirement