fastlane-plugin-branch 0.1.0 → 0.2.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/LICENSE +1 -1
- data/README.md +24 -24
- data/lib/fastlane/plugin/branch/actions/setup_branch_action.rb +16 -8
- data/lib/fastlane/plugin/branch/actions/validate_universal_links_action.rb +5 -5
- data/lib/fastlane/plugin/branch/helper/ios_helper.rb +5 -2
- data/lib/fastlane/plugin/branch/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 119cbed9a2311d39484ec89b57f62f6553b2f2aa
|
4
|
+
data.tar.gz: 701c3ffb36e2150970c24a5b0dc4783400dc4b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79161c0e1e407b9a22f28f9e2bef83ec9b2657db32773b33cb9251d6124c951c79954ca9eb80a3d675cb110085c13fcbca454533379c826eb3c5d0eb31c5e303
|
7
|
+
data.tar.gz: 10f2ee0fc9814a9bb97ef51149a21b6df2c02eab09627ce10de3817e81719beab1c1a37cb2fb0f10f9443fc0688cd9a50b0a53abe2ef024efaa2369f8cd6b150
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2017
|
3
|
+
Copyright (c) 2017 Branch Metrics, Inc.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -56,22 +56,23 @@ setup_branch(
|
|
56
56
|
|
57
57
|
Available options:
|
58
58
|
|
59
|
-
|Fastfile key|Environment variable|
|
59
|
+
|Fastfile key|description|Environment variable|type|default value|
|
60
60
|
|---|---|---|---|---|
|
61
|
-
|:live_key|
|
62
|
-
|:test_key|
|
63
|
-
|:app_link_subdomain|
|
64
|
-
|:domains|
|
65
|
-
|:uri_scheme|
|
66
|
-
|:android_project_path|
|
67
|
-
|:android_manifest_path|
|
68
|
-
|:xcodeproj|
|
69
|
-
|:activity_name|
|
70
|
-
|:target|
|
71
|
-
|:update_bundle_and_team_ids|
|
72
|
-
|:remove_existing_domains|
|
73
|
-
|:
|
74
|
-
|:
|
61
|
+
|:live_key|The Branch live key to use (:live_key or :test_key is required)|BRANCH_LIVE_KEY|string||
|
62
|
+
|:test_key|The Branch test key to use (:live_key or :test_key is required)|BRANCH_TEST_KEY|string||
|
63
|
+
|:app_link_subdomain|An app.link subdomain to use (:app_link_subdomain or :domains is required. The union of the two sets of domains will be used.)|BRANCH_APP_LINK_SUBDOMAIN|string||
|
64
|
+
|:domains|A list of domains (custom domains or Branch domains) to use (:app_link_subdomain or :domains is required. The union of the two sets of domains will be used.)|BRANCH_DOMAINS|array of strings or comma-separated string||
|
65
|
+
|:uri_scheme|A URI scheme to add to the manifest (Android only)|BRANCH_URI_SCHEME|string||
|
66
|
+
|:android_project_path|Path to an Android project to use. Equivalent to 'android_manifest_path: "app/src/main/AndroidManifest.xml"`. Overridden by :android_manifest_path (:xcodeproj, :android_project_path or :android_manifest_path is required.)|BRANCH_ANDROID_PROJECT_PATH|string||
|
67
|
+
|:android_manifest_path|Path to an Android manifest to modify. Overrides :android_project_path. (:xcodeproj, :android_project_path or :android_manifest_path is required.)|BRANCH_ANDROID_MANIFEST_PATH|string||
|
68
|
+
|:xcodeproj|Path to a .xcodeproj directory to use. (:xcodeproj, :android_project_path or :android_manifest_path is required.)|BRANCH_XCODEPROJ|string||
|
69
|
+
|:activity_name|Name of the Activity to use (Android only; optional)|BRANCH_ACTIVITY_NAME|string||
|
70
|
+
|:target|Name of the target to use in the Xcode project (iOS only; optional)|BRANCH_TARGET|string||
|
71
|
+
|:update_bundle_and_team_ids|If true, changes the bundle and team identifiers in the Xcode project to match the AASA file. Mainly useful for sample apps. (iOS only)|BRANCH_UPDATE_BUNDLE_AND_TEAM_IDS|boolean|false|
|
72
|
+
|:remove_existing_domains|If true, any domains currently configured in the Xcode project or Android manifest will be removed before adding the domains specified by the arguments. Mainly useful for sample apps.|BRANCH_REMOVE_EXISTING_DOMAINS|boolean|false|
|
73
|
+
|:validate|Determines whether to validate the resulting Universal Link configuration before modifying the project|BRANCH_VALIDATE|boolean|true|
|
74
|
+
|:force|Update project(s) even if Universal Link validation fails|BRANCH_FORCE_UPDATE|boolean|false|
|
75
|
+
|:commit|Set to true to commit changes to Git; set to a string to commit with a custom message|boolean or string|BRANCH_COMMIT_CHANGES|false|
|
75
76
|
|
76
77
|
Individually, all parameters are optional, but the following conditions apply:
|
77
78
|
|
@@ -106,11 +107,11 @@ validate_universal_links(domains: %w{example.com www.example.com})
|
|
106
107
|
|
107
108
|
Available options:
|
108
109
|
|
109
|
-
|Fastfile key|Environment variable|
|
110
|
+
|Fastfile key|description|Environment variable|type|default value|
|
110
111
|
|---|---|---|---|---|
|
111
|
-
|:xcodeproj|
|
112
|
-
|:target|
|
113
|
-
|:domains|
|
112
|
+
|:xcodeproj|Path to a .xcodeproj directory to use|BRANCH_XCODEPROJ|string||
|
113
|
+
|:target|Name of the target to use in the Xcode project|BRANCH_TARGET|string||
|
114
|
+
|:domains|A list of domains (custom domains or Branch domains) that must be present in the project.|BRANCH_DOMAINS|array of strings or comma-separated string||
|
114
115
|
|
115
116
|
All parameters are optional. Without any parameters, the action looks for a single .xcodeproj
|
116
117
|
folder (with the exception of a Pods project) and reports an error if none or more than one is found.
|
@@ -128,11 +129,10 @@ This action does not use the Branchfile.
|
|
128
129
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. To try it:
|
129
130
|
|
130
131
|
```bash
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
bundle exec fastlane validate # Now validation will pass.
|
132
|
+
fastlane validate # The example project needs to be set up. This will fail.
|
133
|
+
fastlane update # Also validates the UL configuration.
|
134
|
+
fastlane update_and_commit # Also commit changes to Git. (git reset --hard HEAD^ to erase the last commit)
|
135
|
+
fastlane validate # Now validation will pass.
|
136
136
|
```
|
137
137
|
|
138
138
|
## Run tests for this plugin
|
@@ -33,9 +33,10 @@ module Fastlane
|
|
33
33
|
|
34
34
|
if params[:update_bundle_and_team_ids]
|
35
35
|
helper.update_team_and_bundle_ids_from_aasa_file xcodeproj, target, domains.first
|
36
|
-
elsif
|
36
|
+
elsif params[:validate] &&
|
37
|
+
helper.validate_team_and_bundle_ids_from_aasa_files(xcodeproj, target, domains, params[:remove_existing_domains])
|
37
38
|
UI.message "Universal Link configuration passed validation. ✅"
|
38
|
-
|
39
|
+
elsif params[:validate]
|
39
40
|
UI.error "Universal Link configuration failed validation."
|
40
41
|
helper.errors.each { |error| UI.error " #{error}" }
|
41
42
|
return unless params[:force]
|
@@ -99,12 +100,14 @@ module Fastlane
|
|
99
100
|
def self.example_code
|
100
101
|
[
|
101
102
|
<<-EOF
|
102
|
-
setup_branch
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
103
|
+
setup_branch(
|
104
|
+
live_key: "key_live_xxxx",
|
105
|
+
test_key: "key_test_yyyy",
|
106
|
+
app_link_subdomain: "myapp",
|
107
|
+
uri_scheme: "myscheme", # Android only
|
108
|
+
android_project_path: "MyAndroidApp", # MyAndroidApp/src/main/AndroidManifest.xml
|
109
|
+
xcodeproj: "MyIOSApp.xcodeproj"
|
110
|
+
)
|
108
111
|
EOF
|
109
112
|
]
|
110
113
|
end
|
@@ -173,6 +176,11 @@ module Fastlane
|
|
173
176
|
optional: true,
|
174
177
|
default_value: false,
|
175
178
|
is_string: false),
|
179
|
+
FastlaneCore::ConfigItem.new(key: :validate,
|
180
|
+
env_name: "BRANCH_VALIDATE",
|
181
|
+
description: "Determines whether to validate the resulting Universal Link configuration before modifying the project",
|
182
|
+
default_value: true,
|
183
|
+
is_string: false),
|
176
184
|
FastlaneCore::ConfigItem.new(key: :force,
|
177
185
|
env_name: "BRANCH_FORCE_UPDATE",
|
178
186
|
description: "Update project(s) even if Universal Link validation fails",
|
@@ -74,13 +74,13 @@ module Fastlane
|
|
74
74
|
validate_universal_links
|
75
75
|
EOF,
|
76
76
|
<<-EOF
|
77
|
-
validate_universal_links
|
77
|
+
validate_universal_links(xcodeproj: "MyProject.xcodeproj")
|
78
78
|
EOF,
|
79
79
|
<<-EOF
|
80
|
-
validate_universal_links
|
80
|
+
validate_universal_links(xcodeproj: "MyProject.xcodeproj", target: "MyProject")
|
81
81
|
EOF,
|
82
82
|
<<-EOF
|
83
|
-
validate_universal_links
|
83
|
+
validate_universal_links(domains: %w{example.com www.example.com})
|
84
84
|
EOF
|
85
85
|
]
|
86
86
|
end
|
@@ -89,12 +89,12 @@ module Fastlane
|
|
89
89
|
[
|
90
90
|
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
91
91
|
env_name: "BRANCH_XCODEPROJ",
|
92
|
-
description: "Path to an Xcode project to
|
92
|
+
description: "Path to an Xcode project to validate",
|
93
93
|
optional: true,
|
94
94
|
type: String),
|
95
95
|
FastlaneCore::ConfigItem.new(key: :target,
|
96
96
|
env_name: "BRANCH_TARGET",
|
97
|
-
description: "Name of the target in the Xcode project to
|
97
|
+
description: "Name of the target in the Xcode project to validate",
|
98
98
|
optional: true,
|
99
99
|
type: String),
|
100
100
|
FastlaneCore::ConfigItem.new(key: :domains,
|
@@ -173,7 +173,9 @@ module Fastlane
|
|
173
173
|
def contents_of_aasa_file(domain)
|
174
174
|
uris = [
|
175
175
|
URI("https://#{domain}/.well-known/apple-app-site-association"),
|
176
|
-
URI("https://#{domain}/apple-app-site-association")
|
176
|
+
URI("https://#{domain}/apple-app-site-association"),
|
177
|
+
URI("http://#{domain}/.well-known/apple-app-site-association"),
|
178
|
+
URI("http://#{domain}/apple-app-site-association")
|
177
179
|
]
|
178
180
|
|
179
181
|
data = nil
|
@@ -197,7 +199,7 @@ module Fastlane
|
|
197
199
|
end
|
198
200
|
|
199
201
|
content_type = response["Content-type"]
|
200
|
-
@errors << "[#{domain}] AASA Response does not contain a Content-type header" and
|
202
|
+
@errors << "[#{domain}] AASA Response does not contain a Content-type header" and next if content_type.nil?
|
201
203
|
|
202
204
|
case content_type
|
203
205
|
when %r{application/pkcs7-mime}
|
@@ -208,6 +210,7 @@ module Fastlane
|
|
208
210
|
signature.verify [http.peer_cert], cert_store, nil, OpenSSL::PKCS7::NOVERIFY
|
209
211
|
data = signature.data
|
210
212
|
else
|
213
|
+
@error << "[#{domain}] Unsigned AASA files must be served via HTTPS" and next if uri.scheme == "http"
|
211
214
|
data = response.body
|
212
215
|
end
|
213
216
|
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-branch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Branch
|
7
8
|
- Jimmy Dee
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
12
|
+
date: 2017-08-05 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: plist
|
@@ -123,7 +124,9 @@ dependencies:
|
|
123
124
|
- !ruby/object:Gem::Version
|
124
125
|
version: 2.26.1
|
125
126
|
description:
|
126
|
-
email:
|
127
|
+
email:
|
128
|
+
- integrations@branch.io
|
129
|
+
- jgvdthree@gmail.com
|
127
130
|
executables: []
|
128
131
|
extensions: []
|
129
132
|
extra_rdoc_files: []
|
@@ -162,5 +165,6 @@ rubygems_version: 2.6.12
|
|
162
165
|
signing_key:
|
163
166
|
specification_version: 4
|
164
167
|
summary: Adds Branch keys, custom URI schemes and domains to iOS and Android projects.
|
168
|
+
Validates the Universal Link configuration for any Xcode project.
|
165
169
|
test_files: []
|
166
170
|
has_rdoc:
|