branch_io_cli 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/patches/DidFinishLaunching.m +13 -0
- data/lib/assets/patches/DidFinishLaunching.swift +12 -0
- data/lib/branch_io_cli/helper/patch_helper.rb +18 -26
- data/lib/branch_io_cli/version.rb +1 -1
- metadata +4 -16
- data/lib/assets/patches/DidFinishLaunchingNew.m +0 -9
- data/lib/assets/patches/DidFinishLaunchingNew.swift +0 -9
- data/lib/assets/patches/DidFinishLaunchingNewTest.m +0 -13
- data/lib/assets/patches/DidFinishLaunchingNewTest.swift +0 -13
- data/lib/assets/patches/DidFinishLaunchingTest.m +0 -8
- data/lib/assets/patches/DidFinishLaunchingTest.swift +0 -9
- data/lib/assets/patches/did_finish_launching_new_objc.yml +0 -2
- data/lib/assets/patches/did_finish_launching_new_swift.yml +0 -2
- data/lib/assets/patches/did_finish_launching_new_test_objc.yml +0 -2
- data/lib/assets/patches/did_finish_launching_new_test_swift.yml +0 -2
- data/lib/assets/patches/did_finish_launching_test_objc.yml +0 -2
- data/lib/assets/patches/did_finish_launching_test_swift.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 875f76682dccf962d868c7ac37b3e5aab590e9655af0fd2266267d56f87e9d2b
|
4
|
+
data.tar.gz: 453b47d417a6014d219ee5154c395ed435bf136c647d0d5b31aee0f70096259f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec7fdaf5b83fd581c5712184082a738d7c07305a9a3ae8bb190ef793e29b99b2952e8ffd031f20d00d30c4b65dc2ad3f87efa6718bdef142bf3ab2775df1c8a
|
7
|
+
data.tar.gz: 144f3cff5bdce88845a687d1f1b188fa1872bd229598b2a56f0c96660c34c1274864ee294f3aece2a795f3e9d45f97138d16eb80a19d2ba0bcbcf26d8540d176
|
@@ -1,4 +1,17 @@
|
|
1
|
+
<% if is_new_method %>
|
2
|
+
|
3
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
4
|
+
<% end %>
|
5
|
+
<% if use_conditional_test_key? %>
|
6
|
+
#ifdef DEBUG
|
7
|
+
[Branch setUseTestBranchKey:YES];
|
8
|
+
#endif // DEBUG
|
9
|
+
<% end %>
|
1
10
|
[[Branch getInstance] initSessionWithLaunchOptions:launchOptions
|
2
11
|
andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
|
3
12
|
// TODO: Route Branch links
|
4
13
|
}];
|
14
|
+
<% if is_new_method %>
|
15
|
+
return YES;
|
16
|
+
}
|
17
|
+
<% end %>
|
@@ -1,5 +1,17 @@
|
|
1
|
+
<% if is_new_method %>
|
2
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
3
|
+
<% end %>
|
4
|
+
<% if use_conditional_test_key? %>
|
5
|
+
#if DEBUG
|
6
|
+
Branch.setUseTestBranchKey(true)
|
7
|
+
#endif
|
8
|
+
<% end %>
|
1
9
|
Branch.getInstance().initSession(launchOptions: launchOptions) {
|
2
10
|
universalObject, linkProperties, error in
|
3
11
|
|
4
12
|
// TODO: Route Branch links
|
5
13
|
}
|
14
|
+
<% if is_new_method %>
|
15
|
+
return true
|
16
|
+
}
|
17
|
+
<% end %>
|
@@ -21,6 +21,10 @@ module BranchIOCLI
|
|
21
21
|
helper.add_change change
|
22
22
|
end
|
23
23
|
|
24
|
+
def use_conditional_test_key?
|
25
|
+
config.keys.count > 1 && !helper.has_multiple_info_plists?
|
26
|
+
end
|
27
|
+
|
24
28
|
def patch_bridging_header
|
25
29
|
unless config.bridging_header_path
|
26
30
|
say "Modules not available and bridging header not found. Cannot import Branch."
|
@@ -95,43 +99,31 @@ module BranchIOCLI
|
|
95
99
|
def patch_did_finish_launching_method_swift(app_delegate_swift_path)
|
96
100
|
app_delegate_swift = File.read app_delegate_swift_path
|
97
101
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
|
102
|
-
patch_name += "swift"
|
103
|
-
patch = load_patch patch_name
|
104
|
-
patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
|
105
|
-
else
|
102
|
+
patch = load_patch(:did_finish_launching_swift)
|
103
|
+
is_new_method = app_delegate_swift !~ /didFinishLaunching[^\n]+?\{/m
|
104
|
+
if is_new_method
|
106
105
|
# method not present. add entire method
|
107
|
-
patch_name += "new_"
|
108
|
-
patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
|
109
|
-
patch_name += "swift"
|
110
|
-
patch = load_patch patch_name
|
111
106
|
patch.regexp = /var\s+window\s?:\s?UIWindow\?.*?\n/m
|
107
|
+
else
|
108
|
+
# method already present
|
109
|
+
patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
|
112
110
|
end
|
113
|
-
patch.apply app_delegate_swift_path
|
111
|
+
patch.apply app_delegate_swift_path, binding: binding
|
114
112
|
end
|
115
113
|
|
116
114
|
def patch_did_finish_launching_method_objc(app_delegate_objc_path)
|
117
115
|
app_delegate_objc = File.read app_delegate_objc_path
|
118
116
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
|
123
|
-
patch_name += "objc"
|
124
|
-
patch = load_patch patch_name
|
125
|
-
patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
|
126
|
-
else
|
117
|
+
patch = load_patch(:did_finish_launching_objc)
|
118
|
+
is_new_method = app_delegate_objc !~ /didFinishLaunchingWithOptions/m
|
119
|
+
if is_new_method
|
127
120
|
# method does not exist. add it.
|
128
|
-
patch_name += "new_"
|
129
|
-
patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
|
130
|
-
patch_name += "objc"
|
131
|
-
patch = load_patch patch_name
|
132
121
|
patch.regexp = /^@implementation.*?\n/m
|
122
|
+
else
|
123
|
+
# method exists. patch it.
|
124
|
+
patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
|
133
125
|
end
|
134
|
-
patch.apply app_delegate_objc_path
|
126
|
+
patch.apply app_delegate_objc_path, binding: binding
|
135
127
|
end
|
136
128
|
|
137
129
|
def patch_open_url_method_swift(app_delegate_swift_path)
|
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.
|
4
|
+
version: 0.9.2
|
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-
|
12
|
+
date: 2017-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: CFPropertyList
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.4.0
|
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.
|
69
|
+
version: 0.4.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: plist
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -256,12 +256,6 @@ files:
|
|
256
256
|
- lib/assets/patches/ContinueUserActivityNew.swift
|
257
257
|
- lib/assets/patches/DidFinishLaunching.m
|
258
258
|
- lib/assets/patches/DidFinishLaunching.swift
|
259
|
-
- lib/assets/patches/DidFinishLaunchingNew.m
|
260
|
-
- lib/assets/patches/DidFinishLaunchingNew.swift
|
261
|
-
- lib/assets/patches/DidFinishLaunchingNewTest.m
|
262
|
-
- lib/assets/patches/DidFinishLaunchingNewTest.swift
|
263
|
-
- lib/assets/patches/DidFinishLaunchingTest.m
|
264
|
-
- lib/assets/patches/DidFinishLaunchingTest.swift
|
265
259
|
- lib/assets/patches/OpenUrl.m
|
266
260
|
- lib/assets/patches/OpenUrl.swift
|
267
261
|
- lib/assets/patches/OpenUrlNew.m
|
@@ -273,14 +267,8 @@ files:
|
|
273
267
|
- lib/assets/patches/continue_user_activity_new_swift.yml
|
274
268
|
- lib/assets/patches/continue_user_activity_objc.yml
|
275
269
|
- lib/assets/patches/continue_user_activity_swift.yml
|
276
|
-
- lib/assets/patches/did_finish_launching_new_objc.yml
|
277
|
-
- lib/assets/patches/did_finish_launching_new_swift.yml
|
278
|
-
- lib/assets/patches/did_finish_launching_new_test_objc.yml
|
279
|
-
- lib/assets/patches/did_finish_launching_new_test_swift.yml
|
280
270
|
- lib/assets/patches/did_finish_launching_objc.yml
|
281
271
|
- lib/assets/patches/did_finish_launching_swift.yml
|
282
|
-
- lib/assets/patches/did_finish_launching_test_objc.yml
|
283
|
-
- lib/assets/patches/did_finish_launching_test_swift.yml
|
284
272
|
- lib/assets/patches/objc_import.yml
|
285
273
|
- lib/assets/patches/open_url_new_objc.yml
|
286
274
|
- lib/assets/patches/open_url_new_swift.yml
|
@@ -1,9 +0,0 @@
|
|
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
|
-
}
|
@@ -1,9 +0,0 @@
|
|
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
|
-
}
|
@@ -1,13 +0,0 @@
|
|
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
|
-
}
|
@@ -1,13 +0,0 @@
|
|
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
|
-
}
|
@@ -1,8 +0,0 @@
|
|
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
|
-
}];
|