branch_io_cli 0.12.4 → 0.12.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/assets/completions/completion.bash +1 -1
- data/lib/branch_io_cli/command/report_command.rb +2 -1
- data/lib/branch_io_cli/configuration/configuration.rb +4 -4
- data/lib/branch_io_cli/configuration/report_options.rb +6 -0
- data/lib/branch_io_cli/configuration/setup_options.rb +3 -3
- data/lib/branch_io_cli/helper/methods.rb +2 -2
- data/lib/branch_io_cli/helper/report_helper.rb +35 -5
- data/lib/branch_io_cli/helper/tool_helper.rb +4 -2
- data/lib/branch_io_cli/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48e336c69b9c5ad8f7ab8de92720aa3b1c9cb7d5d207d21d5555dd91c3ca3e32
|
4
|
+
data.tar.gz: 180282031893b9e7b7277ceb3e2bc11143f803879ad094e3d5290e4bfca6df66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3187f68f3c2ed85eb3b57ae2cd21cb58d4f9d57b04062fa157ac8f9fce77724c7b0d37d82733f9d520ba72e34172311825fd2dcc7d24676d23b799c4aa21a214
|
7
|
+
data.tar.gz: db654aa13ac717e8294cbe0a66b6f199490642ec8a47180a8e6bfbf0bc8f9acc2ef113a791b2cf8986c63c602ac16861c2ec0da8df997a1d971fdb578fd2c373
|
data/README.md
CHANGED
@@ -16,6 +16,8 @@ This is a preliminary release of this gem. Please report any problems by opening
|
|
16
16
|
See also the [Branch Fastlane plugin](https://github.com/BranchMetrics/fastlane-plugin-branch), which offers
|
17
17
|
the same support via Fastlane.
|
18
18
|
|
19
|
+
![CLI in action](./assets/branch3.gif)
|
20
|
+
|
19
21
|
## Getting started
|
20
22
|
|
21
23
|
```bash
|
@@ -150,7 +152,7 @@ See https://github.com/BranchMetrics/branch_io_cli#setup-command for more inform
|
|
150
152
|
|--target MyAppTarget|Name of a target to modify in the Xcode project|BRANCH_TARGET|
|
151
153
|
|--podfile /path/to/Podfile|Path to the Podfile for the project|BRANCH_PODFILE|
|
152
154
|
|--cartfile /path/to/Cartfile|Path to the Cartfile for the project|BRANCH_CARTFILE|
|
153
|
-
|--carthage-command
|
155
|
+
|--carthage-command bootstrap --no-use-binaries|Command to run when installing from Carthage (default: update --platform ios)|BRANCH_CARTHAGE_COMMAND|
|
154
156
|
|--frameworks AdSupport,CoreSpotlight,SafariServices|Comma-separated list of system frameworks to add to the project|BRANCH_FRAMEWORKS|
|
155
157
|
|--[no-]pod-repo-update|Update the local podspec repo before installing (default: yes)|BRANCH_POD_REPO_UPDATE|
|
156
158
|
|--[no-]validate|Validate Universal Link configuration (default: yes)|BRANCH_VALIDATE|
|
@@ -283,6 +285,7 @@ building.
|
|
283
285
|
|-H, --[no-]header-only|Write a report header to standard output and exit (default: no)|BRANCH_HEADER_ONLY|
|
284
286
|
|--[no-]pod-repo-update|Update the local podspec repo before installing (default: yes)|BRANCH_POD_REPO_UPDATE|
|
285
287
|
|-o, --out ./report.txt|Report output path (default: ./report.txt)|BRANCH_REPORT_PATH|
|
288
|
+
|--[no-]confirm|Confirm before running certain commands (default: yes)|BRANCH_CONFIRM|
|
286
289
|
|
287
290
|
|
288
291
|
|
@@ -15,7 +15,7 @@ _branch_io_complete()
|
|
15
15
|
|
16
16
|
setup_opts="-L --live-key -T --test-key -D --domains --app-link-subdomain -U --uri-scheme -s --setting --test-configurations --xcodeproj --target --podfile --cartfile --carthage-command --frameworks --no-pod-repo-update --no-validate --force --no-add-sdk --no-patch-source --commit --no-confirm"
|
17
17
|
|
18
|
-
report_opts="--workspace --xcodeproj --scheme --target --configuration --sdk --podfile --cartfile --no-clean -H --header-only --no-pod-repo-update -o --out"
|
18
|
+
report_opts="--workspace --xcodeproj --scheme --target --configuration --sdk --podfile --cartfile --no-clean -H --header-only --no-pod-repo-update -o --out --no-confirm"
|
19
19
|
|
20
20
|
validate_opts="-D --domains --xcodeproj --target --configurations"
|
21
21
|
|
@@ -33,11 +33,12 @@ module BranchIOCLI
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def write_report(report)
|
36
|
-
report.write "Branch.io Xcode build report v #{VERSION} #{
|
36
|
+
report.write "Branch.io Xcode build report v #{VERSION} #{Time.now}\n\n"
|
37
37
|
report.write "#{config.report_configuration}\n"
|
38
38
|
report.write "#{report_helper.report_header}\n"
|
39
39
|
|
40
40
|
report_helper.pod_install_if_required report
|
41
|
+
report_helper.carthage_bootstrap_if_required report
|
41
42
|
|
42
43
|
# run xcodebuild -list
|
43
44
|
report.sh(*report_helper.base_xcodebuild_cmd, "-list")
|
@@ -213,9 +213,7 @@ EOF
|
|
213
213
|
end
|
214
214
|
|
215
215
|
# Validate. Prompt if not valid.
|
216
|
-
while !buildfile_path || !validate_buildfile_at_path(buildfile_path, filename)
|
217
|
-
buildfile_path = ask "Please enter the path to your #{filename}: "
|
218
|
-
end
|
216
|
+
buildfile_path = ask "Please enter the path to your #{filename}: " while !buildfile_path || !validate_buildfile_at_path(buildfile_path, filename)
|
219
217
|
|
220
218
|
@sdk_integration_mode = filename == "Podfile" ? :cocoapods : :carthage
|
221
219
|
end
|
@@ -470,7 +468,9 @@ EOF
|
|
470
468
|
new_value = ask "Please enter one or more of the above, separated by commas: " do |q|
|
471
469
|
q.readline = true
|
472
470
|
q.completion = valid_values
|
473
|
-
end
|
471
|
+
end
|
472
|
+
|
473
|
+
new_value = new_value.split(",") # comma-split with ask("...", Array) not working
|
474
474
|
elsif option.type.nil?
|
475
475
|
new_value = Helper::Util.confirm "#{option.label}? ", value
|
476
476
|
else
|
@@ -77,6 +77,12 @@ module BranchIOCLI
|
|
77
77
|
example: "./report.txt",
|
78
78
|
type: String,
|
79
79
|
env_name: "BRANCH_REPORT_PATH"
|
80
|
+
),
|
81
|
+
Option.new(
|
82
|
+
name: :confirm,
|
83
|
+
description: "Confirm before running certain commands",
|
84
|
+
default_value: true,
|
85
|
+
skip_confirmation: true
|
80
86
|
)
|
81
87
|
]
|
82
88
|
end
|
@@ -57,7 +57,7 @@ module BranchIOCLI
|
|
57
57
|
example: "config1,config2",
|
58
58
|
type: Array,
|
59
59
|
negatable: true,
|
60
|
-
valid_values_proc: ->
|
60
|
+
valid_values_proc: -> { Configuration.current.xcodeproj.build_configurations.map(&:name) }
|
61
61
|
),
|
62
62
|
Option.new(
|
63
63
|
name: :xcodeproj,
|
@@ -73,7 +73,7 @@ module BranchIOCLI
|
|
73
73
|
example: "MyAppTarget",
|
74
74
|
type: String,
|
75
75
|
confirm_symbol: :target_name,
|
76
|
-
valid_values_proc: ->
|
76
|
+
valid_values_proc: -> { Configuration.current.xcodeproj.targets.map(&:name) }
|
77
77
|
),
|
78
78
|
Option.new(
|
79
79
|
name: :podfile,
|
@@ -95,7 +95,7 @@ module BranchIOCLI
|
|
95
95
|
Option.new(
|
96
96
|
name: :carthage_command,
|
97
97
|
description: "Command to run when installing from Carthage",
|
98
|
-
example: "
|
98
|
+
example: "bootstrap --no-use-binaries",
|
99
99
|
type: String,
|
100
100
|
default_value: "update --platform ios"
|
101
101
|
),
|
@@ -217,12 +217,15 @@ module BranchIOCLI
|
|
217
217
|
def pod_install_if_required(report)
|
218
218
|
return unless config.pod_install_required?
|
219
219
|
# Only if a Podfile is detected/supplied at the command line.
|
220
|
+
|
220
221
|
say "pod install required in order to build."
|
221
|
-
|
222
|
+
if config.confirm
|
223
|
+
install = confirm 'Run "pod install" now?', true
|
222
224
|
|
223
|
-
|
224
|
-
|
225
|
-
|
225
|
+
unless install
|
226
|
+
say 'Please run "pod install" or "pod update" first in order to continue.'
|
227
|
+
exit(-1)
|
228
|
+
end
|
226
229
|
end
|
227
230
|
|
228
231
|
ToolHelper.verify_cocoapods
|
@@ -243,7 +246,34 @@ some cases. If that happens, please rerun without --no-pod-repo-update or run
|
|
243
246
|
if report.sh(install_command).success?
|
244
247
|
say "Done ✅"
|
245
248
|
else
|
246
|
-
say "
|
249
|
+
say "#{install_command.inspect} failed. See report for details."
|
250
|
+
exit(-1)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
def carthage_bootstrap_if_required(report)
|
255
|
+
return unless config.cartfile_path
|
256
|
+
return if Dir.exist?(File.join(File.dirname(config.cartfile_path), "Carthage", "Build", "iOS"))
|
257
|
+
|
258
|
+
say "carthage checkout required in order to build."
|
259
|
+
if config.confirm
|
260
|
+
install = confirm 'Run "carthage checkout && carthage build --platform ios" now?', true
|
261
|
+
|
262
|
+
unless install
|
263
|
+
say 'Please build your Carthage dependencies first in order to continue.'
|
264
|
+
exit(-1)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
ToolHelper.verify_carthage
|
269
|
+
|
270
|
+
install_command = "carthage checkout && carthage build --platform ios"
|
271
|
+
|
272
|
+
say "Running #{install_command.inspect}"
|
273
|
+
if report.sh(install_command).success?
|
274
|
+
say "Done ✅"
|
275
|
+
else
|
276
|
+
say "#{install_command.inspect} failed. See report for details."
|
247
277
|
exit(-1)
|
248
278
|
end
|
249
279
|
end
|
@@ -219,8 +219,10 @@ github "BranchMetrics/ios-branch-deep-linking"
|
|
219
219
|
# 1. Patch Cartfile. Return if no change (Branch already present).
|
220
220
|
return false unless PatchHelper.patch_cartfile cartfile_path
|
221
221
|
|
222
|
-
# 2. carthage
|
223
|
-
|
222
|
+
# 2. carthage bootstrap (or other command)
|
223
|
+
cmd = "carthage #{options.carthage_command}"
|
224
|
+
cmd << " ios-branch-deep-linking" if options.carthage_command =~ /^(update|build)/
|
225
|
+
sh cmd, chdir: File.dirname(config.cartfile_path)
|
224
226
|
|
225
227
|
# 3. Add Cartfile and Cartfile.resolved to commit (in case :commit param specified)
|
226
228
|
helper.add_change cartfile_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.12.
|
4
|
+
version: 0.12.5
|
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-12-
|
12
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: CFPropertyList
|
@@ -180,7 +180,7 @@ dependencies:
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
|
-
name:
|
183
|
+
name: rspec-simplecov
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
186
|
- - ">="
|
@@ -194,7 +194,7 @@ dependencies:
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
|
-
name:
|
197
|
+
name: rspec_junit_formatter
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
200
|
- - ">="
|
@@ -211,16 +211,16 @@ dependencies:
|
|
211
211
|
name: rubocop
|
212
212
|
requirement: !ruby/object:Gem::Requirement
|
213
213
|
requirements:
|
214
|
-
- -
|
214
|
+
- - '='
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: 0.
|
216
|
+
version: 0.52.0
|
217
217
|
type: :development
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
|
-
- -
|
221
|
+
- - '='
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: 0.
|
223
|
+
version: 0.52.0
|
224
224
|
- !ruby/object:Gem::Dependency
|
225
225
|
name: simplecov
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|