Add support for iOS 18 layered icons and Xcode 14+ single-size format#126
Merged
Conversation
- Create IconCatalog class to parse Contents.json intelligently - Detect icon format types: legacy multi-size, single-size, or layered - For layered icons (all.png, dark.png, tint.png), badge all variants - Maintain backward compatibility with custom glob option - Bump version to 0.13.1 to satisfy fastlane-plugin-badge constraint (~> 0.13.0) Fixes issues with iOS 17/18 layered app icons that were breaking the badge overlay functionality.
|
Hello @HazAT, would be great if we can get this merged 🙌 |
Owner
|
thx, will try to do a release today |
This was referenced Apr 24, 2026
HazAT
added a commit
that referenced
this pull request
Apr 24, 2026
Adds `test/smoke.sh`, a bash-based integration harness that exercises
every CLI flag combo against real fixtures in an isolated tmp dir. This
is now the de-facto test suite for the project — there is still no CI,
but `make smoke` gives a deterministic pre-release/pre-merge signal in
~12 seconds.
Coverage (20 cases):
A. CLI flag matrix — 13 existing combinations from create-assets:
default / --dark / --alpha / --alpha --dark / --grayscale,
shield aspect-fill / --shield_no_resize / + dark / + geometry + scale /
+ grayscale, same against the fitrack fixture.
B. Input format preservation — webp + shield, webp + default badge,
webp + dark, jpg + shield (exercises the #121 fix).
C. Shield URL construction — `shield_base_url` override produces
the correct URL; default URL is unchanged when option omitted
(exercises the #111 fix).
D. IconCatalog single-size auto-detection — exercises the #126 path.
Design notes:
- Pure bash + the project's normal gem deps. No additional test framework.
- Isolated `$(mktemp -d)` workdir, cleaned on exit; pass
`KEEP_ARTIFACTS=1` to retain output images for inspection.
- Exit codes: 0 = all pass, 1 = failures, 2 = missing system dependency.
- Fixtures read from `assets/`; nothing tracked is ever mutated.
- Dependency check fails loudly with an actionable message when
imagemagick, ruby, bundler, or rsvg-convert is missing, or when
`bundle install` hasn't been run.
Also:
- Makefile: new `make smoke` target + `.PHONY` declarations.
- .gitignore: ignore `/vendor/` so `bundle install --path vendor/bundle`
(what smoke.sh implicitly uses when bundler is configured that way)
doesn't accidentally stage gem contents.
- AGENTS.md: point at `make smoke` as the primary verification path,
downgrade `make create-assets` to an asset-regen tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for iOS 18 layered icons and Xcode 14+ single-size format
Problem
The badge gem currently uses a simple glob pattern (
/**/*.appiconset/*.{png,PNG}) to find app icons, which doesn't understand modern iOS icon formats:all.png), dark mode (dark.png), and tinted variant (tint.png)This causes issues where either icons aren't badged correctly or the tool doesn't recognize the new format.
Solution
Added intelligent icon detection by parsing
Contents.jsonfrom asset catalogs:New
IconCatalogclassContents.jsonto understand icon structureBackward Compatibility
✅ Fully backward compatible:
--globoption still works (bypasses new logic)Changes
lib/badge/icon_catalog.rb- Contents.json parserlib/badge/runner.rb- Uses IconCatalog when no custom globlib/badge.rb- Requires icon_catalog module0.13.1Testing
Tested with:
Backward Compatibility
--globoption preserved (uses original code path, unchanged)Related Issues
Fixes iOS 18 layered icon support (mentioned in #122)