fastlane 2.107.0 → 2.108.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb1fe1c1267406cd31cae723a93fdf2064a11e30
4
- data.tar.gz: 03c108ea0933387c74bf32ce9f5c2649fa51b9f9
3
+ metadata.gz: fa3cbd3f3b511d812f34fc84b5e7ad24f186b795
4
+ data.tar.gz: ab695f0bb745784889acef0d2d7ff8e0bc4735f6
5
5
  SHA512:
6
- metadata.gz: 3c5ddd92c49db1e964d9a824a4eb666a0e2baa9c0dc4d6900439475bf41e6fd84de57a4b9e6c9e2130260e084f5d3ac49f8a35090add1ca0fa31d50121816c34
7
- data.tar.gz: 8da9bba98b68757c4ec8c1fcb6c2d6070c18968950cf082015969bf175eb96569cdb143ff52248023246acf57ea3ca42d07897f8721e432b8cbd17ea3459fef7
6
+ metadata.gz: bfcabd009bc7c69ab51b39feeb9060643abc9a50691bfcefbbf63dbc117493d309f5cc96eb80e92bb5825167c2715ed5bf85ca8d3e7073d70fd274c843e33da8
7
+ data.tar.gz: a1050f6120f8c496bed1e81d322da5f2e42c0811d697d92f4f143acf747bdf6975d78a889f96198796bbe8914c887e69a9fac330452a2bafc90b8c2914b21066
data/README.md CHANGED
@@ -39,87 +39,55 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
39
39
  </a>
40
40
  <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
41
41
  </td>
42
- <td id='olivier-halligon'>
43
- <a href='https://github.com/AliSoftware'>
44
- <img src='https://github.com/AliSoftware.png?size=140'>
45
- </a>
46
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
47
- </td>
48
- <td id='jérôme-lacoste'>
49
- <a href='https://github.com/lacostej'>
50
- <img src='https://github.com/lacostej.png?size=140'>
51
- </a>
52
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
53
- </td>
54
42
  <td id='jorge-revuelta-h'>
55
43
  <a href='https://github.com/minuscorp'>
56
44
  <img src='https://github.com/minuscorp.png?size=140'>
57
45
  </a>
58
46
  <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
59
47
  </td>
60
- <td id='manu-wallner'>
61
- <a href='https://github.com/milch'>
62
- <img src='https://github.com/milch.png?size=140'>
63
- </a>
64
- <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
65
- </td>
66
- </tr>
67
- <tr>
68
- <td id='josh-holtz'>
69
- <a href='https://github.com/joshdholtz'>
70
- <img src='https://github.com/joshdholtz.png?size=140'>
48
+ <td id='maksym-grebenets'>
49
+ <a href='https://github.com/mgrebenets'>
50
+ <img src='https://github.com/mgrebenets.png?size=140'>
71
51
  </a>
72
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
52
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
73
53
  </td>
74
- <td id='jan-piotrowski'>
75
- <a href='https://github.com/janpio'>
76
- <img src='https://github.com/janpio.png?size=140'>
54
+ <td id='danielle-tomlinson'>
55
+ <a href='https://github.com/DanToml'>
56
+ <img src='https://github.com/DanToml.png?size=140'>
77
57
  </a>
78
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
58
+ <h4 align='center'><a href='https://twitter.com/DanToml'>Danielle Tomlinson</a></h4>
79
59
  </td>
80
- <td id='aaron-brager'>
81
- <a href='https://github.com/getaaron'>
82
- <img src='https://github.com/getaaron.png?size=140'>
60
+ <td id='joshua-liebowitz'>
61
+ <a href='https://github.com/taquitos'>
62
+ <img src='https://github.com/taquitos.png?size=140'>
83
63
  </a>
84
- <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
64
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
85
65
  </td>
66
+ </tr>
67
+ <tr>
86
68
  <td id='matthew-ellis'>
87
69
  <a href='https://github.com/matthewellis'>
88
70
  <img src='https://github.com/matthewellis.png?size=140'>
89
71
  </a>
90
72
  <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
91
73
  </td>
92
- <td id='kohki-miki'>
93
- <a href='https://github.com/giginet'>
94
- <img src='https://github.com/giginet.png?size=140'>
95
- </a>
96
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
97
- </td>
98
- </tr>
99
- <tr>
100
- <td id='luka-mirosevic'>
101
- <a href='https://github.com/lmirosevic'>
102
- <img src='https://github.com/lmirosevic.png?size=140'>
103
- </a>
104
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
105
- </td>
106
- <td id='joshua-liebowitz'>
107
- <a href='https://github.com/taquitos'>
108
- <img src='https://github.com/taquitos.png?size=140'>
74
+ <td id='helmut-januschka'>
75
+ <a href='https://github.com/hjanuschka'>
76
+ <img src='https://github.com/hjanuschka.png?size=140'>
109
77
  </a>
110
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
78
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
111
79
  </td>
112
- <td id='stefan-natchev'>
113
- <a href='https://github.com/snatchev'>
114
- <img src='https://github.com/snatchev.png?size=140'>
80
+ <td id='josh-holtz'>
81
+ <a href='https://github.com/joshdholtz'>
82
+ <img src='https://github.com/joshdholtz.png?size=140'>
115
83
  </a>
116
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
84
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
117
85
  </td>
118
- <td id='maksym-grebenets'>
119
- <a href='https://github.com/mgrebenets'>
120
- <img src='https://github.com/mgrebenets.png?size=140'>
86
+ <td id='manu-wallner'>
87
+ <a href='https://github.com/milch'>
88
+ <img src='https://github.com/milch.png?size=140'>
121
89
  </a>
122
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
90
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
123
91
  </td>
124
92
  <td id='iulian-onofrei'>
125
93
  <a href='https://github.com/revolter'>
@@ -129,29 +97,61 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
129
97
  </td>
130
98
  </tr>
131
99
  <tr>
132
- <td id='danielle-tomlinson'>
133
- <a href='https://github.com/DanToml'>
134
- <img src='https://github.com/DanToml.png?size=140'>
100
+ <td id='jérôme-lacoste'>
101
+ <a href='https://github.com/lacostej'>
102
+ <img src='https://github.com/lacostej.png?size=140'>
135
103
  </a>
136
- <h4 align='center'><a href='https://twitter.com/DanToml'>Danielle Tomlinson</a></h4>
104
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
137
105
  </td>
138
- <td id='helmut-januschka'>
139
- <a href='https://github.com/hjanuschka'>
140
- <img src='https://github.com/hjanuschka.png?size=140'>
106
+ <td id='felix-krause'>
107
+ <a href='https://github.com/KrauseFx'>
108
+ <img src='https://github.com/KrauseFx.png?size=140'>
141
109
  </a>
142
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
110
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
111
+ </td>
112
+ <td id='aaron-brager'>
113
+ <a href='https://github.com/getaaron'>
114
+ <img src='https://github.com/getaaron.png?size=140'>
115
+ </a>
116
+ <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
117
+ </td>
118
+ <td id='luka-mirosevic'>
119
+ <a href='https://github.com/lmirosevic'>
120
+ <img src='https://github.com/lmirosevic.png?size=140'>
121
+ </a>
122
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
143
123
  </td>
144
124
  <td id='andrew-mcburney'>
145
- <a href='https://github.com/AndrewMcBurney'>
146
- <img src='https://github.com/AndrewMcBurney.png?size=140'>
125
+ <a href='https://github.com/armcburney'>
126
+ <img src='https://github.com/armcburney.png?size=140'>
147
127
  </a>
148
128
  <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
149
129
  </td>
150
- <td id='felix-krause'>
151
- <a href='https://github.com/KrauseFx'>
152
- <img src='https://github.com/KrauseFx.png?size=140'>
130
+ </tr>
131
+ <tr>
132
+ <td id='olivier-halligon'>
133
+ <a href='https://github.com/AliSoftware'>
134
+ <img src='https://github.com/AliSoftware.png?size=140'>
153
135
  </a>
154
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
136
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
137
+ </td>
138
+ <td id='stefan-natchev'>
139
+ <a href='https://github.com/snatchev'>
140
+ <img src='https://github.com/snatchev.png?size=140'>
141
+ </a>
142
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
143
+ </td>
144
+ <td id='kohki-miki'>
145
+ <a href='https://github.com/giginet'>
146
+ <img src='https://github.com/giginet.png?size=140'>
147
+ </a>
148
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
149
+ </td>
150
+ <td id='jan-piotrowski'>
151
+ <a href='https://github.com/janpio'>
152
+ <img src='https://github.com/janpio.png?size=140'>
153
+ </a>
154
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
155
155
  </td>
156
156
  <td id='jimmy-dee'>
157
157
  <a href='https://github.com/jdee'>
@@ -376,7 +376,7 @@ module Deliver
376
376
  optional: true),
377
377
  FastlaneCore::ConfigItem.new(key: :ignore_language_directory_validation,
378
378
  env_name: "DELIVER_IGNORE_LANGUAGE_DIRECTORY_VALIDATION",
379
- description: "Ignore errors when invalid languages are found in metadata and screeenshot directories",
379
+ description: "Ignore errors when invalid languages are found in metadata and screenshot directories",
380
380
  default_value: false,
381
381
  is_string: false),
382
382
  FastlaneCore::ConfigItem.new(key: :precheck_include_in_app_purchases,
@@ -0,0 +1,174 @@
1
+ require 'google/apis/playcustomapp_v1'
2
+ require 'supply'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class CreateAppOnManagedPlayStoreAction < Action
7
+ def self.run(params)
8
+ client = PlaycustomappClient.make_from_config(params: params)
9
+
10
+ FastlaneCore::PrintTable.print_values(
11
+ config: params,
12
+ mask_keys: [:json_key_data],
13
+ title: "Summary for create_app_on_managed_play_store"
14
+ )
15
+
16
+ client.create_app(
17
+ app_title: params[:app_title],
18
+ language_code: params[:language],
19
+ developer_account: params[:developer_account_id],
20
+ apk_path: params[:apk]
21
+ )
22
+ end
23
+
24
+ def self.description
25
+ "Create Managed Google Play Apps"
26
+ end
27
+
28
+ def self.authors
29
+ ["janpio"]
30
+ end
31
+
32
+ def self.return_value
33
+ # If your method provides a return value, you can describe here what it does
34
+ end
35
+
36
+ def self.details
37
+ "Create new apps on Managed Google Play."
38
+ end
39
+
40
+ def self.example_code
41
+ [
42
+ "create_app_on_managed_play_store(
43
+ json_key: 'path/to/you/json/key/file',
44
+ developer_account_id: 'developer_account_id', # obtained using the `get_managed_play_store_publishing_rights` action (or looking at the Play Console url)
45
+ app_title: 'Your app title',
46
+ language: 'en_US', # primary app language in BCP 47 format
47
+ apk: '/files/app-release.apk'
48
+ )"
49
+ ]
50
+ end
51
+
52
+ def self.available_options
53
+ [
54
+ # Authorization
55
+ FastlaneCore::ConfigItem.new(
56
+ key: :json_key,
57
+ env_name: "SUPPLY_JSON_KEY",
58
+ short_option: "-j",
59
+ conflicting_options: [:json_key_data],
60
+ optional: true, # optional until it is possible specify either json_key OR json_key_data are required
61
+ description: "The path to a file containing service account JSON, used to authenticate with Google",
62
+ code_gen_sensitive: true,
63
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file),
64
+ default_value_dynamic: true,
65
+ verify_block: proc do |value|
66
+ UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
67
+ UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value))
68
+ end
69
+ ),
70
+ FastlaneCore::ConfigItem.new(
71
+ key: :json_key_data,
72
+ env_name: "SUPPLY_JSON_KEY_DATA",
73
+ short_option: "-c",
74
+ conflicting_options: [:json_key],
75
+ optional: true,
76
+ description: "The raw service account JSON data used to authenticate with Google",
77
+ code_gen_sensitive: true,
78
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_data_raw),
79
+ default_value_dynamic: true,
80
+ verify_block: proc do |value|
81
+ begin
82
+ JSON.parse(value)
83
+ rescue JSON::ParserError
84
+ UI.user_error!("Could not parse service account json: JSON::ParseError")
85
+ end
86
+ end
87
+ ),
88
+ FastlaneCore::ConfigItem.new(key: :developer_account_id,
89
+ short_option: "-k",
90
+ env_name: "SUPPLY_DEVELOPER_ACCOUNT_ID",
91
+ description: "The ID of your Google Play Console account. Can be obtained from the URL when you log in (`https://play.google.com/apps/publish/?account=...` or when you 'Obtain private app publishing rights' (https://developers.google.com/android/work/play/custom-app-api/get-started#retrieve_the_developer_account_id)",
92
+ code_gen_sensitive: true,
93
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:developer_account_id),
94
+ default_value_dynamic: true),
95
+ # APK
96
+ FastlaneCore::ConfigItem.new(
97
+ key: :apk,
98
+ env_name: "SUPPLY_APK",
99
+ description: "Path to the APK file to upload",
100
+ short_option: "-b",
101
+ code_gen_sensitive: true,
102
+ default_value: Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-release.apk")].last,
103
+ default_value_dynamic: true,
104
+ verify_block: proc do |value|
105
+ UI.user_error!("No value found for 'apk'") if value.to_s.length == 0
106
+ UI.user_error!("Could not find apk file at path '#{value}'") unless File.exist?(value)
107
+ UI.user_error!("apk file is not an apk") unless value.end_with?('.apk')
108
+ end
109
+ ),
110
+ # Title
111
+ FastlaneCore::ConfigItem.new(key: :app_title,
112
+ env_name: "SUPPLY_APP_TITLE",
113
+ short_option: "-q",
114
+ description: "App Title"),
115
+ # Language
116
+ FastlaneCore::ConfigItem.new(key: :language,
117
+ short_option: "-m",
118
+ env_name: "SUPPLY_LANGUAGE",
119
+ description: "Default app language (e.g. 'en_US')",
120
+ default_value: "en_US",
121
+ verify_block: proc do |language|
122
+ unless Supply::Languages::ALL_LANGUAGES.include?(language)
123
+ UI.user_error!("Please enter one of the available languages: #{Supply::Languages::ALL_LANGUAGES}")
124
+ end
125
+ end),
126
+ # Google Play API
127
+ FastlaneCore::ConfigItem.new(key: :root_url,
128
+ env_name: "SUPPLY_ROOT_URL",
129
+ description: "Root URL for the Google Play API. The provided URL will be used for API calls in place of https://www.googleapis.com/",
130
+ optional: true,
131
+ verify_block: proc do |value|
132
+ UI.user_error!("Could not parse URL '#{value}'") unless value =~ URI.regexp
133
+ end),
134
+ FastlaneCore::ConfigItem.new(key: :timeout,
135
+ env_name: "SUPPLY_TIMEOUT",
136
+ optional: true,
137
+ description: "Timeout for read, open, and send (in seconds)",
138
+ type: Integer,
139
+ default_value: 300)
140
+ ]
141
+ end
142
+
143
+ def self.is_supported?(platform)
144
+ [:android].include?(platform)
145
+ end
146
+
147
+ def self.category
148
+ :misc
149
+ end
150
+ end
151
+ end
152
+ end
153
+
154
+ require 'supply/client'
155
+ class PlaycustomappClient < Supply::AbstractGoogleServiceClient
156
+ SERVICE = Google::Apis::PlaycustomappV1::PlaycustomappService
157
+ SCOPE = Google::Apis::PlaycustomappV1::AUTH_ANDROIDPUBLISHER
158
+
159
+ #####################################################
160
+ # @!group Create
161
+ #####################################################
162
+
163
+ def create_app(app_title: nil, language_code: nil, developer_account: nil, apk_path: nil)
164
+ custom_app = Google::Apis::PlaycustomappV1::CustomApp.new(title: app_title, language_code: language_code)
165
+
166
+ call_google_api do
167
+ client.create_account_custom_app(
168
+ developer_account,
169
+ custom_app,
170
+ upload_source: apk_path
171
+ )
172
+ end
173
+ end
174
+ end
@@ -3,7 +3,6 @@ module Fastlane
3
3
  module SharedValues
4
4
  DSYM_PATHS = :DSYM_PATHS
5
5
  end
6
-
7
6
  class DownloadDsymsAction < Action
8
7
  # rubocop:disable Metrics/PerceivedComplexity
9
8
  def self.run(params)
@@ -35,7 +34,7 @@ module Fastlane
35
34
 
36
35
  UI.user_error!("Could not find latest version for your app, please try setting a specific version") if latest_version.version.nil?
37
36
 
38
- version = latest_version.version
37
+ version = get_version(latest_version)
39
38
  build_number = latest_version.build_version
40
39
  end
41
40
 
@@ -98,6 +97,16 @@ module Fastlane
98
97
  Actions.lane_context[SharedValues::DSYM_PATHS] << File.expand_path(path)
99
98
  end
100
99
 
100
+ def self.get_version(latest_version)
101
+ candidate_build = latest_version.candidate_builds.first
102
+ if candidate_build.nil?
103
+ latest_version.version
104
+ else
105
+ candidate_build.train_version
106
+ end
107
+ end
108
+ private_class_method :get_version
109
+
101
110
  def self.write_dsym(data, bundle_id, train_number, build_number, output_directory)
102
111
  file_name = "#{bundle_id}-#{train_number}-#{build_number}.dSYM.zip"
103
112
  if output_directory
@@ -0,0 +1,120 @@
1
+ module Fastlane
2
+ module Actions
3
+ class GetManagedPlayStorePublishingRightsAction < Action
4
+ def self.run(params)
5
+ unless params[:json_key] || params[:json_key_data]
6
+ UI.important("To not be asked about this value, you can specify it using 'json_key'")
7
+ json_key_path = UI.input("The service account json file used to authenticate with Google: ")
8
+ json_key_path = File.expand_path(json_key_path)
9
+
10
+ UI.user_error!("Could not find service account json file at path '#{json_key_path}'") unless File.exist?(json_key_path)
11
+ params[:json_key] = json_key_path
12
+ end
13
+
14
+ FastlaneCore::PrintTable.print_values(
15
+ config: params,
16
+ mask_keys: [:json_key_data],
17
+ title: "Summary for get_managed_play_store_publishing_rights"
18
+ )
19
+
20
+ if (keyfile = params[:json_key])
21
+ json_key_data = File.open(keyfile, 'rb').read
22
+ else
23
+ json_key_data = params[:json_key_data]
24
+ end
25
+
26
+ # Login
27
+ credentials = JSON.parse(json_key_data)
28
+ callback_uri = 'https://fastlane.github.io/managed_google_play-callback/callback.html'
29
+ uri = "https://play.google.com/apps/publish/delegatePrivateApp?service_account=#{credentials['client_email']}&continueUrl=#{URI.escape(callback_uri)}"
30
+
31
+ UI.message("To obtain publishing rights for custom apps on Managed Play Store, open the following URL and log in:")
32
+ UI.message("")
33
+ UI.important(uri)
34
+ UI.message("([Cmd/Ctrl] + [Left click] lets you open this URL in many consoles/terminals/shells)")
35
+ UI.message("")
36
+ UI.message("After successful login you will be redirected to a page which outputs some information that is required for usage of the `create_app_on_managed_play_store` action.")
37
+
38
+ return uri
39
+ end
40
+
41
+ def self.description
42
+ "Obtain publishing rights for custom apps on Managed Google Play Store"
43
+ end
44
+
45
+ def self.authors
46
+ ["janpio"]
47
+ end
48
+
49
+ def self.return_value
50
+ "An URI to obtain publishing rights for custom apps on Managed Play Store"
51
+ end
52
+
53
+ def self.details
54
+ [
55
+ 'If you haven\'t done so before, start by following the first two steps of Googles ["Get started with custom app publishing"](https://developers.google.com/android/work/play/custom-app-api/get-started) -> ["Preliminary setup"](https://developers.google.com/android/work/play/custom-app-api/get-started#preliminary_setup) instructions:',
56
+ '"[Enable the Google Play Custom App Publishing API](https://developers.google.com/android/work/play/custom-app-api/get-started#enable_the_google_play_custom_app_publishing_api)" and "[Create a service account](https://developers.google.com/android/work/play/custom-app-api/get-started#create_a_service_account)".',
57
+ 'You need the "service account\'s private key file" to continue.',
58
+ 'Run the action and supply the "private key file" to it as the `json_key` parameter. The command will output a URL to visit. After logging in you are redirected to a page that outputs your "Developer Account ID" - take note of that, you will need it to be able to use [`create_app_on_managed_play_store`](https://docs.fastlane.tools/actions/create_app_on_managed_play_store/).'
59
+ ].join("\n")
60
+ end
61
+
62
+ def self.example_code
63
+ [
64
+ 'get_managed_play_store_publishing_rights(
65
+ json_key: "path/to/your/json/key/file"
66
+ )
67
+ # it is probably easier to execute this action directly in the command line:
68
+ # $ fastlane run get_managed_play_store_publishing_rights'
69
+ ]
70
+ end
71
+
72
+ def self.available_options
73
+ [
74
+ FastlaneCore::ConfigItem.new(
75
+ key: :json_key,
76
+ env_name: "SUPPLY_JSON_KEY",
77
+ short_option: "-j",
78
+ conflicting_options: [:json_key_data],
79
+ optional: true, # optional until it is possible specify either json_key OR json_key_data are required
80
+ description: "The path to a file containing service account JSON, used to authenticate with Google",
81
+ code_gen_sensitive: true,
82
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file),
83
+ default_value_dynamic: true,
84
+ verify_block: proc do |value|
85
+ UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
86
+ UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value))
87
+ end
88
+ ),
89
+ FastlaneCore::ConfigItem.new(
90
+ key: :json_key_data,
91
+ env_name: "SUPPLY_JSON_KEY_DATA",
92
+ short_option: "-c",
93
+ conflicting_options: [:json_key],
94
+ optional: true,
95
+ description: "The raw service account JSON data used to authenticate with Google",
96
+ code_gen_sensitive: true,
97
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_data_raw),
98
+ default_value_dynamic: true,
99
+ verify_block: proc do |value|
100
+ begin
101
+ JSON.parse(value)
102
+ rescue JSON::ParserError
103
+ UI.user_error!("Could not parse service account json: JSON::ParseError")
104
+ end
105
+ end
106
+ )
107
+
108
+ ]
109
+ end
110
+
111
+ def self.is_supported?(platform)
112
+ [:android].include?(platform)
113
+ end
114
+
115
+ def self.category
116
+ :misc
117
+ end
118
+ end
119
+ end
120
+ end