ann-flavor-flutter 0.1.13 → 0.1.14
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/lib/ann_flavor_flutter/version.rb +1 -1
- data/lib/fastlane/plugin/ann_flavor_flutter/actions/ann_upload_to_firebase_action.rb +0 -6
- data/lib/fastlane/plugin/ann_flavor_flutter/helper/lanes_annai.rb +11 -11
- data/lib/fastlane/plugin/ann_flavor_flutter/helper/utils_spec_loader.rb +13 -37
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86afd16e35ee819fdc999f688a838a3aac99e1488df8b701926ee696c3a27d94
|
|
4
|
+
data.tar.gz: 509143d39a25e2923f04f303895ff90e57d6f1967a988ac356e19efcf4453955
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8480fc1f4ca939e98dcdda2e7a97115be71155fe858addcdcf1df62e85e1ba23fe372356361ad8e7ed47f62bde19ab65096dae78927fefde6952ca17a5f1e27b
|
|
7
|
+
data.tar.gz: cb8f39ac36485def3ce474e44bbc86e35588f938ee302679aa461a1eb5b3648c201608f2f5f9ce0837a9899d358a7799287afc843d5381bb9032eb0d1d794932
|
|
@@ -94,7 +94,6 @@ module Fastlane
|
|
|
94
94
|
skip_compile: params[:skip_compile],
|
|
95
95
|
skip_sound_null_safety: params[:skip_sound_null_safety],
|
|
96
96
|
firebase_project: params[:firebase_project],
|
|
97
|
-
firebase_token: params[:firebase_token] || ENV["FIREBASE_TOKEN"],
|
|
98
97
|
)
|
|
99
98
|
|
|
100
99
|
if success
|
|
@@ -151,11 +150,6 @@ module Fastlane
|
|
|
151
150
|
default_value: false),
|
|
152
151
|
|
|
153
152
|
# --- Web / Firebase Specific Parameters ---
|
|
154
|
-
FastlaneCore::ConfigItem.new(key: :firebase_token,
|
|
155
|
-
description: "Firebase CLI CI token for authentication (generated via 'firebase login:ci')",
|
|
156
|
-
optional: true,
|
|
157
|
-
env_name: "FIREBASE_TOKEN",
|
|
158
|
-
type: String),
|
|
159
153
|
FastlaneCore::ConfigItem.new(key: :firebase_project,
|
|
160
154
|
description: "The Firebase Project ID to deploy to. This value overrides the 'project_id' in the annai spec file",
|
|
161
155
|
optional: true,
|
|
@@ -162,7 +162,7 @@ module FastlaneFlutterFlavor
|
|
|
162
162
|
# New method to compile web build and deploy to Firebase Hosting
|
|
163
163
|
def upload_to_firebase(flavor: "", main_file: "lib/main.dart", build_config: "release",
|
|
164
164
|
skip_compile: false, skip_sound_null_safety: false,
|
|
165
|
-
firebase_project
|
|
165
|
+
firebase_project:)
|
|
166
166
|
|
|
167
167
|
begin
|
|
168
168
|
unless @isWeb
|
|
@@ -216,12 +216,14 @@ module FastlaneFlutterFlavor
|
|
|
216
216
|
# 5. Write the updated firebase.json back to disk
|
|
217
217
|
File.write(firebase_config_path, JSON.pretty_generate(config))
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
# Resolve service account for ADC auth — set GOOGLE_APPLICATION_CREDENTIALS if found
|
|
220
|
+
sa_path = @specLoader.get_service_account(@platform, flavor, build_config)
|
|
221
|
+
env_overrides = {}
|
|
222
|
+
if sa_path && File.exist?(sa_path)
|
|
223
|
+
env_overrides['GOOGLE_APPLICATION_CREDENTIALS'] = sa_path
|
|
224
|
+
Fastlane::UI.message("Using service account for Firebase auth: #{sa_path}")
|
|
225
|
+
elsif sa_path
|
|
226
|
+
Fastlane::UI.error("service_account file not found at: #{sa_path}")
|
|
225
227
|
end
|
|
226
228
|
|
|
227
229
|
# 6. Deploy to Firebase Hosting using the determined ID
|
|
@@ -230,17 +232,15 @@ module FastlaneFlutterFlavor
|
|
|
230
232
|
"--only", "hosting",
|
|
231
233
|
"--project", final_project_id,
|
|
232
234
|
]
|
|
233
|
-
# Only add the token flags if token is present
|
|
234
|
-
if !token.empty?
|
|
235
|
-
command_parts.push("--token", token)
|
|
236
|
-
end
|
|
237
235
|
|
|
238
236
|
firebase_root = @root_folder
|
|
239
237
|
|
|
240
238
|
Fastlane::UI.message("Executing Firebase deploy command: #{command_parts.join(' ')}")
|
|
241
239
|
|
|
242
240
|
Dir.chdir firebase_root do
|
|
241
|
+
env_overrides.each { |k, v| ENV[k] = v }
|
|
243
242
|
Fastlane::Actions::sh(*command_parts)
|
|
243
|
+
env_overrides.keys.each { |k| ENV.delete(k) }
|
|
244
244
|
end
|
|
245
245
|
|
|
246
246
|
@statusManager.logSuccess flavor, "upload_to_firebase", @platform
|
|
@@ -279,49 +279,25 @@ module FastlaneFlutterFlavor
|
|
|
279
279
|
config.dig('build_types', build_config, 'firebase', 'project_id') if config
|
|
280
280
|
end
|
|
281
281
|
|
|
282
|
-
#
|
|
283
|
-
#
|
|
284
|
-
# @return [String, nil]
|
|
285
|
-
def
|
|
282
|
+
# Returns the resolved service_account path for the given platform/flavor/build_config,
|
|
283
|
+
# cascading from flavor build_type → default build_type.
|
|
284
|
+
# @return [String, nil]
|
|
285
|
+
def get_service_account(platform, flavor_name, build_config)
|
|
286
286
|
return nil unless @spec_data
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
rel_props_path = @spec_data.dig('app', 'general', 'firebase_token_file')
|
|
288
|
+
platform_data = @spec_data.dig('app', platform)
|
|
289
|
+
return nil unless platform_data
|
|
291
290
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return nil
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
# 2. Resolve the full path relative to project root
|
|
298
|
-
full_props_path = File.expand_path(rel_props_path, @root_folder)
|
|
291
|
+
flavor_data = platform_data.dig('flavor', flavor_name) || {}
|
|
292
|
+
default_data = platform_data['default'] || {}
|
|
299
293
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return nil
|
|
303
|
-
end
|
|
294
|
+
flavor_bt_sa = flavor_data.dig('build_types', build_config, 'firebase', 'service_account')
|
|
295
|
+
default_bt_sa = default_data.dig('build_types', build_config, 'firebase', 'service_account')
|
|
304
296
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
File.foreach(full_props_path) do |line|
|
|
308
|
-
# Remove whitespace and skip comments/empty lines
|
|
309
|
-
line = line.strip
|
|
310
|
-
next if line.empty? || line.start_with?('#', '!')
|
|
311
|
-
|
|
312
|
-
# Match KEY=VALUE (handles both = and : as separators)
|
|
313
|
-
if line =~ /^\s*FIREBASE_TOKEN\s*[=:]\s*(.*)$/
|
|
314
|
-
token = $1.strip
|
|
315
|
-
# Remove optional surrounding quotes if present
|
|
316
|
-
return token.gsub(/^['"]|['"]$/, '')
|
|
317
|
-
end
|
|
318
|
-
end
|
|
319
|
-
rescue => e
|
|
320
|
-
Fastlane::UI.error("Error reading properties file at #{rel_props_path}: #{e.message}")
|
|
321
|
-
end
|
|
297
|
+
path = flavor_bt_sa || default_bt_sa
|
|
298
|
+
return nil if path.nil? || path.empty?
|
|
322
299
|
|
|
323
|
-
|
|
324
|
-
return nil
|
|
300
|
+
File.expand_path(path, @root_folder)
|
|
325
301
|
end
|
|
326
302
|
|
|
327
303
|
# For AdMob (annai_ads)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ann-flavor-flutter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ANN Solutions
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fastlane
|