ann-flavor-cocoapods 0.1.39 → 0.2.0

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: ae52557478525628b402c7b13b8adb941cc23ea40f8b3b35b92b463124d65604
4
- data.tar.gz: f2dc91944fce473c165b379b71c789eba4e8f7d606de693a9137ac23387b2107
3
+ metadata.gz: 68dcf959d5d5f927bc43085645168885f76ac29cff73dc973fa9d0d5a8809beb
4
+ data.tar.gz: 9d214c8beb19db807200490e5a66e4bc6b22b20539cc950abbf316bb059f3ca7
5
5
  SHA512:
6
- metadata.gz: a5cb40ac4c29185fd367bc703fb3e5e165dcc19e28592b9303637648e6f3b28a5dfed1846317a7811ac2952eb2269deb7f3c0af4a4da4d84ea15a0aeeda71702
7
- data.tar.gz: 6c32a064349c7eb9f49f984adb396ef96a7caa0e7832065c27811fba44d1b750f4737ab5674107a138194e0b7211dd667f1723358076d6097856e77cd30ca5fa
6
+ metadata.gz: dfd4c329b80c085c88607557aaa9027793f7a43c680751019608acdfb16d930a71ed9dc7d464a5ea7e2beb608af88148661ac3324083ea40aa8d370b0787b7dd
7
+ data.tar.gz: a0c24e164cc92f315382be34c593a6326151db80e33b69f473b7fbb3a3bb19431b6520e4357b7475ea39c0ec573d1a3b3b40ec6486c73fbf2eb872f967191748
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Added
6
+ - **Wires the new `entitlements:` schema field (see `ann_flutter_flavor`
7
+ 1.1.0) into the Xcode build.** When `ios/ann/Entitlements/<flavor>.entitlements`
8
+ exists on disk for a flavor, `configure_build_configuration` sets
9
+ `CODE_SIGN_ENTITLEMENTS` to it — the same find-or-create-by-name pattern
10
+ already used for `INFOPLIST_FILE`. `entitlements:` is opt-in (unlike
11
+ `info_plist`/the icon catalog, which every flavor always has): a flavor with
12
+ no generated entitlements file gets no `CODE_SIGN_ENTITLEMENTS` set at all,
13
+ and a stale value from a flavor's `entitlements:` being removed from
14
+ `annspec.yaml` is explicitly cleared on the next `pod install` rather than
15
+ left as a dangling, build-breaking reference to a file that no longer
16
+ exists. `CODE_SIGN_ENTITLEMENTS` is also added to `PROJECT_LEVEL_EXCLUDED_KEYS`
17
+ (same shadowing risk as `INFOPLIST_FILE`/`PRODUCT_BUNDLE_IDENTIFIER`).
18
+
3
19
  ## 0.1.39
4
20
 
5
21
  ### Fixed
@@ -179,9 +179,20 @@ module AnnFlavorCocoapods
179
179
 
180
180
  assert_icon_generated!(user_project, flavor_key, icon_name)
181
181
 
182
+ # Unlike the icon catalog and Info.plist, entitlements: is
183
+ # opt-in -- ios_generator.dart's _generateEntitlements skips
184
+ # creating ios/ann/Entitlements/ entirely when no annspec.yaml
185
+ # entitlements: block and no stock Runner.entitlements exist
186
+ # anywhere. Only set CODE_SIGN_ENTITLEMENTS when the file
187
+ # actually exists on disk; leaving it unset is correct (no
188
+ # entitlements to sign with), not an error condition.
189
+ entitlements_path = "ann/Entitlements/#{flavor_key}.entitlements"
190
+ entitlements_file = File.join(user_project.project_dir.to_s, 'ann', 'Entitlements', "#{flavor_key}.entitlements")
191
+ entitlements_path = nil unless File.exist?(entitlements_file)
192
+
182
193
  configure_build_configuration(
183
194
  target, user_project, xcode_config, xcconfig_path, info_plist_path,
184
- icon_name
195
+ icon_name, entitlements_path
185
196
  )
186
197
  end
187
198
 
@@ -584,9 +595,10 @@ module AnnFlavorCocoapods
584
595
  # `xcodebuild` time — excluding it here is what fixes that.
585
596
  PROJECT_LEVEL_EXCLUDED_KEYS = %w[
586
597
  PRODUCT_BUNDLE_IDENTIFIER INFOPLIST_FILE ASSETCATALOG_COMPILER_APPICON_NAME
598
+ CODE_SIGN_ENTITLEMENTS
587
599
  ].freeze
588
600
 
589
- def self.configure_build_configuration(target, user_project, xcode_config, xcconfig_path, info_plist_path, icon_name)
601
+ def self.configure_build_configuration(target, user_project, xcode_config, xcconfig_path, info_plist_path, icon_name, entitlements_path = nil)
590
602
  config_list = target.build_configuration_list
591
603
  config = config_list[xcode_config]
592
604
 
@@ -614,6 +626,19 @@ module AnnFlavorCocoapods
614
626
 
615
627
  config.build_settings['INFOPLIST_FILE'] = info_plist_path
616
628
  config.build_settings['ASSETCATALOG_COMPILER_APPICON_NAME'] = icon_name
629
+ # entitlements: is opt-in (unlike INFOPLIST_FILE/the icon catalog, which
630
+ # every flavor always has) -- only set CODE_SIGN_ENTITLEMENTS when the
631
+ # caller found a generated file on disk. Also explicitly clear a
632
+ # find-or-create'd EXISTING config's stale value when a flavor's
633
+ # entitlements: block was removed from annspec.yaml, rather than
634
+ # silently leaving Xcode signing with an entitlements file that no
635
+ # longer exists on disk (a build-breaking dangling reference, not
636
+ # merely a stale value like most other settings here).
637
+ if entitlements_path
638
+ config.build_settings['CODE_SIGN_ENTITLEMENTS'] = entitlements_path
639
+ else
640
+ config.build_settings.delete('CODE_SIGN_ENTITLEMENTS')
641
+ end
617
642
  # flutter create's own stock Debug/Release configs never set
618
643
  # MARKETING_VERSION at all (confirmed against a real project) --
619
644
  # CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)" is present on the
@@ -1,3 +1,3 @@
1
1
  module AnnFlavorCocoapods
2
- VERSION = "0.1.39"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -86,7 +86,7 @@ module AnnFlavorCore
86
86
 
87
87
  IosDefault = Struct.new(
88
88
  :id, :name, :version_name, :version_code, :main_file,
89
- :admob, :icon, :credentials, :firebase, :build_types, :custom, :dart_defines, :info_plist, :sdk,
89
+ :admob, :icon, :credentials, :firebase, :build_types, :custom, :dart_defines, :info_plist, :entitlements, :sdk,
90
90
  keyword_init: true
91
91
  ) do
92
92
  def self.defaults = new(build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
@@ -94,7 +94,7 @@ module AnnFlavorCore
94
94
 
95
95
  IosFlavor = Struct.new(
96
96
  :id, :id_suffix, :name, :name_suffix, :version_name, :version_code,
97
- :main_file, :admob, :icon, :firebase, :stores, :credentials, :build_types, :custom, :dart_defines, :info_plist,
97
+ :main_file, :admob, :icon, :firebase, :stores, :credentials, :build_types, :custom, :dart_defines, :info_plist, :entitlements,
98
98
  keyword_init: true
99
99
  ) do
100
100
  def self.defaults = new(id_suffix: '', name_suffix: '', build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
@@ -160,7 +160,7 @@ module AnnFlavorCore
160
160
  :id_suffix, :name_suffix,
161
161
  :firebase, :auth, :admob,
162
162
  :minify_enabled, :shrink_resources, :lint_check_release_builds,
163
- :ndk_version, :ndk_debug_symbol_level, :ndk_abi_filters, :custom, :dart_defines, :info_plist,
163
+ :ndk_version, :ndk_debug_symbol_level, :ndk_abi_filters, :custom, :dart_defines, :info_plist, :entitlements,
164
164
  keyword_init: true
165
165
  ) do
166
166
  def self.defaults = new(id_suffix: '', name_suffix: '', ndk_abi_filters: [], custom: {}, dart_defines: DartDefines.defaults)
@@ -213,6 +213,7 @@ module AnnFlavorCore
213
213
  :effective_custom,
214
214
  :effective_dart_defines,
215
215
  :effective_info_plist,
216
+ :effective_entitlements,
216
217
  keyword_init: true
217
218
  )
218
219
  end
@@ -163,6 +163,7 @@ module AnnFlavorCore
163
163
  custom: parse_custom_config(h(m, 'custom')),
164
164
  dart_defines: parse_dart_defines(h(m, 'dart_defines')),
165
165
  info_plist: m['info_plist'],
166
+ entitlements: m['entitlements'],
166
167
  sdk: (parse_ios_sdk(h(m, 'sdk')) unless h(m, 'sdk').empty?),
167
168
  )
168
169
  end
@@ -189,6 +190,7 @@ module AnnFlavorCore
189
190
  custom: parse_custom_config(h(m, 'custom')),
190
191
  dart_defines: parse_dart_defines(h(m, 'dart_defines')),
191
192
  info_plist: m['info_plist'],
193
+ entitlements: m['entitlements'],
192
194
  )
193
195
  end
194
196
 
@@ -321,6 +323,7 @@ module AnnFlavorCore
321
323
  custom: parse_custom_config(h(v, 'custom')),
322
324
  dart_defines: parse_dart_defines(h(v, 'dart_defines')),
323
325
  info_plist: v['info_plist'],
326
+ entitlements: v['entitlements'],
324
327
  )
325
328
  end
326
329
  end
@@ -119,6 +119,9 @@ module AnnFlavorCore
119
119
  # in the consuming plugin, not in the core).
120
120
  effective_info_plist: flavor.build_types[build_type]&.info_plist || flavor.info_plist ||
121
121
  defaults.build_types[build_type]&.info_plist || defaults.info_plist,
122
+ # Same whole-value most-specific-wins rule as effective_info_plist above.
123
+ effective_entitlements: flavor.build_types[build_type]&.entitlements || flavor.entitlements ||
124
+ defaults.build_types[build_type]&.entitlements || defaults.entitlements,
122
125
  )
123
126
  end
124
127
 
@@ -21,12 +21,13 @@ module AnnFlavorCore
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
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
+ # info_plist and entitlements are additionally a union (an inline Hash OR a
25
+ # plain file-path String), so even when their value IS a Hash, its keys are
26
+ # raw Info.plist/entitlement keys the user controls, never our own schema
27
+ # fields -- same free-form treatment as custom/dart_defines, and deliberately
28
+ # NOT in RECURSION_TARGETS since there is no single fixed struct type to
29
+ # recurse into.
30
+ FREE_FORM_FIELDS = %i[custom dart_defines info_plist entitlements].freeze
30
31
 
31
32
  # (containing_struct, field_name) => target_struct — only the "does this field
32
33
  # recurse, and into what" relationship; the valid-keys-within-that-struct question
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ann-flavor-cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.39
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ANN Solutions