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

Separate EJSTemplate.swift for swift test and for swift build -c release #1203

Merged

Conversation

art-divin
Copy link
Collaborator

@art-divin art-divin commented Sep 18, 2023

Resolves #1202

Context

Introduced by #1188.

For swift test to work, a different way of searching for ejs template on macOS was implemented according to "best practices" due to issues with SPM (more info here).
But the problem with this is that when running Sourcery from CLI, it is packaged differently for release mode, and so, it cannot find the required resources like for swift test.

Workaround

  1. Revert changes for before the migration to swift test
  2. Create a separate version of implementation that works with swift test and put it under #if DEBUG because swift test runs tests in DEBUG, and Sourcery CLI is distributed with -c release compilation mode.

Notes

There are missing integration tests because otherwise I would not merge that MR. So, I have added this use case to explore into TODO - #1198 .

@SourceryBot
Copy link

1 Error
🚫 Any changes to library code need a summary in the Changelog.

Generated by 🚫 Danger

@art-divin art-divin self-assigned this Sep 18, 2023
@art-divin art-divin changed the title Attempt to resolve runtime issue Separate EJSTemplate.swift for swift test and for swift build -c release Sep 18, 2023
@art-divin art-divin merged commit 66f3e6e into krzysztofzablocki:master Sep 18, 2023
2 checks passed
art-divin added a commit to art-divin/Sourcery that referenced this pull request Sep 18, 2023
art-divin added a commit that referenced this pull request Sep 18, 2023
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.

Issue when running sourcery from binary
2 participants