fastlane-plugin-branch 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '08822a6026ae8a7f5a990080ddc64e537713d705'
4
- data.tar.gz: bd5ae339f360d756004bb6e746c46543c0ebf09a
3
+ metadata.gz: 67178b34c75cdf6f56ddcdbc87a9f359073a4211
4
+ data.tar.gz: b66e17dd55ab0ed2622bbaccaaa2cbc3bf1088a1
5
5
  SHA512:
6
- metadata.gz: 4768a177e965e307358b31fba008a73f1f3b136a81585039372982331521a23c75f9d89d799c68ce44f89bad375d3d822d2d34b8c944f34660d7f581ef231b4d
7
- data.tar.gz: 2bb0ba13f14c4121aec797867a7b1193cfc30a552bec22fd268ea1e0aba9dad5db35bef92b9c1a15d1bf0f20a15110f363dc96db63d3999c641ce1307ce03e14
6
+ metadata.gz: 3ca86d2e6c28bebdfd31923b8a8b8ffb3ebe238db18b81140879a859c5b12fe1d42815171c13af59f9bca104486b0f9b335ab0b54d7914c890fcd427a69381b6
7
+ data.tar.gz: 2e15566a9d67b1c22882e2f782b925d4100b5290cb13bdb7e62892e30497830ddaee5a4bd7d42c6855b52e4ea6c75d5595d7037478b97d4a877580284c0116f5
data/README.md CHANGED
@@ -166,17 +166,60 @@ the project must also match the value of this parameter without regard to order.
166
166
 
167
167
  This action does not use the Branchfile.
168
168
 
169
- ## Example
169
+ ## Examples
170
170
 
171
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. To try it:
171
+ There is an example [Fastfile](./fastlane/Fastfile) in this repo that defines a number of
172
+ example lanes. Be sure to run `bundle install` before trying any of the examples.
173
+
174
+ ### setup
175
+
176
+ This lane sets up the BranchPluginExample projects
177
+ in [examples/android/BranchPluginExample](./examples/android/BranchPluginExample) and
178
+ [examples/ios/BranchPluginExample](./examples/ios/BranchPluginExample).
179
+ The Xcode project uses CocoaPods and Swift.
180
+
181
+ ```bash
182
+ bundle exec fastlane setup
183
+ ```
184
+
185
+ ### setup_and_commit
186
+
187
+ This lane sets up the BranchPluginExample projects and also commits the results to git.
188
+
189
+ ```bash
190
+ bundle exec fastlane setup
191
+ ```
192
+
193
+ ### setup_objc
194
+
195
+ This lane sets up the BranchPluginExampleObjc project
196
+ in [examples/ios/BranchPluginExampleObjc](./examples/ios/BranchPluginExampleObjc).
197
+ The project uses CocoaPods and Objective-C.
172
198
 
173
199
  ```bash
174
- bundle exec fastlane validate # The example project needs to be set up. This will fail.
175
- bundle exec fastlane setup # Also validates the UL configuration.
176
- bundle exec fastlane setup_and_commit # Also commit changes to Git. (git reset --hard HEAD^ to erase the last commit)
177
- bundle exec fastlane validate # Now validation will pass.
200
+ bundle exec fastlane setup_objc
178
201
  ```
179
202
 
203
+ ### setup_carthage
204
+
205
+ This lane sets up the BranchPluginExampleCarthage project
206
+ in [examples/ios/BranchPluginExampleCarthage](./examples/ios/BranchPluginExampleCarthage).
207
+ The project uses Carthage and Swift.
208
+
209
+ ```bash
210
+ bundle exec fastlane setup_carthage
211
+ ```
212
+
213
+ ### validate
214
+
215
+ This lane validates the Universal Link configuration for the BranchPluginExample
216
+ project in [examples/ios/BranchPluginExample](./examples/ios/BranchPluginExample).
217
+
218
+ ```bash
219
+ bundle exec fastlane validate
220
+ ```
221
+
222
+
180
223
  ## Run tests for this plugin
181
224
 
182
225
  To run both the tests, and code style validation, run
@@ -289,7 +289,15 @@ module Fastlane
289
289
  target = helper.target_from_project project, params[:target]
290
290
  target.frameworks_build_phase.add_file_reference branch_framework
291
291
 
292
- # 5. TODO: Add to copy-frameworks build phase
292
+ # 5. Add to copy-frameworks build phase
293
+ carthage_build_phase = target.build_phases.find do |phase|
294
+ phase.respond_to?(:shell_script) && phase.shell_script =~ /carthage\s+copy-frameworks/
295
+ end
296
+
297
+ if carthage_build_phase
298
+ carthage_build_phase.input_paths << "$(SRCROOT)/Carthage/Build/iOS/Branch.framework"
299
+ carthage_build_phase.output_paths << "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Branch.framework"
300
+ end
293
301
 
294
302
  # 6. Check if Carthage folder is under SCM
295
303
  carthage_folder_path = File.expand_path "../Carthage", cartfile_path
@@ -94,17 +94,9 @@ module Fastlane
94
94
  UI.user_error! "#{podfile_path} not found"
95
95
  end
96
96
 
97
- xcodeproj_path = xcodeproj_path_from_params(params)
98
97
  # Look in the same directory as the project (typical setup)
99
- podfile_path = File.expand_path "../Podfile", xcodeproj_path
98
+ podfile_path = File.expand_path "../Podfile", params[:xcodeproj]
100
99
  return podfile_path if File.exist? podfile_path
101
-
102
- # Scan the repo. If one Podfile found, return it.
103
- repo_path = Bundler.root
104
-
105
- all_podfile_paths = Dir[File.expand_path(File.join(repo_path, '**/Podfile'))]
106
- return nil unless all_podfile_paths.count == 1
107
- all_podfile_paths.first
108
100
  end
109
101
 
110
102
  def cartfile_path_from_params(params)
@@ -119,17 +111,9 @@ module Fastlane
119
111
  UI.user_error! "#{cartfile_path} not found"
120
112
  end
121
113
 
122
- xcodeproj_path = xcodeproj_path_from_params(params)
123
114
  # Look in the same directory as the project (typical setup)
124
- cartfile_path = File.expand_path "../Cartfile", xcodeproj_path
115
+ cartfile_path = File.expand_path "../Cartfile", params[:xcodeproj]
125
116
  return cartfile_path if File.exist? cartfile_path
126
-
127
- # Scan the repo. If one Cartfile found, return it.
128
- repo_path = Bundler.root
129
-
130
- all_cartfile_paths = Dir[File.expand_path(File.join(repo_path, '**/Cartfile'))]
131
- return nil unless all_cartfile_paths.count == 1
132
- all_cartfile_paths.first
133
117
  end
134
118
 
135
119
  def add_sdk?(params)
@@ -358,6 +358,10 @@ module Fastlane
358
358
 
359
359
  # TODO: This is Swift 3. Support other versions, esp. 4.
360
360
  init_session_text = <<-EOF
361
+ #if DEBUG
362
+ Branch.setUseTestBranchKey(true)
363
+ #endif
364
+
361
365
  Branch.getInstance().initSession(launchOptions: launchOptions) {
362
366
  universalObject, linkProperties, error in
363
367
 
@@ -416,6 +420,10 @@ module Fastlane
416
420
  )
417
421
 
418
422
  init_session_text = <<-EOF
423
+ #ifdef DEBUG
424
+ [Branch setUseTestBranchKey:YES];
425
+ #endif // DEBUG
426
+
419
427
  [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
420
428
  andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
421
429
  // TODO: Route Branch links
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Branch
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Branch