branch_io_cli 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assets/patches/ContinueUserActivity.m +4 -0
  3. data/lib/assets/patches/ContinueUserActivity.swift +4 -0
  4. data/lib/assets/patches/ContinueUserActivityNew.m +6 -0
  5. data/lib/assets/patches/ContinueUserActivityNew.swift +5 -0
  6. data/lib/assets/patches/DidFinishLaunching.m +4 -0
  7. data/lib/assets/patches/DidFinishLaunching.swift +5 -0
  8. data/lib/assets/patches/DidFinishLaunchingNew.m +9 -0
  9. data/lib/assets/patches/DidFinishLaunchingNew.swift +9 -0
  10. data/lib/assets/patches/DidFinishLaunchingNewTest.m +13 -0
  11. data/lib/assets/patches/DidFinishLaunchingNewTest.swift +13 -0
  12. data/lib/assets/patches/DidFinishLaunchingTest.m +8 -0
  13. data/lib/assets/patches/DidFinishLaunchingTest.swift +9 -0
  14. data/lib/assets/patches/OpenUrl.m +4 -0
  15. data/lib/assets/patches/OpenUrl.swift +4 -0
  16. data/lib/assets/patches/OpenUrlNew.m +6 -0
  17. data/lib/assets/patches/OpenUrlNew.swift +5 -0
  18. data/lib/assets/patches/OpenUrlSourceApplication.m +4 -0
  19. data/lib/assets/patches/OpenUrlSourceApplication.swift +4 -0
  20. data/lib/assets/patches/cartfile.yml +3 -0
  21. data/lib/assets/patches/continue_user_activity_new_objc.yml +2 -0
  22. data/lib/assets/patches/continue_user_activity_new_swift.yml +2 -0
  23. data/lib/assets/patches/continue_user_activity_objc.yml +2 -0
  24. data/lib/assets/patches/continue_user_activity_swift.yml +2 -0
  25. data/lib/assets/patches/did_finish_launching_new_objc.yml +2 -0
  26. data/lib/assets/patches/did_finish_launching_new_swift.yml +2 -0
  27. data/lib/assets/patches/did_finish_launching_new_test_objc.yml +2 -0
  28. data/lib/assets/patches/did_finish_launching_new_test_swift.yml +2 -0
  29. data/lib/assets/patches/did_finish_launching_objc.yml +2 -0
  30. data/lib/assets/patches/did_finish_launching_swift.yml +2 -0
  31. data/lib/assets/patches/did_finish_launching_test_objc.yml +2 -0
  32. data/lib/assets/patches/did_finish_launching_test_swift.yml +2 -0
  33. data/lib/assets/patches/objc_import.yml +3 -0
  34. data/lib/assets/patches/open_url_new_objc.yml +2 -0
  35. data/lib/assets/patches/open_url_new_swift.yml +2 -0
  36. data/lib/assets/patches/open_url_objc.yml +2 -0
  37. data/lib/assets/patches/open_url_source_application_objc.yml +2 -0
  38. data/lib/assets/patches/open_url_source_application_swift.yml +2 -0
  39. data/lib/assets/patches/open_url_swift.yml +2 -0
  40. data/lib/assets/patches/swift_import.yml +3 -0
  41. data/lib/branch_io_cli.rb +2 -1
  42. data/lib/branch_io_cli/cli.rb +3 -3
  43. data/lib/branch_io_cli/command.rb +4 -0
  44. data/lib/branch_io_cli/{commands → command}/command.rb +4 -3
  45. data/lib/branch_io_cli/{commands → command}/report_command.rb +57 -54
  46. data/lib/branch_io_cli/{commands → command}/setup_command.rb +29 -26
  47. data/lib/branch_io_cli/{commands → command}/validate_command.rb +4 -2
  48. data/lib/branch_io_cli/configuration.rb +4 -0
  49. data/lib/branch_io_cli/configuration/configuration.rb +211 -0
  50. data/lib/branch_io_cli/configuration/report_configuration.rb +164 -0
  51. data/lib/branch_io_cli/configuration/setup_configuration.rb +215 -0
  52. data/lib/branch_io_cli/configuration/validate_configuration.rb +26 -0
  53. data/lib/branch_io_cli/core_ext/io.rb +2 -2
  54. data/lib/branch_io_cli/helper.rb +1 -1
  55. data/lib/branch_io_cli/helper/branch_helper.rb +0 -16
  56. data/lib/branch_io_cli/helper/ios_helper.rb +87 -468
  57. data/lib/branch_io_cli/helper/methods.rb +1 -1
  58. data/lib/branch_io_cli/helper/patch_helper.rb +267 -0
  59. data/lib/branch_io_cli/version.rb +1 -1
  60. metadata +55 -11
  61. data/lib/branch_io_cli/commands.rb +0 -4
  62. data/lib/branch_io_cli/helper/configuration_helper.rb +0 -529
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 989a943d54479ffb6d3267bdf57872a68597f9d77675add48c258a2ab915baf1
4
- data.tar.gz: 4f3eb86d6364cba95221dbd6f29e84ba725ab1c04034abd49ee452930a88ba99
3
+ metadata.gz: 4599199e006b06d1b616d660c85fa73f04b5c75f687d7bea90511df2cc73b5e0
4
+ data.tar.gz: 8b0b81d38d5bec8d6d733c18ff0bfbffa5658ccd6a5d84618403cae1bca5f7d8
5
5
  SHA512:
6
- metadata.gz: bbc1488e06f6518d460b7095f01bd5ec28f27c53a1f3799acccab60e2924addb0f6679d4956332384794e7dedca39e1505bce0f5576085d8d418604d64d6b478
7
- data.tar.gz: 686b31264af06559b23f2d2e39713aac5df2f50802c82de3f459157722afa14c816feac24b2b148dc60160ca4bd59c1a36ab9747a7745a32b0214972c480dcb9
6
+ metadata.gz: be893c6067fa95597a296c8e7dacc66a847365ab1e5cb124d2000acf64716fd7dc40853839c3abbdc114c6ff0bb7d141e19e13f2694ecfe5b8d5168361f0203a
7
+ data.tar.gz: 1549178e5eb7f6e13f4f3e8d4de74171502bec799bb29e1d9ab2da2e4ea45f9c6957edd4818eafe005419d4abec9497f40c51104a7f630bac76043bdd79437a0
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if ([[Branch getInstance] continueUserActivity:userActivity]) {
3
+ return YES;
4
+ }
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if Branch.getInstance.continue(userActivity) {
3
+ return true
4
+ }
@@ -0,0 +1,6 @@
1
+
2
+
3
+ - (BOOL)application:(UIApplication *)app continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray * _Nullable))restorationHandler
4
+ {
5
+ return [[Branch getInstance] continueUserActivity:userActivity];
6
+ }
@@ -0,0 +1,5 @@
1
+
2
+
3
+ func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
4
+ return Branch.getInstance().continue(userActivity)
5
+ }
@@ -0,0 +1,4 @@
1
+ [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
2
+ andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
3
+ // TODO: Route Branch links
4
+ }];
@@ -0,0 +1,5 @@
1
+ Branch.getInstance().initSession(launchOptions: launchOptions) {
2
+ universalObject, linkProperties, error in
3
+
4
+ // TODO: Route Branch links
5
+ }
@@ -0,0 +1,9 @@
1
+
2
+
3
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4
+ [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
5
+ andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
6
+ // TODO: Route Branch links
7
+ }];
8
+ return YES;
9
+ }
@@ -0,0 +1,9 @@
1
+
2
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
3
+ Branch.getInstance().initSession(launchOptions: launchOptions) {
4
+ universalObject, linkProperties, error in
5
+
6
+ // TODO: Route Branch links
7
+ }
8
+ return true
9
+ }
@@ -0,0 +1,13 @@
1
+
2
+
3
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4
+ #ifdef DEBUG
5
+ [Branch setUseTestBranchKey:YES];
6
+ #endif // DEBUG
7
+
8
+ [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
9
+ andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
10
+ // TODO: Route Branch links
11
+ }];
12
+ return YES;
13
+ }
@@ -0,0 +1,13 @@
1
+
2
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
3
+ #if DEBUG
4
+ Branch.setUseTestBranchKey(true)
5
+ #endif
6
+
7
+ Branch.getInstance().initSession(launchOptions: launchOptions) {
8
+ universalObject, linkProperties, error in
9
+
10
+ // TODO: Route Branch links
11
+ }
12
+ return true
13
+ }
@@ -0,0 +1,8 @@
1
+ #ifdef DEBUG
2
+ [Branch setUseTestBranchKey:YES];
3
+ #endif // DEBUG
4
+
5
+ [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
6
+ andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
7
+ // TODO: Route Branch links
8
+ }];
@@ -0,0 +1,9 @@
1
+ #if DEBUG
2
+ Branch.setUseTestBranchKey(true)
3
+ #endif
4
+
5
+ Branch.getInstance().initSession(launchOptions: launchOptions) {
6
+ universalObject, linkProperties, error in
7
+
8
+ // TODO: Route Branch links
9
+ }
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if ([[Branch getInstance] application:app openURL:url options:options]) {
3
+ return YES;
4
+ }
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if Branch.getInstance().application(app, open: url, options: options) {
3
+ return true
4
+ }
@@ -0,0 +1,6 @@
1
+
2
+
3
+ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
4
+ {
5
+ return [[Branch getInstance] application:app openURL:url options:options];
6
+ }
@@ -0,0 +1,5 @@
1
+
2
+
3
+ func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
4
+ return Branch.getInstance().application(app, open: url, options: options)
5
+ }
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if ([[Branch getInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) {
3
+ return YES;
4
+ }
@@ -0,0 +1,4 @@
1
+ // TODO: Adjust your method as you see fit.
2
+ if Branch.getInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation) {
3
+ return true
4
+ }
@@ -0,0 +1,3 @@
1
+ regexp: '\z'
2
+ text: "github \"BranchMetrics/ios-branch-deep-linking\"\n"
3
+ mode: append
@@ -0,0 +1,2 @@
1
+ mode: prepend
2
+ text_file: ContinueUserActivityNew.m
@@ -0,0 +1,2 @@
1
+ mode: prepend
2
+ text_file: ContinueUserActivityNew.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: ContinueUserActivity.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: ContinueUserActivity.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingNew.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingNew.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingNewTest.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingNewTest.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunching.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunching.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingTest.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: DidFinishLaunchingTest.swift
@@ -0,0 +1,3 @@
1
+ regexp: '^\s+@import|^\s+#import.*$'
2
+ text: "\n#import <Branch/Branch.h>"
3
+ mode: prepend
@@ -0,0 +1,2 @@
1
+ mode: prepend
2
+ text_file: OpenUrlNew.m
@@ -0,0 +1,2 @@
1
+ mode: prepend
2
+ text_file: OpenUrlNew.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: OpenUrl.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: OpenUrlSourceApplication.m
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: OpenUrlSourceApplication.swift
@@ -0,0 +1,2 @@
1
+ mode: append
2
+ text_file: OpenUrl.swift
@@ -0,0 +1,3 @@
1
+ regexp: '^\s*import .*$'
2
+ text: "\nimport Branch"
3
+ mode: prepend
@@ -1,5 +1,6 @@
1
1
  require "branch_io_cli/cli"
2
- require "branch_io_cli/commands"
2
+ require "branch_io_cli/command"
3
+ require "branch_io_cli/configuration"
3
4
  require "branch_io_cli/core_ext"
4
5
  require "branch_io_cli/helper"
5
6
  require "branch_io_cli/version"
@@ -109,7 +109,7 @@ EOF
109
109
  commit: false,
110
110
  carthage_command: "update --platform ios"
111
111
  )
112
- Commands::SetupCommand.new(options).run!
112
+ Command::SetupCommand.new(options).run!
113
113
  end
114
114
  end
115
115
 
@@ -142,7 +142,7 @@ EOF
142
142
  c.option "--target MyAppTarget", String, "Name of a target to modify in the Xcode project"
143
143
 
144
144
  c.action do |args, options|
145
- valid = Commands::ValidateCommand.new(options).run!
145
+ valid = Command::ValidateCommand.new(options).run!
146
146
  exit_code = valid ? 0 : 1
147
147
  exit exit_code
148
148
  end
@@ -180,7 +180,7 @@ EOF
180
180
  out: "./report.txt",
181
181
  pod_repo_update: true
182
182
  )
183
- Commands::ReportCommand.new(options).run!
183
+ Command::ReportCommand.new(options).run!
184
184
  end
185
185
  end
186
186
 
@@ -0,0 +1,4 @@
1
+ require "branch_io_cli/command/command"
2
+ require "branch_io_cli/command/report_command"
3
+ require "branch_io_cli/command/setup_command"
4
+ require "branch_io_cli/command/validate_command"
@@ -1,7 +1,8 @@
1
1
  module BranchIOCLI
2
- module Commands
2
+ module Command
3
3
  class Command
4
4
  attr_reader :options
5
+ attr_reader :config # command-specific configuration object
5
6
 
6
7
  def initialize(options)
7
8
  @options = options
@@ -15,8 +16,8 @@ module BranchIOCLI
15
16
  Helper::BranchHelper
16
17
  end
17
18
 
18
- def config_helper
19
- Helper::ConfigurationHelper
19
+ def patch_helper
20
+ Helper::PatchHelper
20
21
  end
21
22
  end
22
23
  end
@@ -2,17 +2,17 @@ require "cocoapods-core"
2
2
  require "branch_io_cli/helper/methods"
3
3
 
4
4
  module BranchIOCLI
5
- module Commands
5
+ module Command
6
6
  class ReportCommand < Command
7
7
  def initialize(options)
8
8
  super
9
- config_helper.validate_report_options options
9
+ @config = Configuration::ReportConfiguration.new options
10
10
  end
11
11
 
12
12
  def run!
13
13
  say "\n"
14
14
 
15
- if config_helper.header_only
15
+ if config.header_only
16
16
  say report_header
17
17
  exit 0
18
18
  end
@@ -30,7 +30,7 @@ module BranchIOCLI
30
30
 
31
31
  install_command = "pod install"
32
32
 
33
- if config_helper.pod_repo_update
33
+ if config.pod_repo_update
34
34
  install_command += " --repo-update"
35
35
  else
36
36
  say <<EOF
@@ -43,53 +43,53 @@ EOF
43
43
  sh install_command
44
44
  end
45
45
 
46
- File.open config_helper.report_path, "w" do |report|
46
+ File.open config.report_path, "w" do |report|
47
47
  report.write "Branch.io Xcode build report v #{VERSION} #{DateTime.now}\n\n"
48
48
  report.write "#{report_configuration}\n"
49
49
  report.write "#{report_header}\n"
50
50
 
51
51
  # run xcodebuild -list
52
- report.report_command "#{base_xcodebuild_cmd} -list"
52
+ report.log_command "#{base_xcodebuild_cmd} -list"
53
53
 
54
54
  # If using a workspace, -list all the projects as well
55
- if config_helper.workspace_path
56
- config_helper.workspace.file_references.map(&:path).each do |project_path|
57
- path = File.join File.dirname(config_helper.workspace_path), project_path
58
- report.report_command "xcodebuild -list -project #{path}"
55
+ if config.workspace_path
56
+ config.workspace.file_references.map(&:path).each do |project_path|
57
+ path = File.join File.dirname(config.workspace_path), project_path
58
+ report.log_command "xcodebuild -list -project #{path}"
59
59
  end
60
60
  end
61
61
 
62
62
  base_cmd = base_xcodebuild_cmd
63
63
  # Add -scheme option for the rest of the commands if using a workspace
64
- base_cmd = "#{base_cmd} -scheme #{config_helper.scheme}" if config_helper.workspace_path
64
+ base_cmd = "#{base_cmd} -scheme #{config.scheme}" if config.workspace_path
65
65
 
66
66
  # xcodebuild -showBuildSettings
67
- report.report_command "#{base_cmd} -showBuildSettings"
67
+ report.log_command "#{base_cmd} -showBuildSettings"
68
68
 
69
69
  # Add more options for the rest of the commands
70
- base_cmd = "#{base_cmd} -configuration #{config_helper.configuration} -sdk #{config_helper.sdk}"
71
- base_cmd = "#{base_cmd} -target #{config_helper.target}" unless config_helper.workspace_path
70
+ base_cmd = "#{base_cmd} -configuration #{config.configuration} -sdk #{config.sdk}"
71
+ base_cmd = "#{base_cmd} -target #{config.target}" unless config.workspace_path
72
72
 
73
- if config_helper.clean
73
+ if config.clean
74
74
  say "Cleaning"
75
- report.report_command "#{base_cmd} clean"
75
+ report.log_command "#{base_cmd} clean"
76
76
  end
77
77
 
78
78
  say "Building"
79
- report.report_command "#{base_cmd} -verbose"
79
+ report.log_command "#{base_cmd} -verbose"
80
80
 
81
81
  say "Done ✅"
82
82
  end
83
83
 
84
- say "Report generated in #{config_helper.report_path}"
84
+ say "Report generated in #{config.report_path}"
85
85
  end
86
86
 
87
87
  def base_xcodebuild_cmd
88
88
  cmd = "xcodebuild"
89
- if config_helper.workspace_path
90
- cmd = "#{cmd} -workspace #{config_helper.workspace_path}"
89
+ if config.workspace_path
90
+ cmd = "#{cmd} -workspace #{config.workspace_path}"
91
91
  else
92
- cmd = "#{cmd} -project #{config_helper.xcodeproj_path}"
92
+ cmd = "#{cmd} -project #{config.xcodeproj_path}"
93
93
  end
94
94
  cmd
95
95
  end
@@ -102,30 +102,30 @@ EOF
102
102
  end
103
103
 
104
104
  def requirement_from_podfile
105
- return nil unless config_helper.podfile_path
106
- podfile = File.read config_helper.podfile_path
105
+ return nil unless config.podfile_path
106
+ podfile = File.read config.podfile_path
107
107
  matches = /\n?\s*pod\s+("Branch"|'Branch').*?\n/m.match podfile
108
108
  matches ? matches[0].strip : nil
109
109
  end
110
110
 
111
111
  def requirement_from_cartfile
112
- return nil unless config_helper.cartfile_path
113
- cartfile = File.read config_helper.cartfile_path
112
+ return nil unless config.cartfile_path
113
+ cartfile = File.read config.cartfile_path
114
114
  matches = %r{^git(hub\s+"|\s+"https://github.com/)BranchMetrics/(ios-branch-deep-linking|iOS-Deferred-Deep-Linking-SDK.*?).*?\n}m.match cartfile
115
115
  matches ? matches[0].strip : nil
116
116
  end
117
117
 
118
118
  def version_from_podfile_lock
119
- return nil unless config_helper.podfile_path && File.exist?("#{config_helper.podfile_path}.lock")
120
- podfile_lock = Pod::Lockfile.from_file Pathname.new "#{config_helper.podfile_path}.lock"
119
+ return nil unless config.podfile_path && File.exist?("#{config.podfile_path}.lock")
120
+ podfile_lock = Pod::Lockfile.from_file Pathname.new "#{config.podfile_path}.lock"
121
121
  version = podfile_lock.version "Branch"
122
122
 
123
123
  version ? "#{version} [Podfile.lock]" : nil
124
124
  end
125
125
 
126
126
  def version_from_cartfile_resolved
127
- return nil unless config_helper.cartfile_path && File.exist?("#{config_helper.cartfile_path}.resolved")
128
- cartfile_resolved = File.read "#{config_helper.cartfile_path}.resolved"
127
+ return nil unless config.cartfile_path && File.exist?("#{config.cartfile_path}.resolved")
128
+ cartfile_resolved = File.read "#{config.cartfile_path}.resolved"
129
129
 
130
130
  # Matches:
131
131
  # git "https://github.com/BranchMetrics/ios-branch-deep-linking"
@@ -143,7 +143,7 @@ EOF
143
143
  end
144
144
 
145
145
  def version_from_branch_framework
146
- framework = config_helper.target.frameworks_build_phase.files.find { |f| f.file_ref.path =~ /Branch.framework$/ }
146
+ framework = config.target.frameworks_build_phase.files.find { |f| f.file_ref.path =~ /Branch.framework$/ }
147
147
  return nil unless framework
148
148
  framework_path = framework.file_ref.real_path
149
149
  info_plist_path = File.join framework_path.to_s, "Info.plist"
@@ -159,7 +159,7 @@ EOF
159
159
 
160
160
  def version_from_bnc_config_m
161
161
  # Look for BNCConfig.m in embedded source
162
- bnc_config_m_ref = config_helper.xcodeproj.files.find { |f| f.path =~ /BNCConfig\.m$/ }
162
+ bnc_config_m_ref = config.xcodeproj.files.find { |f| f.path =~ /BNCConfig\.m$/ }
163
163
  return nil unless bnc_config_m_ref
164
164
  bnc_config_m = File.read bnc_config_m_ref.real_path
165
165
  matches = /BNC_SDK_VERSION\s+=\s+@"(\d+\.\d+\.\d+)"/m.match bnc_config_m
@@ -172,29 +172,28 @@ EOF
172
172
  <<EOF
173
173
  Configuration:
174
174
 
175
- Xcode workspace: #{config_helper.workspace_path || '(none)'}
176
- Xcode project: #{config_helper.xcodeproj_path || '(none)'}
177
- Scheme: #{config_helper.scheme || '(none)'}
178
- Target: #{config_helper.target || '(none)'}
179
- Configuration: #{config_helper.configuration || '(none)'}
180
- SDK: #{config_helper.sdk}
181
- Podfile: #{config_helper.podfile_path || '(none)'}
182
- Cartfile: #{config_helper.cartfile_path || '(none)'}
183
- Pod repo update: #{config_helper.pod_repo_update.inspect}
184
- Clean: #{config_helper.clean.inspect}
175
+ Xcode workspace: #{config.workspace_path || '(none)'}
176
+ Xcode project: #{config.xcodeproj_path || '(none)'}
177
+ Scheme: #{config.scheme || '(none)'}
178
+ Target: #{config.target || '(none)'}
179
+ Configuration: #{config.configuration || '(none)'}
180
+ SDK: #{config.sdk}
181
+ Podfile: #{config.podfile_path || '(none)'}
182
+ Cartfile: #{config.cartfile_path || '(none)'}
183
+ Pod repo update: #{config.pod_repo_update.inspect}
184
+ Clean: #{config.clean.inspect}
185
185
  EOF
186
186
  end
187
187
 
188
188
  def pod_install_required?
189
189
  # If this is set, its existence has been verified.
190
- return false unless config_helper.podfile_path
190
+ return false unless config.podfile_path
191
191
 
192
- lockfile_path = "#{config_helper.podfile_path}.lock"
193
- manifest_path = File.expand_path "../Pods/Manifest.lock", config_helper.podfile_path
192
+ lockfile_path = "#{config.podfile_path}.lock"
193
+ manifest_path = File.expand_path "../Pods/Manifest.lock", config.podfile_path
194
194
 
195
195
  return true unless File.exist?(lockfile_path) && File.exist?(manifest_path)
196
196
 
197
- podfile = Pod::Podfile.from_file Pathname.new config_helper.podfile_path
198
197
  lockfile = Pod::Lockfile.from_file Pathname.new lockfile_path
199
198
  manifest = Pod::Lockfile.from_file Pathname.new manifest_path
200
199
 
@@ -206,7 +205,7 @@ EOF
206
205
  # compare checksum of Podfile with checksum in Podfile.lock
207
206
  # This is a good sanity check, but perhaps unnecessary. It means pod install
208
207
  # has not been run since the Podfile was modified, which is probably an oversight.
209
- return true unless lockfile.to_hash["PODFILE CHECKSUM"] == podfile.checksum
208
+ return true unless lockfile.to_hash["PODFILE CHECKSUM"] == config.podfile.checksum
210
209
 
211
210
  false
212
211
  end
@@ -217,17 +216,21 @@ EOF
217
216
 
218
217
  header += `xcodebuild -version`
219
218
 
220
- header += "\nTarget #{config_helper.target.name} deploy target: #{config_helper.target.deployment_target}\n"
219
+ header += "\nTarget #{config.target.name}:\n"
220
+ header += " Deployment target: #{config.target.deployment_target}\n"
221
+ header += " Modules #{config.modules_enabled? ? '' : 'not '}enabled\n"
222
+ header += " Swift #{config.swift_version}\n" if config.swift_version
223
+ header += " Bridging header: #{config.bridging_header_path}\n" if config.bridging_header_path
221
224
 
222
- if config_helper.podfile_path
225
+ if config.podfile_path
223
226
  begin
224
227
  cocoapods_version = `pod --version`.chomp
225
228
  rescue Errno::ENOENT
226
229
  header += "\n(pod command not found)\n"
227
230
  end
228
231
 
229
- if File.exist?("#{config_helper.podfile_path}.lock")
230
- podfile_lock = Pod::Lockfile.from_file Pathname.new "#{config_helper.podfile_path}.lock"
232
+ if File.exist?("#{config.podfile_path}.lock")
233
+ podfile_lock = Pod::Lockfile.from_file Pathname.new "#{config.podfile_path}.lock"
231
234
  end
232
235
 
233
236
  if cocoapods_version || podfile_lock
@@ -242,8 +245,8 @@ EOF
242
245
  end
243
246
 
244
247
  # Already verified existence.
245
- podfile = Pod::Podfile.from_file Pathname.new config_helper.podfile_path
246
- target_definition = podfile.target_definition_list.find { |t| t.name == config_helper.target.name }
248
+ podfile = Pod::Podfile.from_file Pathname.new config.podfile_path
249
+ target_definition = podfile.target_definition_list.find { |t| t.name == config.target.name }
247
250
  if target_definition
248
251
  branch_dep = target_definition.dependencies.find { |p| p.name == "Branch" }
249
252
  header += "Podfile target #{target_definition.name}:"
@@ -255,13 +258,13 @@ EOF
255
258
  header += ", #{branch_dep.external_source}" if branch_dep && branch_dep.external_source
256
259
  header += "\n"
257
260
  else
258
- header += "Target #{config_helper.target.name.inspect} not found in Podfile.\n"
261
+ header += "Target #{config.target.name.inspect} not found in Podfile.\n"
259
262
  end
260
263
 
261
264
  header += "\npod install #{pod_install_required? ? '' : 'not '}required.\n"
262
265
  end
263
266
 
264
- if config_helper.cartfile_path
267
+ if config.cartfile_path
265
268
  begin
266
269
  carthage_version = `carthage version`.chomp
267
270
  header += "\nUsing Carthage v. #{carthage_version}\n"