ann-flavor-cocoapods 0.4.0 → 0.4.2
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/CHANGELOG.md +41 -0
- data/lib/ann_flavor_cocoapods/podfile_helper.rb +46 -4
- data/lib/ann_flavor_cocoapods/version.rb +1 -1
- data/lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb +6 -6
- data/lib/vendor/ann_flavor_core/lib/ann_flavor_core/parser.rb +11 -0
- data/lib/vendor/ann_flavor_core/lib/ann_flavor_core/strict_mode_checker.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae5474a82cba4428fdfaf19c72bb2c7ac53b219bb50baf70ff246988947cb83f
|
|
4
|
+
data.tar.gz: 5c57f69715847b50fc8fa930f6c182cc074c37389c1f0184734a73c09ee2d5a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61bef50c9f7da4eada063a61ed60184de9790105eafee5c63c064e8c48419c96003d79ebdd77f3a70e0e32a75b160bd7c7b637d6c1cc5f6f70d6b2e0c85b6a69
|
|
7
|
+
data.tar.gz: 196fbefce09aff6c9055616a6a073a11c22687868e2aca9f0c9c1086d010849b032d40e3a3247e3d4281ca9d0543bd8ea1eb5bc1145bcf47a6f5bdf12fd9b6ef
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **0.4.1's fix for "Cycle inside Runner" was incomplete — the cycle could
|
|
7
|
+
still occur.** Declaring `input_paths` on `[CP] Check Pods Manifest.lock`'s
|
|
8
|
+
own output (0.4.1) correctly ordered `[ann-flavor] Merge Entitlements`/
|
|
9
|
+
`[ann-flavor] Merge Info.plist` after that one phase, but both were still
|
|
10
|
+
`unshift`ed to the very *front* of `build_phases`. Confirmed live (again,
|
|
11
|
+
against `ledger`) that the real cycle ran through a longer chain: these
|
|
12
|
+
phases' outputs feed `ProcessProductPackaging` (entitlements/Info.plist
|
|
13
|
+
signing), which is gated behind a chain of Xcode task producers that the
|
|
14
|
+
Firebase framework-copy phases are *also* gated behind — being first in
|
|
15
|
+
`build_phases` put both on the same shared gate from opposite directions,
|
|
16
|
+
a genuine cycle no single `input_paths` declaration could resolve.
|
|
17
|
+
`CODE_SIGN_ENTITLEMENTS`/`INFOPLIST_FILE` are only consumed at packaging/
|
|
18
|
+
signing time, which is late in the build — neither phase has any real
|
|
19
|
+
reason to run before `Sources`/`Frameworks`/`Resources`/`Embed Frameworks`
|
|
20
|
+
at all. Fixed by appending both phases at the **end** of `build_phases`
|
|
21
|
+
instead of unshifting them to the front (`input_paths` from 0.4.1 kept as
|
|
22
|
+
belt-and-suspenders). Also now unconditionally repositions the phase to
|
|
23
|
+
the end even when it already exists from a prior install — a project that
|
|
24
|
+
picked up the incomplete 0.4.1 fix needs this to actually move it on the
|
|
25
|
+
next `pod install`, not just leave it in place.
|
|
26
|
+
|
|
27
|
+
## 0.4.1
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- **`pod install`/Xcode build failed with "Cycle inside Runner; building
|
|
31
|
+
could produce unreliable results"** against a real project with real
|
|
32
|
+
CocoaPods frameworks (confirmed live: Firebase). The `[ann-flavor] Merge
|
|
33
|
+
Entitlements` and `[ann-flavor] Merge Info.plist` build phases (0.3.0/
|
|
34
|
+
0.4.0) declared `output_paths` but no `input_paths`, so nothing told
|
|
35
|
+
Xcode's new build system these phases must run after CocoaPods' own
|
|
36
|
+
`[CP] Check Pods Manifest.lock` phase — `build_phases.unshift` only
|
|
37
|
+
controls list order, which CocoaPods' own installer reorders after this
|
|
38
|
+
Podfile hook runs anyway. Fixed by declaring `input_paths =
|
|
39
|
+
['$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt']` on both
|
|
40
|
+
phases, matching Check Pods Manifest.lock's own declared output — Xcode
|
|
41
|
+
now has an explicit dependency to resolve the ordering, rather than a
|
|
42
|
+
cycle its scheduler was resolving incorrectly.
|
|
43
|
+
|
|
3
44
|
## 0.4.0
|
|
4
45
|
|
|
5
46
|
### Added
|
|
@@ -912,8 +912,22 @@ module AnnFlavorCocoapods
|
|
|
912
912
|
# output_paths) -- suppresses "input file not found" for INFOPLIST_FILE
|
|
913
913
|
# referencing a path nothing else produces until this phase runs.
|
|
914
914
|
phase.output_paths = ['$(DERIVED_FILE_DIR)/Info-merged.plist']
|
|
915
|
-
|
|
916
|
-
|
|
915
|
+
# Belt-and-suspenders alongside the append-at-end position fix below --
|
|
916
|
+
# explicitly orders this phase after CocoaPods' own "[CP] Check Pods
|
|
917
|
+
# Manifest.lock" phase regardless of list position.
|
|
918
|
+
phase.input_paths = ['$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt']
|
|
919
|
+
|
|
920
|
+
# Appended at the END of build_phases, not unshifted to the front --
|
|
921
|
+
# see the identical, fuller explanation on inject_merge_entitlements_phase
|
|
922
|
+
# below. This phase's output (INFOPLIST_FILE) is only consumed at
|
|
923
|
+
# packaging/signing time, which is late; it has no reason to race
|
|
924
|
+
# framework/resource-copy phases early in the build.
|
|
925
|
+
#
|
|
926
|
+
# Repositions unconditionally, even when `existing` -- see the identical
|
|
927
|
+
# note on inject_merge_entitlements_phase for why (a pre-v0.4.2 project
|
|
928
|
+
# would otherwise never actually get repositioned on re-`pod install`).
|
|
929
|
+
target.build_phases.delete(phase) if existing
|
|
930
|
+
target.build_phases.push(phase)
|
|
917
931
|
end
|
|
918
932
|
|
|
919
933
|
# Composes the final .entitlements file Xcode actually signs with, from
|
|
@@ -1002,8 +1016,36 @@ module AnnFlavorCocoapods
|
|
|
1002
1016
|
phase.shell_script = script
|
|
1003
1017
|
phase.show_env_vars_in_log = '0'
|
|
1004
1018
|
phase.output_paths = ['$(DERIVED_FILE_DIR)/Entitlements-merged.entitlements']
|
|
1005
|
-
|
|
1006
|
-
|
|
1019
|
+
# Belt-and-suspenders alongside the append-at-end position fix below --
|
|
1020
|
+
# explicitly orders this phase after CocoaPods' own "[CP] Check Pods
|
|
1021
|
+
# Manifest.lock" phase regardless of list position.
|
|
1022
|
+
phase.input_paths = ['$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt']
|
|
1023
|
+
|
|
1024
|
+
# Appended at the END of build_phases, not unshifted to the front.
|
|
1025
|
+
# v0.4.1 tried fixing this phase's real "Cycle inside Runner" Xcode
|
|
1026
|
+
# build failure (confirmed live against ledger, a project with real
|
|
1027
|
+
# CocoaPods frameworks like Firebase) purely by declaring input_paths
|
|
1028
|
+
# above -- that alone was NOT sufficient. The actual cycle: this
|
|
1029
|
+
# phase's output feeds ProcessProductPackaging (entitlements signing,
|
|
1030
|
+
# gated behind a chain of task producers Xcode's new build system
|
|
1031
|
+
# shares with the Firebase framework-copy phases), and unshifting this
|
|
1032
|
+
# phase to the very FRONT of build_phases put it, and its declared
|
|
1033
|
+
# output dependency, on the same task-producer chain the framework
|
|
1034
|
+
# copy phases are gated behind on the other side -- a genuine cycle
|
|
1035
|
+
# through shared gates, not resolvable by declaring one more input.
|
|
1036
|
+
# CODE_SIGN_ENTITLEMENTS/INFOPLIST_FILE are only consumed at
|
|
1037
|
+
# packaging/signing time, which is late in the build -- this phase has
|
|
1038
|
+
# no real reason to run before Sources/Frameworks/Resources/Embed
|
|
1039
|
+
# Frameworks at all. Appending it at the end removes it from that
|
|
1040
|
+
# shared gate entirely.
|
|
1041
|
+
#
|
|
1042
|
+
# Repositions unconditionally, even when `existing` (a project that
|
|
1043
|
+
# already has this phase from a pre-v0.4.2 install, sitting at the
|
|
1044
|
+
# front from the old unshift) -- otherwise re-running `pod install`
|
|
1045
|
+
# after upgrading the gem would never actually move it, and the real
|
|
1046
|
+
# bug would persist for every already-affected consumer.
|
|
1047
|
+
target.build_phases.delete(phase) if existing
|
|
1048
|
+
target.build_phases.push(phase)
|
|
1007
1049
|
end
|
|
1008
1050
|
|
|
1009
1051
|
# Removes a previously-injected Merge Entitlements phase when no flavor
|
|
@@ -86,18 +86,18 @@ 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, :entitlements, :sdk,
|
|
89
|
+
:admob, :icon, :credentials, :firebase, :build_types, :custom, :dart_defines, :env, :info_plist, :entitlements, :sdk,
|
|
90
90
|
keyword_init: true
|
|
91
91
|
) do
|
|
92
|
-
def self.defaults = new(build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
|
|
92
|
+
def self.defaults = new(build_types: {}, custom: {}, dart_defines: DartDefines.defaults, env: {})
|
|
93
93
|
end
|
|
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, :entitlements,
|
|
97
|
+
:main_file, :admob, :icon, :firebase, :stores, :credentials, :build_types, :custom, :dart_defines, :env, :info_plist, :entitlements,
|
|
98
98
|
keyword_init: true
|
|
99
99
|
) do
|
|
100
|
-
def self.defaults = new(id_suffix: '', name_suffix: '', build_types: {}, custom: {}, dart_defines: DartDefines.defaults)
|
|
100
|
+
def self.defaults = new(id_suffix: '', name_suffix: '', build_types: {}, custom: {}, dart_defines: DartDefines.defaults, env: {})
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
IosCredentials = Struct.new(:signing, :app_store, keyword_init: true)
|
|
@@ -160,10 +160,10 @@ 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, :entitlements,
|
|
163
|
+
:ndk_version, :ndk_debug_symbol_level, :ndk_abi_filters, :custom, :dart_defines, :env, :info_plist, :entitlements,
|
|
164
164
|
keyword_init: true
|
|
165
165
|
) do
|
|
166
|
-
def self.defaults = new(id_suffix: '', name_suffix: '', ndk_abi_filters: [], custom: {}, dart_defines: DartDefines.defaults)
|
|
166
|
+
def self.defaults = new(id_suffix: '', name_suffix: '', ndk_abi_filters: [], custom: {}, dart_defines: DartDefines.defaults, env: {})
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
FirebaseConfig = Struct.new(:project_id, :config_file, :service_account, :target, keyword_init: true)
|
|
@@ -43,6 +43,14 @@ module AnnFlavorCore
|
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
# `env:` — a flat string key-value map, cascading the same as `custom`/
|
|
47
|
+
# `dart_defines` but with no nested groups: generic native build-setting
|
|
48
|
+
# overrides (e.g. iOS xcconfig), not the Dart-only `custom` mechanism.
|
|
49
|
+
def self.parse_env(m)
|
|
50
|
+
return {} unless m.is_a?(Hash)
|
|
51
|
+
m.transform_values { |v| v.nil? ? '' : v.to_s }
|
|
52
|
+
end
|
|
53
|
+
|
|
46
54
|
def self.normalize_custom_value(v)
|
|
47
55
|
return v.map { |e| e.nil? ? '' : e.to_s } if v.is_a?(Array)
|
|
48
56
|
v
|
|
@@ -162,6 +170,7 @@ module AnnFlavorCore
|
|
|
162
170
|
build_types: parse_build_type_configs(h(m, 'build_types')),
|
|
163
171
|
custom: parse_custom_config(h(m, 'custom')),
|
|
164
172
|
dart_defines: parse_dart_defines(h(m, 'dart_defines')),
|
|
173
|
+
env: parse_env(h(m, 'env')),
|
|
165
174
|
info_plist: m['info_plist'],
|
|
166
175
|
entitlements: m['entitlements'],
|
|
167
176
|
sdk: (parse_ios_sdk(h(m, 'sdk')) unless h(m, 'sdk').empty?),
|
|
@@ -189,6 +198,7 @@ module AnnFlavorCore
|
|
|
189
198
|
build_types: parse_build_type_configs(h(m, 'build_types')),
|
|
190
199
|
custom: parse_custom_config(h(m, 'custom')),
|
|
191
200
|
dart_defines: parse_dart_defines(h(m, 'dart_defines')),
|
|
201
|
+
env: parse_env(h(m, 'env')),
|
|
192
202
|
info_plist: m['info_plist'],
|
|
193
203
|
entitlements: m['entitlements'],
|
|
194
204
|
)
|
|
@@ -322,6 +332,7 @@ module AnnFlavorCore
|
|
|
322
332
|
ndk_abi_filters: (v['ndkAbiFilters'].is_a?(Array) ? v['ndkAbiFilters'] : []),
|
|
323
333
|
custom: parse_custom_config(h(v, 'custom')),
|
|
324
334
|
dart_defines: parse_dart_defines(h(v, 'dart_defines')),
|
|
335
|
+
env: parse_env(h(v, 'env')),
|
|
325
336
|
info_plist: v['info_plist'],
|
|
326
337
|
entitlements: v['entitlements'],
|
|
327
338
|
)
|
|
@@ -27,7 +27,10 @@ module AnnFlavorCore
|
|
|
27
27
|
# fields -- same free-form treatment as custom/dart_defines, and deliberately
|
|
28
28
|
# NOT in RECURSION_TARGETS since there is no single fixed struct type to
|
|
29
29
|
# recurse into.
|
|
30
|
-
|
|
30
|
+
#
|
|
31
|
+
# env is a flat string Hash of arbitrary, user-declared native
|
|
32
|
+
# build-setting keys (e.g. REVERSED_CLIENT_ID) -- same free-form treatment.
|
|
33
|
+
FREE_FORM_FIELDS = %i[custom dart_defines env info_plist entitlements].freeze
|
|
31
34
|
|
|
32
35
|
# (containing_struct, field_name) => target_struct — only the "does this field
|
|
33
36
|
# recurse, and into what" relationship; the valid-keys-within-that-struct question
|