Skip to content

feat: Icon generation fix - #9

Open
DanielCech wants to merge 2 commits into
masterfrom
dc/fix/icon-generation-fix
Open

feat: Icon generation fix#9
DanielCech wants to merge 2 commits into
masterfrom
dc/fix/icon-generation-fix

Conversation

@DanielCech

@DanielCech DanielCech commented Aug 6, 2026

Copy link
Copy Markdown
Member

Why

Previously, VersionIcon wrote generated icons straight into the tracked --appIcon asset catalog. Every configuration switch (e.g. Debug ↔ Release) re-wrote those files, leaving the source assets "dirty" after almost any build and polluting git diffs.

What changed

  • Added an opt-in --outputAssetCatalog <path> option. When set, VersionIcon generates the app icon set into a separate, build-only .xcassets catalog instead of touching the source AppIconOriginal-derived assets.
  • The generated catalog and Contents.json are created/synced automatically from AppIconOriginal on demand.
  • Existing setups that don't pass the new flag keep the previous (unchanged) behavior — fully backwards compatible.
  • Documented the new setup in the README (build phase order, Copy Bundle Resources, Primary App Icon Set Name, ignoring the generated catalog in source control).
  • Added regression tests covering multiple generated configurations to confirm source icons stay untouched.
  • Updated the distributed Bin/VersionIcon binary.

Result

Projects that adopt --outputAssetCatalog no longer see their tracked icon assets modified/marked dirty on every configuration build.

I am testing it on Memoaire project:

image

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an opt-in “generated asset catalog” mode so VersionIcon can write configuration-specific app icons into a separate .xcassets output directory, avoiding modifications to tracked source icon assets.

Changes:

  • Added --outputAssetCatalog <path> CLI option and threaded it through ScriptSetup.
  • Updated app icon folder resolution to support generating/syncing an output .appiconset based on AppIconOriginal.
  • Added a regression test validating source icons remain untouched when generating multiple configurations; documented usage in the README.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tests/VersionIconTests/VersionIconTests.swift Adds regression coverage for generated-catalog mode ensuring source icons stay unchanged across multiple runs/configs.
Sources/VersionIcon/Support/Models.swift Extends ScriptSetup to carry the optional generated asset catalog output path.
Sources/VersionIcon/Support/AppSetup.swift Implements output catalog mode by preparing/syncing a generated .appiconset and using it as the destination folder.
Sources/VersionIcon/main.swift Exposes --outputAssetCatalog CLI option and passes it into ScriptSetup.
README.md Documents the new generated asset catalog workflow and the new CLI parameter.
pr_description.md Adds PR summary notes (currently includes a screenshot placeholder).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/VersionIcon/Support/AppSetup.swift
Comment thread pr_description.md Outdated
…atalog

Previously the guard only rejected an output path resolving to the exact
same appiconset folder as appIconOriginal, so pointing --outputAssetCatalog
at the same tracked .xcassets catalog (under a different appiconset name)
would still dirty tracked assets. Also drops the leftover screenshot TODO
from pr_description.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

3 participants