Skip to content

Add xcconfig templates and ConfigKey protocol - #58

Merged
ssestak merged 3 commits into
mainfrom
feature/xcconfig-template
May 12, 2026
Merged

ssestak merged 3 commits into
mainfrom
feature/xcconfig-template

Conversation

@ssestak

@ssestak ssestak commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds xcconfig-based configuration management to the SwiftUI App template with per-environment config files (Debug, Beta, Release, Local) and a new ConfigKey protocol in FuturedHelpers for type-safe Info.plist value retrieval with automatic Base64 decoding.

Changes

  • ConfigKey protocol with default implementation that reads from Bundle.main Info.plist and auto-decodes Base64 values
  • ConfigKeyError with descriptive error messages guiding developers to check xcconfig/Info.plist wiring
  • Debug config includes Local.xcconfig via #include? for git-ignored local secrets
  • Beta and Release configs are empty by design — values injected via CI
  • TemplateInfo.plist updated to wire all xcconfig files into the Xcode project template under a Configuration group

Diagram

View diagram
flowchart TD
    subgraph xcconfig["xcconfig files"]
        Local["Local.xcconfig\n(git-ignored secrets)"]
        Debug["Debug.xcconfig\n(dev settings)"]
        Beta["Beta.xcconfig\n(CI injected)"]
        Release["Release.xcconfig\n(CI injected)"]
    end

    Local -->|"#include?"| Debug
    Debug --> Build["Build Settings"]
    Beta --> Build
    Release --> Build
    Build --> Plist["Info.plist\n$(KEY_NAME)"]
    Plist --> ConfigKey["ConfigKey protocol\n(auto Base64 decode)"]
    ConfigKey --> App["App code\ntry AppConfigKey.apiKey.value"]
Loading

Notes

  • Local.xcconfig should be added to .gitignore in consumer projects to keep secrets out of version control

@ssestak
ssestak marked this pull request as ready for review May 12, 2026 11:29
@ssestak
ssestak requested a review from jmarek41 May 12, 2026 11:30
Šimon Šesták and others added 3 commits May 12, 2026 12:39
Add Debug, Beta, Release, and Local xcconfig files in a Configuration
group. Debug includes Local via optional #include. Each config has
placeholder keys for API_KEY, API_BASE_URL, and OTHER_SWIFT_FLAGS.
Xcconfigs are wired to build configurations via baseConfigurationReferenceRelativePath.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add reusable ConfigKey protocol to FuturedHelpers for type-safe
access to Info.plist values from xcconfig with Base64 decoding support.
Add instructional comments to all xcconfig files explaining how to
wire keys to Info.plist and access them using ConfigKey.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove placeholder TODOs from Beta and Release configs,
replacing them with notes about CI-injected values. Update
Debug config with Local.xcconfig guidance for API keys.
@ssestak
ssestak force-pushed the feature/xcconfig-template branch from 0456be4 to 5403be3 Compare May 12, 2026 11:39
@ssestak
ssestak merged commit 652af82 into main May 12, 2026
1 check passed
@ssestak
ssestak deleted the feature/xcconfig-template branch May 12, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants