branch_io_cli 0.2.2 → 0.3.0
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 +4 -4
- data/README.md +10 -0
- data/lib/branch_io_cli/command.rb +24 -48
- data/lib/branch_io_cli/helper/configuration_helper.rb +263 -7
- data/lib/branch_io_cli/version.rb +1 -1
- metadata +34 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed6a08fd41a779e66e95b3d4bbfd60b73f9f1a7
|
4
|
+
data.tar.gz: 86d0ab68a447fa963a9bb40810aec4c9e7a54d13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6853fe36957e1364ee1d3cfabfc43126d49570c8799838648619ddba431f62a0ddab9de3bdb641a9907d5f48d2fd3968226cb91b7e2001b65496dafdc5629ba2
|
7
|
+
data.tar.gz: f37d61ba24b28fb17663d2ae71d7c38c800458fb58c12fb68ef2381e4e243c4688936b5ee4a9d16cfe1d57bfa87378d9ed24ab37ee04840bc3167974d1068d69
|
data/README.md
CHANGED
@@ -11,6 +11,11 @@ This is a command-line tool to integrate the Branch SDK into mobile app projects
|
|
11
11
|
|
12
12
|
This is a preliminary release of this gem. Please report any problems by opening issues in this repo.
|
13
13
|
|
14
|
+
### Using Fastlane?
|
15
|
+
|
16
|
+
See also the [Branch Fastlane plugin](https://github.com/BranchMetrics/fastlane-plugin-branch), which offers
|
17
|
+
the same support via Fastlane.
|
18
|
+
|
14
19
|
## Getting started
|
15
20
|
|
16
21
|
```bash
|
@@ -125,3 +130,8 @@ and no Universal Link domain is present that does not pass validation.
|
|
125
130
|
#### Return value
|
126
131
|
|
127
132
|
If validation passes, this command returns 0. If validation fails, it returns 1.
|
133
|
+
|
134
|
+
## Examples
|
135
|
+
|
136
|
+
See the [examples](./examples) folder for several example projects that can be
|
137
|
+
used to exercise the CLI.
|
@@ -1,15 +1,16 @@
|
|
1
|
+
require "pathname"
|
1
2
|
require "xcodeproj"
|
2
3
|
|
3
4
|
module BranchIOCLI
|
4
5
|
class Command
|
5
6
|
class << self
|
6
7
|
def setup(options)
|
7
|
-
|
8
|
+
config_helper.validate_setup_options options
|
8
9
|
|
9
|
-
@keys =
|
10
|
-
@domains =
|
11
|
-
@xcodeproj_path =
|
12
|
-
xcodeproj =
|
10
|
+
@keys = config_helper.keys
|
11
|
+
@domains = config_helper.all_domains
|
12
|
+
@xcodeproj_path = config_helper.xcodeproj_path
|
13
|
+
xcodeproj = config_helper.xcodeproj
|
13
14
|
|
14
15
|
update_podfile(options) || update_cartfile(options, xcodeproj)
|
15
16
|
|
@@ -38,14 +39,17 @@ module BranchIOCLI
|
|
38
39
|
|
39
40
|
return unless options.commit
|
40
41
|
|
41
|
-
|
42
|
+
current_pathname = Pathname.new File.expand_path "."
|
43
|
+
changes = helper.changes.to_a.map { |c| Pathname.new(File.expand_path(c)).relative_path_from(current_pathname).to_s }
|
44
|
+
|
45
|
+
`git commit #{changes.join(" ")} -m '[branch_io_cli] Branch SDK integration'`
|
42
46
|
end
|
43
47
|
|
44
48
|
def validate(options)
|
45
|
-
|
49
|
+
config_helper.validate_validation_options options
|
46
50
|
|
47
51
|
# raises
|
48
|
-
xcodeproj =
|
52
|
+
xcodeproj = config_helper.xcodeproj
|
49
53
|
|
50
54
|
valid = true
|
51
55
|
|
@@ -80,45 +84,15 @@ module BranchIOCLI
|
|
80
84
|
end
|
81
85
|
|
82
86
|
def helper
|
83
|
-
|
87
|
+
Helper::BranchHelper
|
84
88
|
end
|
85
89
|
|
86
|
-
def
|
87
|
-
|
88
|
-
return nil if options.no_add_sdk
|
89
|
-
|
90
|
-
# Use the :podfile parameter if present
|
91
|
-
if options.podfile
|
92
|
-
raise "--podfile argument must specify a path ending in '/Podfile'" unless options.podfile =~ %r{/Podfile$}
|
93
|
-
podfile_path = File.expand_path options.podfile, "."
|
94
|
-
return podfile_path if File.exist? podfile_path
|
95
|
-
raise "#{podfile_path} not found"
|
96
|
-
end
|
97
|
-
|
98
|
-
# Look in the same directory as the project (typical setup)
|
99
|
-
podfile_path = File.expand_path "../Podfile", @xcodeproj_path
|
100
|
-
return podfile_path if File.exist? podfile_path
|
101
|
-
end
|
102
|
-
|
103
|
-
def cartfile_path(options)
|
104
|
-
# Disable Cartfile update if add_sdk: false is present
|
105
|
-
return nil if options.no_add_sdk
|
106
|
-
|
107
|
-
# Use the :cartfile parameter if present
|
108
|
-
if options.cartfile
|
109
|
-
raise "--cartfile argument must specify a path ending in '/Cartfile'" unless options.cartfile =~ %r{/Cartfile$}
|
110
|
-
cartfile_path = File.expand_path options.cartfile, "."
|
111
|
-
return cartfile_path if File.exist? cartfile_path
|
112
|
-
raise "#{cartfile_path} not found"
|
113
|
-
end
|
114
|
-
|
115
|
-
# Look in the same directory as the project (typical setup)
|
116
|
-
cartfile_path = File.expand_path "../Cartfile", @xcodeproj_path
|
117
|
-
return cartfile_path if File.exist? cartfile_path
|
90
|
+
def config_helper
|
91
|
+
Helper::ConfigurationHelper
|
118
92
|
end
|
119
93
|
|
120
94
|
def update_podfile(options)
|
121
|
-
podfile_path = podfile_path
|
95
|
+
podfile_path = config_helper.podfile_path
|
122
96
|
return false if podfile_path.nil?
|
123
97
|
|
124
98
|
# 1. Patch Podfile. Return if no change (Branch pod already present).
|
@@ -138,7 +112,8 @@ module BranchIOCLI
|
|
138
112
|
helper.add_change "#{podfile_path}.lock"
|
139
113
|
|
140
114
|
# 4. Check if Pods folder is under SCM
|
141
|
-
|
115
|
+
current_pathname = Pathname.new File.expand_path "."
|
116
|
+
pods_folder_path = Pathname.new(File.expand_path("../Pods", podfile_path)).relative_path_from current_pathname
|
142
117
|
`git ls-files #{pods_folder_path} --error-unmatch > /dev/null 2>&1`
|
143
118
|
return true unless $?.exitstatus == 0
|
144
119
|
|
@@ -150,7 +125,7 @@ module BranchIOCLI
|
|
150
125
|
end
|
151
126
|
|
152
127
|
def update_cartfile(options, project)
|
153
|
-
cartfile_path = cartfile_path
|
128
|
+
cartfile_path = config_helper.cartfile_path
|
154
129
|
return false if cartfile_path.nil?
|
155
130
|
|
156
131
|
# 1. Patch Cartfile. Return if no change (Branch already present).
|
@@ -158,7 +133,7 @@ module BranchIOCLI
|
|
158
133
|
|
159
134
|
# 2. carthage update
|
160
135
|
Dir.chdir(File.dirname(cartfile_path)) do
|
161
|
-
system "carthage update"
|
136
|
+
system "carthage update --platform ios"
|
162
137
|
end
|
163
138
|
|
164
139
|
# 3. Add Cartfile and Cartfile.resolved to commit (in case :commit param specified)
|
@@ -166,7 +141,7 @@ module BranchIOCLI
|
|
166
141
|
helper.add_change "#{cartfile_path}.resolved"
|
167
142
|
|
168
143
|
# 4. Add to target depependencies
|
169
|
-
frameworks_group = project
|
144
|
+
frameworks_group = project.frameworks_group
|
170
145
|
branch_framework = frameworks_group.new_file "Carthage/Build/iOS/Branch.framework"
|
171
146
|
target = helper.target_from_project project, options.target
|
172
147
|
target.frameworks_build_phase.add_file_reference branch_framework
|
@@ -182,11 +157,12 @@ module BranchIOCLI
|
|
182
157
|
end
|
183
158
|
|
184
159
|
# 6. Check if Carthage folder is under SCM
|
185
|
-
|
160
|
+
current_pathname = Pathname.new File.expand_path "."
|
161
|
+
carthage_folder_path = Pathname.new(File.expand_path("../Carthage", cartfile_path)).relative_path_from current_pathname
|
186
162
|
`git ls-files #{carthage_folder_path} --error-unmatch > /dev/null 2>&1`
|
187
163
|
return true unless $?.exitstatus == 0
|
188
164
|
|
189
|
-
# 7. If so, add the
|
165
|
+
# 7. If so, add the Carthage folder to the commit (in case :commit param specified)
|
190
166
|
helper.add_change carthage_folder_path
|
191
167
|
`git add #{carthage_folder_path}` if options.commit
|
192
168
|
|
@@ -1,23 +1,33 @@
|
|
1
|
+
require "json"
|
2
|
+
require "net/http"
|
3
|
+
require "pathname"
|
1
4
|
require "xcodeproj"
|
5
|
+
require "zip"
|
2
6
|
|
3
7
|
module BranchIOCLI
|
4
8
|
module Helper
|
5
9
|
class ConfigurationHelper
|
6
10
|
class << self
|
11
|
+
attr_accessor :xcodeproj_path
|
7
12
|
attr_accessor :xcodeproj
|
8
13
|
attr_accessor :keys
|
9
14
|
attr_accessor :all_domains
|
15
|
+
attr_accessor :podfile_path
|
16
|
+
attr_accessor :cartfile_path
|
10
17
|
|
11
18
|
def validate_setup_options(options)
|
12
|
-
options.
|
19
|
+
say "--force is ignored when --no_validate is used." if options.no_validate && options.force
|
20
|
+
|
21
|
+
validate_xcodeproj_path options
|
13
22
|
validate_keys_from_setup_options options
|
14
23
|
validate_all_domains options
|
15
|
-
options
|
24
|
+
validate_buildfile_path options, "Podfile"
|
25
|
+
validate_buildfile_path options, "Cartfile"
|
26
|
+
validate_sdk_addition options
|
16
27
|
end
|
17
28
|
|
18
29
|
def validate_validation_options(options)
|
19
|
-
|
20
|
-
options
|
30
|
+
validate_xcodeproj_path options
|
21
31
|
end
|
22
32
|
|
23
33
|
def validate_keys_from_setup_options(options)
|
@@ -50,14 +60,20 @@ module BranchIOCLI
|
|
50
60
|
# 1. Look for options.xcodeproj.
|
51
61
|
# 2. If not specified, look for projects under . (excluding anything in Pods or Carthage folder).
|
52
62
|
# 3. If none or more than one found, prompt the user.
|
53
|
-
def
|
63
|
+
def validate_xcodeproj_path(options)
|
54
64
|
if options.xcodeproj
|
55
65
|
path = options.xcodeproj
|
56
66
|
else
|
57
67
|
all_xcodeproj_paths = Dir[File.expand_path(File.join(".", "**/*.xcodeproj"))]
|
58
68
|
# find an xcodeproj (ignoring the Pods and Carthage folders)
|
59
69
|
# TODO: Improve this filter
|
60
|
-
xcodeproj_paths = all_xcodeproj_paths.
|
70
|
+
xcodeproj_paths = all_xcodeproj_paths.select do |p|
|
71
|
+
valid = true
|
72
|
+
Pathname.new(p).each_filename do |f|
|
73
|
+
valid = false && break if f == "Carthage" || f == "Pods"
|
74
|
+
end
|
75
|
+
valid
|
76
|
+
end
|
61
77
|
|
62
78
|
path = xcodeproj_paths.first if xcodeproj_paths.count == 1
|
63
79
|
end
|
@@ -67,9 +83,11 @@ module BranchIOCLI
|
|
67
83
|
# TODO: Allow the user to choose if xcodeproj_paths.count > 0
|
68
84
|
begin
|
69
85
|
@xcodeproj = Xcodeproj::Project.open path
|
70
|
-
|
86
|
+
@xcodeproj_path = path
|
87
|
+
return
|
71
88
|
rescue StandardError => e
|
72
89
|
say e.message
|
90
|
+
path = nil
|
73
91
|
end
|
74
92
|
end
|
75
93
|
end
|
@@ -96,6 +114,244 @@ module BranchIOCLI
|
|
96
114
|
end
|
97
115
|
domains
|
98
116
|
end
|
117
|
+
|
118
|
+
def validate_buildfile_path(options, filename)
|
119
|
+
# Disable Podfile/Cartfile update if --no_add_sdk is present
|
120
|
+
return if options.no_add_sdk
|
121
|
+
|
122
|
+
buildfile_path = filename == "Podfile" ? options.podfile : options.cartfile
|
123
|
+
|
124
|
+
# Was --podfile/--cartfile used?
|
125
|
+
if buildfile_path
|
126
|
+
# Yes: Validate. Prompt if not valid.
|
127
|
+
loop do
|
128
|
+
valid = buildfile_path =~ %r{/?#{filename}$}
|
129
|
+
say "#{filename} path must end in /#{filename}." unless valid
|
130
|
+
|
131
|
+
if valid
|
132
|
+
valid = File.exist? buildfile_path
|
133
|
+
say "#{buildfile_path} not found." unless valid
|
134
|
+
end
|
135
|
+
|
136
|
+
if valid
|
137
|
+
if filename == "Podfile"
|
138
|
+
@podfile_path = buildfile_path
|
139
|
+
else
|
140
|
+
@cartfile_path = buildfile_path
|
141
|
+
end
|
142
|
+
return
|
143
|
+
end
|
144
|
+
|
145
|
+
buildfile_path = ask "Please enter the path to your #{filename}: "
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# No: Check for Podfile/Cartfile next to @xcodeproj_path
|
150
|
+
buildfile_path = File.expand_path "../#{filename}", @xcodeproj_path
|
151
|
+
return unless File.exist? buildfile_path
|
152
|
+
|
153
|
+
# Exists: Use it (valid if found)
|
154
|
+
if filename == "Podfile"
|
155
|
+
@podfile_path = buildfile_path
|
156
|
+
else
|
157
|
+
@cartfile_path = buildfile_path
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def validate_sdk_addition(options)
|
162
|
+
return if options.no_add_sdk || @podfile_path || @cartfile_path
|
163
|
+
|
164
|
+
# If no CocoaPods or Carthage, check to see if the framework is linked.
|
165
|
+
target = BranchHelper.target_from_project @xcodeproj, options.target
|
166
|
+
return if target.frameworks_build_phase.files.map(&:file_ref).map(&:path).any? { |p| p =~ %r{/Branch.framework$} }
|
167
|
+
|
168
|
+
# --podfile, --cartfile not specified. No Podfile found. No Cartfile found. No Branch.framework in project.
|
169
|
+
# Prompt the user:
|
170
|
+
selected = choose do |menu|
|
171
|
+
menu.header = "No Podfile or Cartfile specified or found. Here are your options"
|
172
|
+
|
173
|
+
SDK_OPTIONS.each_key { |k| menu.choice k }
|
174
|
+
|
175
|
+
menu.prompt = "What would you like to do?"
|
176
|
+
end
|
177
|
+
|
178
|
+
option = SDK_OPTIONS[selected]
|
179
|
+
|
180
|
+
case option
|
181
|
+
when :skip
|
182
|
+
return
|
183
|
+
else
|
184
|
+
send "add_#{option}", options
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def add_cocoapods(options)
|
189
|
+
@podfile_path = File.expand_path "../Podfile", @xcodeproj_path
|
190
|
+
target = BranchHelper.target_from_project @xcodeproj, options.target
|
191
|
+
|
192
|
+
File.open(@podfile_path, "w") do |file|
|
193
|
+
file.write <<EOF
|
194
|
+
platform :ios, "#{target.deployment_target}"
|
195
|
+
|
196
|
+
pod "Branch"
|
197
|
+
|
198
|
+
#{@xcodeproj.targets.map { |t| "target \"#{t.name}\"" }.join("\n")}
|
199
|
+
EOF
|
200
|
+
end
|
201
|
+
|
202
|
+
command = "pod install"
|
203
|
+
command += " --repo-update" unless options.no_pod_repo_update
|
204
|
+
Dir.chdir(File.dirname(@podfile_path)) do
|
205
|
+
system command
|
206
|
+
end
|
207
|
+
|
208
|
+
BranchHelper.add_change @podfile_path
|
209
|
+
BranchHelper.add_change "#{@podfile_path}.lock"
|
210
|
+
|
211
|
+
# For now, add Pods folder to SCM.
|
212
|
+
current_pathname = Pathname.new File.expand_path "."
|
213
|
+
pods_folder_path = Pathname.new(File.expand_path("../Pods", podfile_path)).relative_path_from current_pathname
|
214
|
+
workspace_path = Pathname.new(File.expand_path(@xcodeproj_path.sub(/.xcodeproj$/, ".xcworkspace"))).relative_path_from current_pathname
|
215
|
+
podfile_pathname = Pathname.new(@podfile_path).relative_path_from current_pathname
|
216
|
+
BranchHelper.add_change pods_folder_path
|
217
|
+
BranchHelper.add_change workspace_path
|
218
|
+
`git add #{podfile_pathname} #{podfile_pathname}.lock #{pods_folder_path} #{workspace_path}` if options.commit
|
219
|
+
end
|
220
|
+
|
221
|
+
def add_carthage(options)
|
222
|
+
# TODO: Collapse this and Command::update_cartfile
|
223
|
+
|
224
|
+
# 1. Generate Cartfile
|
225
|
+
@cartfile_path = File.expand_path "../Cartfile", @xcodeproj_path
|
226
|
+
File.open(@cartfile_path, "w") do |file|
|
227
|
+
file.write <<EOF
|
228
|
+
github "BranchMetrics/ios-branch-deep-linking"
|
229
|
+
EOF
|
230
|
+
end
|
231
|
+
|
232
|
+
# 2. carthage update
|
233
|
+
Dir.chdir(File.dirname(@cartfile_path)) do
|
234
|
+
system "carthage update --platform ios"
|
235
|
+
end
|
236
|
+
|
237
|
+
# 3. Add Cartfile and Cartfile.resolved to commit (in case :commit param specified)
|
238
|
+
BranchHelper.add_change cartfile_path
|
239
|
+
BranchHelper.add_change "#{cartfile_path}.resolved"
|
240
|
+
|
241
|
+
# 4. Add to target depependencies
|
242
|
+
frameworks_group = @xcodeproj.frameworks_group
|
243
|
+
branch_framework = frameworks_group.new_file "Carthage/Build/iOS/Branch.framework"
|
244
|
+
target = BranchHelper.target_from_project @xcodeproj, options.target
|
245
|
+
target.frameworks_build_phase.add_file_reference branch_framework
|
246
|
+
|
247
|
+
# 5. Create a copy-frameworks build phase
|
248
|
+
carthage_build_phase = target.new_shell_script_build_phase "carthage copy-frameworks"
|
249
|
+
carthage_build_phase.shell_script = "/usr/local/bin/carthage copy-frameworks"
|
250
|
+
|
251
|
+
carthage_build_phase.input_paths << "$(SRCROOT)/Carthage/Build/iOS/Branch.framework"
|
252
|
+
carthage_build_phase.output_paths << "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Branch.framework"
|
253
|
+
|
254
|
+
@xcodeproj.save
|
255
|
+
|
256
|
+
# For now, add Carthage folder to SCM
|
257
|
+
|
258
|
+
# 6. Add the Carthage folder to the commit (in case :commit param specified)
|
259
|
+
current_pathname = Pathname.new File.expand_path "."
|
260
|
+
carthage_folder_path = Pathname.new(File.expand_path("../Carthage", cartfile_path)).relative_path_from(current_pathname)
|
261
|
+
cartfile_pathname = Pathname.new(@cartfile_path).relative_path_from current_pathname
|
262
|
+
BranchHelper.add_change carthage_folder_path
|
263
|
+
`git add #{cartfile_pathname} #{cartfile_pathname}.resolved #{carthage_folder_path}` if options.commit
|
264
|
+
end
|
265
|
+
|
266
|
+
def add_direct(options)
|
267
|
+
# TODO: Put these intermediates in a temp directory until Branch.framework is unzipped
|
268
|
+
# (and validated?). For now dumped in the current directory.
|
269
|
+
File.unlink "Branch.framework.zip" if File.exist? "Branch.framework.zip"
|
270
|
+
remove_directory "Branch.framework"
|
271
|
+
|
272
|
+
say "Finding current framework release..."
|
273
|
+
|
274
|
+
# Find the latest release from GitHub.
|
275
|
+
releases = JSON.parse fetch "https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/releases"
|
276
|
+
current_release = releases.first
|
277
|
+
# Get the download URL for the framework.
|
278
|
+
framework_asset = current_release["assets"][0]
|
279
|
+
framework_url = framework_asset["browser_download_url"]
|
280
|
+
|
281
|
+
say "Downloading Branch.framework v. #{current_release['tag_name']} (#{framework_asset['size']} bytes zipped)..."
|
282
|
+
|
283
|
+
# Download the framework zip
|
284
|
+
File.open("Branch.framework.zip", "w") do |file|
|
285
|
+
file.write fetch framework_url
|
286
|
+
end
|
287
|
+
|
288
|
+
say "Unzipping Branch.framework..."
|
289
|
+
|
290
|
+
# Unzip
|
291
|
+
Zip::File.open "Branch.framework.zip" do |zip_file|
|
292
|
+
# Start with just the framework and add dSYM, etc., later
|
293
|
+
zip_file.glob "Carthage/Build/iOS/Branch.framework/**/*" do |entry|
|
294
|
+
filename = entry.name.sub %r{^Carthage/Build/iOS/}, ""
|
295
|
+
ensure_directory File.dirname filename
|
296
|
+
entry.extract filename
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
# Remove intermediate zip file
|
301
|
+
File.unlink "Branch.framework.zip"
|
302
|
+
|
303
|
+
# Now the current framework is in ./Branch.framework
|
304
|
+
|
305
|
+
say "Adding to #{@xcodeproj_path}..."
|
306
|
+
|
307
|
+
# Add as a dependency in the Frameworks group
|
308
|
+
frameworks_group = @xcodeproj.frameworks_group
|
309
|
+
framework = frameworks_group.new_file "Branch.framework"
|
310
|
+
target = BranchHelper.target_from_project @xcodeproj, options.target
|
311
|
+
target.frameworks_build_phase.add_file_reference framework, true
|
312
|
+
@xcodeproj.save
|
313
|
+
|
314
|
+
BranchHelper.add_change File.expand_path "Branch.framework"
|
315
|
+
`git add Branch.framework` if options.commit
|
316
|
+
|
317
|
+
say "Done. ✅"
|
318
|
+
end
|
319
|
+
|
320
|
+
def fetch(url)
|
321
|
+
response = Net::HTTP.get_response URI(url)
|
322
|
+
|
323
|
+
case response
|
324
|
+
when Net::HTTPRedirection
|
325
|
+
fetch response['location']
|
326
|
+
else
|
327
|
+
response.body
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
def ensure_directory(path)
|
332
|
+
return if path == "/" || path == "."
|
333
|
+
parent = File.dirname path
|
334
|
+
ensure_directory parent
|
335
|
+
return if Dir.exist? path
|
336
|
+
Dir.mkdir path
|
337
|
+
end
|
338
|
+
|
339
|
+
def remove_directory(path)
|
340
|
+
return unless File.exist? path
|
341
|
+
|
342
|
+
Dir["#{path}/*"].each do |file|
|
343
|
+
remove_directory(file) and next if File.directory?(file)
|
344
|
+
File.unlink file
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
SDK_OPTIONS =
|
349
|
+
{
|
350
|
+
"Set this project up to use CocoaPods and add the Branch SDK." => :cocoapods,
|
351
|
+
"Set this project up to use Carthage and add the Branch SDK." => :carthage,
|
352
|
+
"Add Branch.framework directly to the project's dependencies." => :direct,
|
353
|
+
"Skip adding the framework to the project." => :skip
|
354
|
+
}
|
99
355
|
end
|
100
356
|
end
|
101
357
|
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.
|
4
|
+
version: 0.3.0
|
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-10-
|
12
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: commander
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rubyzip
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: xcodeproj
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +95,20 @@ dependencies:
|
|
81
95
|
- - ">="
|
82
96
|
- !ruby/object:Gem::Version
|
83
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: cocoapods
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
84
112
|
- !ruby/object:Gem::Dependency
|
85
113
|
name: pry
|
86
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,16 +183,16 @@ dependencies:
|
|
155
183
|
name: rubocop
|
156
184
|
requirement: !ruby/object:Gem::Requirement
|
157
185
|
requirements:
|
158
|
-
- - "
|
186
|
+
- - "~>"
|
159
187
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
188
|
+
version: 0.50.0
|
161
189
|
type: :development
|
162
190
|
prerelease: false
|
163
191
|
version_requirements: !ruby/object:Gem::Requirement
|
164
192
|
requirements:
|
165
|
-
- - "
|
193
|
+
- - "~>"
|
166
194
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
195
|
+
version: 0.50.0
|
168
196
|
- !ruby/object:Gem::Dependency
|
169
197
|
name: simplecov
|
170
198
|
requirement: !ruby/object:Gem::Requirement
|