-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcodegen cache bug? #1457
Comments
Yeah it's possible to get some false positive cache hits when regenerating a project that is in the same project configuration state it was in last time, but the underlying xcode project has had a change made via the interface. Thinking about it now, XcodeGen could theoretically use the xcode project contents as part of the cache key, but that could also lead to less caching as the project could change underneath as Xcode saves it's own state, and doesn't always 100% equal what XcodeGen generates. One workaround for now, is running xcodegen with cache after each commit (in a post-commit hook). That would add your new file to the cache, so that when you go back to develop it notices a change. But this is perhaps non workable if you use swift packages, as Xcode likes to resolve packages each time it detects project changes (or is opened), which can get annoying rather quickly Thoughts? |
Just had an idea about this, as the issue came up in a project I'm working on. We have xcodegen run with cache on
So the idea is to add a new command to xcodegen that tells it to just update it's cache without generating. This can then run in a Then the only way I can foresee the cache getting out of date is if someone adds a file in xcode, and then discards the changes in git. XcodeGen wouldn't know about that (there's no discard changes git hook as far as I'm aware), and the project would be invalid. There's a rarer case though. |
I have a git hook post-checkout, when i checkout i start a script it's just a one line - "xcodegen generate --use-cache".
So the bug is that it's not work in my case.
My case:
Everything happens in local repo.
I create new branch from develop for example branch-1.
I create a new file on branch-1 with some swift class, commit it in local repo and then go back to develop.
When i checkout hook start a command - "xcodegen generate --use-cache" but it says "Project ProjectName has not changed since cache was written", but develop doesn't has a new file which i created on branch-1.
For this case i need to write xcodegen generate on terminal by hand.
Whats wrong why it doesn't work and how fix it?
The text was updated successfully, but these errors were encountered: