ann-flavor-flutter 0.4.7 → 0.4.9

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: fd7cce396ef86ea1e15205e7440d3755a79707eeaa55126a84bce553d0785add
4
- data.tar.gz: 10d3037745026703bcd2ae17d93ea6467fb8fe3b6d0962f228b23f2d25e4e7cc
3
+ metadata.gz: 148c47a3d06aabc1cf846252061bb38bbb0cbd67e27048bd04cfdb9a059b399e
4
+ data.tar.gz: 39cf77d42b97848a64a19f5ebfb8c995df92b37132995f7c60b7bbcc7fbae3c0
5
5
  SHA512:
6
- metadata.gz: b3312b0e1231f50e7c99bb0ea43580245bd5bae4814dfd63d790e29fa41f9bc197f5492dcb3e0f9b120ac95e8cbbd4c27666874ed0abc18caf8b0183d0013a26
7
- data.tar.gz: 174e5a6e6a016a6772ad6d764056b4576e09279f03130a0e91e36e323d4f0bb3f9b6dc4db825d3405a3feeefc034bfe1f42c8dbf7b1cdd5217f0a13bc1eb8308
6
+ metadata.gz: 8cd05ae6c3b175a9fa68efa35ed3504a46667e7a85c9a36962e748d727fc0fb5d362e3fe0d2c8df2ab1ca59ca6e7c28f39f97f8390c8bcbf32d51f58bd6c5b41
7
+ data.tar.gz: 1322abdd31694ff5118a6c222604a75a1359ca98eb3724c316b59a680b561152886f513216c293e5f43755a16c09f10c936605de8a40f3ffc8a9e83f21e40495
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.9
4
+
5
+ ### Fixed
6
+ - `YamlSpecLoader#get_display_name`/`#get_version_name`/`#get_version_code`/`#get_gms_ads_id` were hardcoded to resolve against the `release` build type regardless of the caller's actual build — a sibling of the `#get_package_id` bug fixed under plan-030 Phase 6 / REQ-CDEL-00070, but not applied to these four getters at the time. `PodspecBridge` now threads its real `@build_type` through to all of them (matching `#bundle_id`), so a debug build correctly picks up any `build_types.debug`-level `name_suffix`/`version_name`/`version_code` override instead of silently resolving the release value.
7
+
8
+ ## 0.4.8
9
+
10
+ ### Added
11
+ - `info_plist` schema field added to the shared core (`ann-flavor-core-ruby`, vendored into this plugin) — a new iOS-only field for raw `Info.plist` overrides, valid at `default`/`flavor`/`build_type` levels, as either an inline map or a file-path reference. Core-only in this release — no Fastlane lane or helper reads this field yet. Included here purely because this plugin vendors the shared core and versions travel together.
12
+
3
13
  ## 0.4.7
4
14
 
5
15
  ### Fixed
@@ -1,3 +1,3 @@
1
1
  module AnnFlavorFlutter
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.9"
3
3
  end
@@ -114,7 +114,7 @@ module FastlaneFlutterFlavor
114
114
  end
115
115
 
116
116
  def display_name
117
- @loader.get_display_name(@platform, @flavor)
117
+ @loader.get_display_name(@platform, @flavor, @build_type)
118
118
  end
119
119
 
120
120
  def bundle_id
@@ -122,15 +122,15 @@ module FastlaneFlutterFlavor
122
122
  end
123
123
 
124
124
  def version_name
125
- @loader.get_version_name(@platform, @flavor)
125
+ @loader.get_version_name(@platform, @flavor, @build_type)
126
126
  end
127
127
 
128
128
  def version_code
129
- @loader.get_version_code(@platform, @flavor)
129
+ @loader.get_version_code(@platform, @flavor, @build_type)
130
130
  end
131
131
 
132
132
  def gms_ads_id
133
- @loader.get_gms_ads_id(@platform, @flavor)
133
+ @loader.get_gms_ads_id(@platform, @flavor, @build_type)
134
134
  end
135
135
 
136
136
  def team_id
@@ -179,21 +179,27 @@ module FastlaneFlutterFlavor
179
179
  resolved&.effective_id
180
180
  end
181
181
 
182
- # @return [String, nil] The merged app name.
183
- def get_display_name(platform, flavor_name)
184
- resolved = resolve(platform, flavor_name, 'release')
182
+ # @return [String, nil] The merged app name for the given build type. Was
183
+ # previously hardcoded to 'release' regardless of the caller's actual
184
+ # build a sibling of the get_package_id fix (plan-030 Phase 6 /
185
+ # REQ-CDEL-00070): PodspecBridge#display_name now threads its real
186
+ # @build_type through instead of relying on this default.
187
+ def get_display_name(platform, flavor_name, build_type = 'release')
188
+ resolved = resolve(platform, flavor_name, build_type)
185
189
  resolved&.effective_name
186
190
  end
187
191
 
188
- # @return [String, nil] The merged version name.
189
- def get_version_name(platform, flavor_name)
190
- resolved = resolve(platform, flavor_name, 'release')
192
+ # @return [String, nil] The merged version name for the given build type.
193
+ # Was previously hardcoded to 'release' — see get_display_name.
194
+ def get_version_name(platform, flavor_name, build_type = 'release')
195
+ resolved = resolve(platform, flavor_name, build_type)
191
196
  resolved&.effective_version_name
192
197
  end
193
198
 
194
- # @return [String, nil] The path to the version_code.
195
- def get_version_code(platform, flavor_name)
196
- resolved = resolve(platform, flavor_name, 'release')
199
+ # @return [String, nil] The version_code for the given build type. Was
200
+ # previously hardcoded to 'release' — see get_display_name.
201
+ def get_version_code(platform, flavor_name, build_type = 'release')
202
+ resolved = resolve(platform, flavor_name, build_type)
197
203
  return nil unless resolved
198
204
  resolved.effective_version_code.to_i.to_s
199
205
  end
@@ -295,8 +301,9 @@ module FastlaneFlutterFlavor
295
301
  resolved&.effective_name
296
302
  end
297
303
 
298
- def get_gms_ads_id(platform, flavor_name)
299
- resolved = resolve(platform, flavor_name, 'release')
304
+ # Was previously hardcoded to 'release' — see get_display_name.
305
+ def get_gms_ads_id(platform, flavor_name, build_type = 'release')
306
+ resolved = resolve(platform, flavor_name, build_type)
300
307
  resolved&.effective_gms_ads_id
301
308
  end
302
309
 
@@ -65,7 +65,7 @@ module AnnFlavorCore
65
65
 
66
66
  IosDefault = Struct.new(
67
67
  :id, :name, :version_name, :version_code, :main_file,
68
- :admob, :icon, :credentials, :firebase, :build_types, :custom, :dart_defines,
68
+ :admob, :icon, :credentials, :firebase, :build_types, :custom, :dart_defines, :info_plist,
69
69
  keyword_init: true
70
70
  ) do
71
71
  def self.defaults = new(build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
@@ -73,7 +73,7 @@ module AnnFlavorCore
73
73
 
74
74
  IosFlavor = Struct.new(
75
75
  :id, :id_suffix, :name, :name_suffix, :version_name, :version_code,
76
- :main_file, :admob, :icon, :firebase, :stores, :credentials, :build_types, :custom, :dart_defines,
76
+ :main_file, :admob, :icon, :firebase, :stores, :credentials, :build_types, :custom, :dart_defines, :info_plist,
77
77
  keyword_init: true
78
78
  ) do
79
79
  def self.defaults = new(id_suffix: '', name_suffix: '', build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
@@ -139,7 +139,7 @@ module AnnFlavorCore
139
139
  :id_suffix, :name_suffix,
140
140
  :firebase, :auth, :admob,
141
141
  :minify_enabled, :shrink_resources, :lint_check_release_builds,
142
- :ndk_version, :ndk_debug_symbol_level, :ndk_abi_filters, :custom, :dart_defines,
142
+ :ndk_version, :ndk_debug_symbol_level, :ndk_abi_filters, :custom, :dart_defines, :info_plist,
143
143
  keyword_init: true
144
144
  ) do
145
145
  def self.defaults = new(id_suffix: '', name_suffix: '', ndk_abi_filters: [], custom: {}, dart_defines: DartDefines.defaults)
@@ -191,6 +191,7 @@ module AnnFlavorCore
191
191
  :effective_cloudflare,
192
192
  :effective_custom,
193
193
  :effective_dart_defines,
194
+ :effective_info_plist,
194
195
  keyword_init: true
195
196
  )
196
197
  end
@@ -162,6 +162,7 @@ module AnnFlavorCore
162
162
  build_types: parse_build_type_configs(h(m, 'build_types')),
163
163
  custom: parse_custom_config(h(m, 'custom')),
164
164
  dart_defines: parse_dart_defines(h(m, 'dart_defines')),
165
+ info_plist: m['info_plist'],
165
166
  )
166
167
  end
167
168
 
@@ -182,6 +183,7 @@ module AnnFlavorCore
182
183
  build_types: parse_build_type_configs(h(m, 'build_types')),
183
184
  custom: parse_custom_config(h(m, 'custom')),
184
185
  dart_defines: parse_dart_defines(h(m, 'dart_defines')),
186
+ info_plist: m['info_plist'],
185
187
  )
186
188
  end
187
189
 
@@ -313,6 +315,7 @@ module AnnFlavorCore
313
315
  ndk_abi_filters: (v['ndkAbiFilters'].is_a?(Array) ? v['ndkAbiFilters'] : []),
314
316
  custom: parse_custom_config(h(v, 'custom')),
315
317
  dart_defines: parse_dart_defines(h(v, 'dart_defines')),
318
+ info_plist: v['info_plist'],
316
319
  )
317
320
  end
318
321
  end
@@ -111,6 +111,14 @@ module AnnFlavorCore
111
111
  effective_icon: flavor.icon || defaults.icon,
112
112
  effective_custom: resolve_custom(defaults.custom, defaults.build_types[build_type]&.custom, flavor.custom, flavor.build_types[build_type]&.custom),
113
113
  effective_dart_defines: resolve_dart_defines(defaults.dart_defines, defaults.build_types[build_type]&.dart_defines, flavor.dart_defines, flavor.build_types[build_type]&.dart_defines),
114
+ # Whole-value most-specific-wins — unlike firebase's per-field merge,
115
+ # info_plist's value (an arbitrary Hash, or a file-path String) has no
116
+ # fixed sub-fields to merge independently, so a more specific level's
117
+ # value replaces a less specific one entirely rather than being merged
118
+ # key-by-key here (per-key content merging across levels happens later,
119
+ # in the consuming plugin, not in the core).
120
+ effective_info_plist: flavor.build_types[build_type]&.info_plist || flavor.info_plist ||
121
+ defaults.build_types[build_type]&.info_plist || defaults.info_plist,
114
122
  )
115
123
  end
116
124
 
@@ -20,7 +20,13 @@ module AnnFlavorCore
20
20
  module StrictModeChecker
21
21
  # Fields whose value is a free-form Hash (arbitrary user-declared keys are data,
22
22
  # not schema) -- exempted from unknown-key checking entirely, at any level.
23
- FREE_FORM_FIELDS = %i[custom dart_defines].freeze
23
+ #
24
+ # info_plist is additionally a union (an inline Hash OR a plain file-path String),
25
+ # so even when its value IS a Hash, its keys are raw Info.plist keys the user
26
+ # controls, never our own schema fields -- same free-form treatment as
27
+ # custom/dart_defines, and deliberately NOT in RECURSION_TARGETS since there is
28
+ # no single fixed struct type to recurse into.
29
+ FREE_FORM_FIELDS = %i[custom dart_defines info_plist].freeze
24
30
 
25
31
  # (containing_struct, field_name) => target_struct — only the "does this field
26
32
  # recurse, and into what" relationship; the valid-keys-within-that-struct question
@@ -28,6 +34,7 @@ module AnnFlavorCore
28
34
  RECURSION_TARGETS = {
29
35
  [AnnSpec, :app] => AnnApp,
30
36
  [AnnSpec, :tooling] => ToolingConfig,
37
+ [AnnSpec, :debug_config] => DebugConfig, # via `debug:` YAML key
31
38
  [AnnApp, :android] => AndroidPlatform,
32
39
  [AnnApp, :ios] => IosPlatform,
33
40
  [AnnApp, :web] => WebPlatform,
@@ -93,6 +100,40 @@ module AnnFlavorCore
93
100
  # user-chosen name (flavor name, build-type name), not a single nested Hash.
94
101
  MAP_VALUED_FIELDS = %i[flavors build_types].freeze
95
102
 
103
+ # Deliberate Struct-member <-> YAML-key naming exceptions in the schema -- keys
104
+ # where the YAML key is NOT simply the snake_case member name, so a fixed,
105
+ # explicit override is required rather than a growing hand-maintained registry:
106
+ #
107
+ # - `flavors` (Struct member) reads YAML key `flavor` (singular).
108
+ # - Every other entry below is parsed from a literal camelCase YAML key by
109
+ # AnnFlavorCore::Parser (unlike the rest of the schema, which is
110
+ # snake_case) -- this list was derived by exhaustively scanning every
111
+ # string-literal map key the parser reads, not by manual inspection,
112
+ # after two rounds of under-scoped fixes (ndk_abi_filters, then
113
+ # client_id) missed entries this way. Matches the Dart core's
114
+ # hand-written registry and the Kotlin core's equivalent override map,
115
+ # both of which already have all of these correct.
116
+ FIELD_TO_YAML_KEY = {
117
+ flavors: 'flavor',
118
+ debug_config: 'debug',
119
+ client_id: 'clientId',
120
+ compile_sdk: 'compileSdk',
121
+ lint_check_release_builds: 'lintCheckReleaseBuilds',
122
+ min_sdk: 'minSdk',
123
+ minify_enabled: 'minifyEnabled',
124
+ ndk_abi_filters: 'ndkAbiFilters',
125
+ ndk_debug_symbol_level: 'ndkDebugSymbolLevel',
126
+ ndk_version: 'ndkVersion',
127
+ print_build_and_flavor_info: 'printBuildAndFlavorInfo',
128
+ print_debug: 'printDebug',
129
+ print_release_build_type_info: 'printReleaseBuildTypeInfo',
130
+ print_sdk_versions: 'printSdkVersions',
131
+ reversed_client_id: 'reversedClientId',
132
+ shrink_resources: 'shrinkResources',
133
+ target_sdk: 'targetSdk',
134
+ }.freeze
135
+ YAML_KEY_TO_FIELD = FIELD_TO_YAML_KEY.each_with_object({}) { |(f, y), h| h[y] = f }.freeze
136
+
96
137
  def self.check(raw, root_struct)
97
138
  issues = []
98
139
  walk(raw, root_struct, '', issues)
@@ -102,10 +143,7 @@ module AnnFlavorCore
102
143
  def self.walk(raw, struct_class, path, issues)
103
144
  return unless raw.is_a?(Hash)
104
145
 
105
- valid_keys = struct_class.members.map(&:to_s)
106
- # `flavors` (Struct member) reads YAML key `flavor` (singular) -- the one
107
- # deliberate field-name <-> YAML-key exception in the schema.
108
- valid_keys = valid_keys.map { |k| k == 'flavors' ? 'flavor' : k }
146
+ valid_keys = struct_class.members.map { |m| FIELD_TO_YAML_KEY[m] || m.to_s }
109
147
 
110
148
  raw.each do |raw_key, raw_value|
111
149
  key = raw_key.to_s
@@ -117,7 +155,7 @@ module AnnFlavorCore
117
155
  next
118
156
  end
119
157
 
120
- field_sym = (key == 'flavor' ? 'flavors' : key).to_sym
158
+ field_sym = YAML_KEY_TO_FIELD[key] || key.to_sym
121
159
  next if FREE_FORM_FIELDS.include?(field_sym)
122
160
 
123
161
  target_struct = RECURSION_TARGETS[[struct_class, field_sym]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ann-flavor-flutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - ANN Solutions