ann-flavor-flutter 0.4.6 → 0.4.7

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: 2884061122825135d9f07bb18db889d23509649848aca1fca2c45b63b9b8c3bd
4
- data.tar.gz: 5ed44c51bcf6c29195763aaa2615f4bb59b71a5b0908f26fdbc83677419273a4
3
+ metadata.gz: fd7cce396ef86ea1e15205e7440d3755a79707eeaa55126a84bce553d0785add
4
+ data.tar.gz: 10d3037745026703bcd2ae17d93ea6467fb8fe3b6d0962f228b23f2d25e4e7cc
5
5
  SHA512:
6
- metadata.gz: 8635f03da486e2aa4da6a7c9ed423d76260624ff5710a58c4a174951ecf2922bd874e4ff197edcb551db650ae7ef3fc76725d4f58935a076785f0c3f203e3a81
7
- data.tar.gz: 0e5a13e1e4c03ddf24b31bb7b7c07fd330934213601b7a373408fdb051b8cfb2bb0bf298a9ad254df1ede039315b4871f6b2ff44a90818c7574a7361f2f197b6
6
+ metadata.gz: b3312b0e1231f50e7c99bb0ea43580245bd5bae4814dfd63d790e29fa41f9bc197f5492dcb3e0f9b120ac95e8cbbd4c27666874ed0abc18caf8b0183d0013a26
7
+ data.tar.gz: 174e5a6e6a016a6772ad6d764056b4576e09279f03130a0e91e36e323d4f0bb3f9b6dc4db825d3405a3feeefc034bfe1f42c8dbf7b1cdd5217f0a13bc1eb8308
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.7
4
+
5
+ ### Fixed
6
+ - `dart_defines` (`annspec.yaml`'s `android.default.dart_defines` / per-flavor overrides) was silently never applied to `flutter build` when compilation happened as part of `upload_to_play_store`, `upload_to_app_store`, or `upload_to_cloudflare` — only a manual `bundle exec fastlane android compile_build` invocation picked it up, since the flag was injected only into the generated Fastfile's standalone `compile_build` lane, which those upload/publish helpers never call. `compile_build` (the shared helper in `lanes_annai.rb`) now resolves `dart_defines` itself at runtime, so every caller gets it automatically — this also means a flavor-level `dart_defines` override is now honored, which the old generation-time injection could never represent (it could only see default-level values). ([#59](https://github.com/anntech-dev/ann-flavor-tooling/issues/59))
7
+
3
8
  ## 0.4.6
4
9
 
5
10
  ### Fixed
@@ -1,3 +1,3 @@
1
1
  module AnnFlavorFlutter
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
@@ -113,6 +113,22 @@ module FastlaneFlutterFlavor
113
113
  end
114
114
  end
115
115
 
116
+ # dart_defines (REQ-DDEF-00040): resolved here — not only in the
117
+ # standalone Fastfile `compile_build` lane — so every caller that
118
+ # compiles via this helper gets it, including upload_to_play_store,
119
+ # upload_to_app_store, and upload_to_cloudflare, which call this
120
+ # method directly and previously never applied dart_defines at all
121
+ # (DEF-059, #59). A caller-supplied additional_parameter is preserved
122
+ # and the resolved flags are appended alongside it as separate argv
123
+ # elements (Fastlane::Actions.sh below is called with a splatted
124
+ # array, so each flag must be its own element, not one combined
125
+ # string). additional_parameter may already be an Array here (the web
126
+ # branch above turns it into one) or a String.
127
+ dart_defines_flags = @specLoader.get_dart_defines_flags(@platform, flavor, build_config)
128
+ unless dart_defines_flags.empty?
129
+ additional_parameter = Array(additional_parameter).flatten.reject { |p| p.to_s.empty? } + dart_defines_flags
130
+ end
131
+
116
132
  # Base command parts
117
133
  command_parts = [
118
134
  "flutter", "build",
@@ -329,5 +329,27 @@ module FastlaneFlutterFlavor
329
329
  resolved = resolve(platform, flavor_name, build_config)
330
330
  resolved&.effective_auth&.reversed_client_id
331
331
  end
332
+
333
+ # Merges common + compile-scoped dart_defines (compile wins on collision,
334
+ # per REQ-DDEF-00015) into individual --dart-define=KEY=VALUE flags for
335
+ # `flutter build`. Returns [] when there's nothing to emit. Returned as
336
+ # separate array elements (not a single joined string) so callers can pass
337
+ # them straight through to Fastlane::Actions.sh's argv-array form without
338
+ # each flag being treated as one combined shell argument.
339
+ #
340
+ # REQ-DDEF-00040's default-only scoping decision applies here too:
341
+ # `resolve` folds flavor-level overrides in via the core's 4-level cascade,
342
+ # so a flavor with its own dart_defines still resolves correctly per call —
343
+ # unlike the (now-removed) generated-Fastfile-lane version, which could
344
+ # only represent default-level dart_defines since it was a single static
345
+ # lane shared across every flavor.
346
+ def get_dart_defines_flags(platform, flavor_name, build_type = 'release')
347
+ resolved = resolve(platform, flavor_name, build_type)
348
+ defines = resolved&.effective_dart_defines
349
+ return [] unless defines
350
+
351
+ merged = (defines.common || {}).merge(defines.compile || {})
352
+ merged.map { |k, v| "--dart-define=#{k}=#{v}" }
353
+ end
332
354
  end
333
355
  end
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.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ANN Solutions