ann-flavor-flutter 0.1.11 → 0.1.13
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16d7f58e4027292d95f6a258d4ff3c3ac7b26b76c6cfc60c9406af289fa97fdc
|
|
4
|
+
data.tar.gz: 4027de193deef4a6293fef30bf505fe57412f82255dcc7d036b62c6de28d55d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19f6a97ecde33b1d933bf4ae0e4a0e7016214a04c0f52c9d5940cc0625a04637ad65b0fd87fdf1be848843e20b23bbb110135c41a33b99fb59a04ac07199c26e
|
|
7
|
+
data.tar.gz: 1972bfc4ba0b631a6551214620d5f94afff4e2d2871ee4229cc9024e60216ec57ce2475e316bc312f733cef12853a54fc4d1fa4b26d71cc39b0f5bf6586fd368
|
data/README.md
CHANGED
|
@@ -71,6 +71,11 @@ module FastlaneFlutterFlavor
|
|
|
71
71
|
return current_data
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
def enabled?
|
|
75
|
+
return false unless @spec_data
|
|
76
|
+
@spec_data.fetch('enabled', true) != false
|
|
77
|
+
end
|
|
78
|
+
|
|
74
79
|
# Retrieves the configuration for a specific flavor, merged with the platform defaults.
|
|
75
80
|
# This function uses the spec data loaded into the instance variable @spec_data.
|
|
76
81
|
#
|
|
@@ -78,15 +83,15 @@ module FastlaneFlutterFlavor
|
|
|
78
83
|
# @param flavor_name [String] The name of the flavor (e.g., 'dev', 'staging').
|
|
79
84
|
# @return [Hash, nil] The fully merged configuration for the flavor, or nil if missing.
|
|
80
85
|
def get_merged_flavor_config(platform, flavor_name)
|
|
81
|
-
return nil unless @spec_data
|
|
86
|
+
return nil unless @spec_data && enabled?
|
|
82
87
|
|
|
83
88
|
platform_key = platform.to_s
|
|
84
89
|
flavor_key = flavor_name.to_s
|
|
85
90
|
|
|
86
91
|
# 1. Extract platform data from instance spec data
|
|
87
|
-
platform_data = @spec_data.dig('
|
|
92
|
+
platform_data = @spec_data.dig('app', platform_key)
|
|
88
93
|
unless platform_data.is_a?(Hash)
|
|
89
|
-
Fastlane::UI.verbose("Annai spec missing '
|
|
94
|
+
Fastlane::UI.verbose("Annai spec missing 'app' or platform '#{platform_key}'.")
|
|
90
95
|
return nil
|
|
91
96
|
end
|
|
92
97
|
|
|
@@ -120,11 +125,11 @@ module FastlaneFlutterFlavor
|
|
|
120
125
|
# @param platform [Symbol] The target platform (:ios or :android).
|
|
121
126
|
# @return [Hash] A hash where keys are flavor names (String) and values are their raw configs (Hash).
|
|
122
127
|
def get_platform_flavors(platform)
|
|
123
|
-
return {} unless @spec_data
|
|
128
|
+
return {} unless @spec_data && enabled?
|
|
124
129
|
platform_key = platform.to_s
|
|
125
130
|
|
|
126
131
|
# Use dig to safely retrieve the flavors hash from @spec_data
|
|
127
|
-
flavors = @spec_data.dig('
|
|
132
|
+
flavors = @spec_data.dig('app', platform_key, 'flavor')
|
|
128
133
|
|
|
129
134
|
# Return the flavors hash, or an empty hash if no flavors are defined
|
|
130
135
|
return flavors.is_a?(Hash) ? flavors : {}
|
|
@@ -227,9 +232,9 @@ module FastlaneFlutterFlavor
|
|
|
227
232
|
platform_key = platform.to_s
|
|
228
233
|
case platform
|
|
229
234
|
when :android
|
|
230
|
-
@spec_data.dig('
|
|
235
|
+
@spec_data.dig('app', platform_key, 'default', 'credentials', 'google_play', 'api_key')
|
|
231
236
|
when :ios
|
|
232
|
-
@spec_data.dig('
|
|
237
|
+
@spec_data.dig('app', platform_key, 'default', 'credentials', 'app_store', 'api_key')
|
|
233
238
|
else
|
|
234
239
|
nil
|
|
235
240
|
end
|
|
@@ -242,7 +247,7 @@ module FastlaneFlutterFlavor
|
|
|
242
247
|
platform_key = platform.to_s
|
|
243
248
|
case platform
|
|
244
249
|
when :ios
|
|
245
|
-
@spec_data.dig('
|
|
250
|
+
@spec_data.dig('app', platform_key, 'default', 'credentials', 'app_store', 'export_options_plist')
|
|
246
251
|
else
|
|
247
252
|
nil
|
|
248
253
|
end
|
|
@@ -260,7 +265,7 @@ module FastlaneFlutterFlavor
|
|
|
260
265
|
flavor_team_id = config&.dig('credentials', 'signing', 'team_id')
|
|
261
266
|
return flavor_team_id if flavor_team_id && !flavor_team_id.empty?
|
|
262
267
|
# Fall back to default credentials.signing.team_id
|
|
263
|
-
@spec_data.dig('
|
|
268
|
+
@spec_data.dig('app', platform_key, 'default', 'credentials', 'signing', 'team_id')
|
|
264
269
|
else
|
|
265
270
|
nil
|
|
266
271
|
end
|
|
@@ -275,17 +280,17 @@ module FastlaneFlutterFlavor
|
|
|
275
280
|
end
|
|
276
281
|
|
|
277
282
|
# Retrieves the firebase token from a external .properties file
|
|
278
|
-
# as defined in
|
|
283
|
+
# as defined in app -> general -> firebase_token_file
|
|
279
284
|
# @return [String, nil] The token value, or nil if not found/error.
|
|
280
285
|
def get_firebase_token_from_properties
|
|
281
286
|
return nil unless @spec_data
|
|
282
287
|
|
|
283
288
|
# 1. Get the properties file path from the YAML spec
|
|
284
|
-
# Path:
|
|
285
|
-
rel_props_path = @spec_data.dig('
|
|
289
|
+
# Path: app -> general -> firebase_token_file
|
|
290
|
+
rel_props_path = @spec_data.dig('app', 'general', 'firebase_token_file')
|
|
286
291
|
|
|
287
292
|
if rel_props_path.nil? || rel_props_path.empty?
|
|
288
|
-
Fastlane::UI.verbose("No 'firebase_token_file' defined in
|
|
293
|
+
Fastlane::UI.verbose("No 'firebase_token_file' defined in app -> general.")
|
|
289
294
|
return nil
|
|
290
295
|
end
|
|
291
296
|
|
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.13
|
|
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-06-
|
|
11
|
+
date: 2026-06-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fastlane
|