Skip to content
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

Changes in imported swift files do not trigger a cache rebuild #889

Closed
hhanesand opened this issue Dec 31, 2020 · 3 comments · Fixed by #1042
Closed

Changes in imported swift files do not trigger a cache rebuild #889

hhanesand opened this issue Dec 31, 2020 · 3 comments · Fixed by #1042

Comments

@hhanesand
Copy link

hhanesand commented Dec 31, 2020

Assuming we have a file like Generation.swift and it's imported like so:

<%- includeFile("../Utility/Generation.swift") -%>

If there is a compilation error stemming from code in Generation.swift, fixing that error and rerunning Sourcery results in the same compilation error popping up.

Workaround: Make a trivial change to the template that is importing the file to force Sourcery to re-import the effected file.

@hhanesand
Copy link
Author

hhanesand commented Dec 31, 2020

I'm also seeing a bug where Sourcery overwrites Generation.swift (!) with a previous version if one tries to re-run Sourcery (while trying to fix the bug mentioned above), but I haven't quite tracked down reproduction steps. Currently the only fix I've found is to rename the file being imported. Nuking the Sourcery staging directory may work, but I haven't tried that. (passing --disableCache doesn't seem to help).

@krzysztofzablocki
Copy link
Owner

what is Generation.Swift because Sourcery doesn't write to files that are included (they are only read) so I don't really see how you could experience 2nd issue you've mentioned

@hhanesand
Copy link
Author

Yeah, I figured that. Something else must be going on. Poor form to report 2 things in one issue anyways, let's leave discussion for the first comment.

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 a pull request may close this issue.

2 participants