Module: AnnFlavorCore::IosResolution

Defined in:
lib/vendor/ann_flavor_core/lib/ann_flavor_core/ios_resolution.rb

Overview

Shared iOS bundle-ID / Firebase-path resolution — used by both ann-flavor-cocoapods and ann-flavor-fastlane so the two plugins compute identical effective values instead of independently re-deriving them (plan-030 Phase 6 / REQ-CDEL-00070).

Class Method Summary collapse

Class Method Details

.bundle_id(ios_platform, flavor_key, build_type) ⇒ Object

Effective bundle ID for a flavor at a specific build type. Always applies the full cascade (default → flavor → build_type suffix) — there is no build-type-less variant; callers must pass the actual build type they are assembling for.

An unknown flavor key falls back to the unsuffixed default id (matches pre-consolidation behavior — never raises for a missing flavor).



16
17
18
19
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/ios_resolution.rb', line 16

def self.bundle_id(ios_platform, flavor_key, build_type)
  flavor = ios_platform.flavors[flavor_key.to_s] || AnnFlavorCore::IosFlavor.defaults
  Resolver.resolve_ios_flavor(flavor, ios_platform.default, build_type.to_s).effective_id
end

.firebase_config_path(ios_platform, flavor_key, build_type, generated_dir: 'lib/generated/firebase') ⇒ Object

Effective Firebase config file path for a flavor at a specific build type. Full 4-level cascade via the core resolver (config_file, project_id, service_account, target). When only project_id is set (no config_file), synthesizes the stable generated-plist path convention:

#{generated_dir}/GoogleService-Info-#{flavor_key}-#{build_type}.plist

Returns nil when neither config_file nor project_id is set.



28
29
30
31
32
33
34
35
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/ios_resolution.rb', line 28

def self.firebase_config_path(ios_platform, flavor_key, build_type, generated_dir: 'lib/generated/firebase')
  flavor = ios_platform.flavors[flavor_key.to_s] || AnnFlavorCore::IosFlavor.defaults
  resolved = Resolver.resolve_ios_flavor(flavor, ios_platform.default, build_type.to_s)
  fb = resolved.effective_firebase
  return nil if fb.nil?

  fb.config_file || (fb.project_id && "#{generated_dir}/GoogleService-Info-#{flavor_key}-#{build_type}.plist")
end