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: 73bb4f75d2e6faefc284cb46dfc2d0ea5671c881aeeb5f38409369976f7c720b
4
- data.tar.gz: 382dcdc6fca5853716d67df2fbc48ab37b7db1d6bde304648650b60dd60c50e8
3
+ metadata.gz: 16d7f58e4027292d95f6a258d4ff3c3ac7b26b76c6cfc60c9406af289fa97fdc
4
+ data.tar.gz: 4027de193deef4a6293fef30bf505fe57412f82255dcc7d036b62c6de28d55d3
5
5
  SHA512:
6
- metadata.gz: 29dfc1de66eb7bf050568a85eb97076c1278b5e9470b65c518c64db9c75bbd0595f88d2e6f5e2d9528d7596fdaebc1695c2d77f84d0b5ab2f1597e12686f48e9
7
- data.tar.gz: a067ea4b728551715d3222e64eb9ef0aed0a649e7fff077f278425aa778d17b436597aa219826aa5612109a1307f6e3269ff01ba6dbee1349e3db8ca9a022897
6
+ metadata.gz: 19f6a97ecde33b1d933bf4ae0e4a0e7016214a04c0f52c9d5940cc0625a04637ad65b0fd87fdf1be848843e20b23bbb110135c41a33b99fb59a04ac07199c26e
7
+ data.tar.gz: 1972bfc4ba0b631a6551214620d5f94afff4e2d2871ee4229cc9024e60216ec57ce2475e316bc312f733cef12853a54fc4d1fa4b26d71cc39b0f5bf6586fd368
data/README.md CHANGED
@@ -162,7 +162,7 @@ annai_cleanup(force: true)
162
162
  The plugin reads `annspec.yaml` from your Flutter project root. Keys used by Fastlane actions:
163
163
 
164
164
  ```yaml
165
- annai_app:
165
+ app:
166
166
  android:
167
167
  default:
168
168
  signature:
@@ -1,3 +1,3 @@
1
1
  module AnnFlavorFlutter
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.13"
3
3
  end
@@ -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 # Check if file was loaded successfully
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('annai_app', platform_key)
92
+ platform_data = @spec_data.dig('app', platform_key)
88
93
  unless platform_data.is_a?(Hash)
89
- Fastlane::UI.verbose("Annai spec missing 'annai_app' or platform '#{platform_key}'.")
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('annai_app', platform_key, 'flavor')
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('annai_app', platform_key, 'default', 'credentials', 'google_play', 'api_key')
235
+ @spec_data.dig('app', platform_key, 'default', 'credentials', 'google_play', 'api_key')
231
236
  when :ios
232
- @spec_data.dig('annai_app', platform_key, 'default', 'credentials', 'app_store', 'api_key')
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('annai_app', platform_key, 'default', 'credentials', 'app_store', 'export_options_plist')
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('annai_app', platform_key, 'default', 'credentials', 'signing', 'team_id')
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 annai_app -> general -> firebase_token_file
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: annai_app -> general -> firebase_token_file
285
- rel_props_path = @spec_data.dig('annai_app', 'general', 'firebase_token_file')
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 annai_app -> general.")
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.11
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-26 00:00:00.000000000 Z
11
+ date: 2026-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane