87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
# File 'lib/fastlane/plugin/managed_google_play/actions/create_app_on_managed_play_store.rb', line 87
def self.available_options
[
FastlaneCore::ConfigItem.new(
key: :json_key,
env_name: "SUPPLY_JSON_KEY", short_option: "-j",
conflicting_options: [:json_key_data],
optional: true, description: "The path to a file containing service account JSON, used to authenticate with Google",
code_gen_sensitive: true,
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file),
default_value_dynamic: true,
verify_block: proc do |value|
UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value))
UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
end
),
FastlaneCore::ConfigItem.new(
key: :json_key_data,
env_name: "SUPPLY_JSON_KEY_DATA", short_option: "-c",
conflicting_options: [:json_key],
optional: true,
description: "The raw service account JSON data used to authenticate with Google",
code_gen_sensitive: true,
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_data_raw),
default_value_dynamic: true,
verify_block: proc do |value|
begin
JSON.parse(value)
rescue JSON::ParserError
UI.user_error!("Could not parse service account json: JSON::ParseError")
end
end
),
FastlaneCore::ConfigItem.new(key: :developer_account_id,
short_option: "-k",
env_name: "PRODUCE_ITC_TEAM_ID", 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)",
optional: false,
is_string: false, code_gen_sensitive: true,
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:developer_account_id),
default_value_dynamic: true,
verify_block: proc do |value|
raise UI.error("No Developer Account ID given, pass using `developer_account_id: 123456789`") if value.to_s.empty?
end),
FastlaneCore::ConfigItem.new(
key: :apk,
env_name: "SUPPLY_APK", description: "Path to the APK file to upload",
short_option: "-b",
conflicting_options: [:apk_paths, :aab],
code_gen_sensitive: true,
default_value: Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-Release.apk")].last,
default_value_dynamic: true,
optional: true,
verify_block: proc do |value|
UI.user_error!("Could not find apk file at path '#{value}'") unless File.exist?(value)
UI.user_error!("apk file is not an apk") unless value.end_with?('.apk')
end
),
FastlaneCore::ConfigItem.new(key: :app_title,
env_name: "PRODUCE_APP_NAME", short_option: "-q",
description: "App Title",
optional: false,
verify_block: proc do |value|
raise UI.error("No App Title given, pass using `app_title: 'Title'`") if value.to_s.empty?
end),
FastlaneCore::ConfigItem.new(key: :language,
short_option: "-m",
env_name: "PRODUCE_LANGUAGE", description: "Default app language (e.g. 'en_US')",
default_value: "en_US",
optional: false,
verify_block: proc do |language|
unless AvailableLanguages.all_languages.include?(language)
UI.user_error!("Please enter one of available languages: #{AvailableLanguages.all_languages}")
end
end),
FastlaneCore::ConfigItem.new(key: :root_url,
env_name: "SUPPLY_ROOT_URL", description: "Root URL for the Google Play API. The provided URL will be used for API calls in place of https://www.googleapis.com/", optional: true,
verify_block: proc do |value|
UI.user_error!("Could not parse URL '#{value}'") unless value =~ URI.regexp
end),
FastlaneCore::ConfigItem.new(key: :timeout,
env_name: "SUPPLY_TIMEOUT", optional: true,
description: "Timeout for read, open, and send (in seconds)",
type: Integer,
default_value: 300)
]
end
|