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
Add support for file header template #2568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @olejnjak thanks for submitting this!
I like the overall approach and +1 for using a mapper for this as it fits quite nicely!
Some thoughts:
-
There's talk of deprecating
Config.generationOptions
:/ Deprecating global project attributes in favour of helpersΒ #2429 in favour of per Manifest configuration. Co-incidentally the same topic was brought up here Per-Project Resource AccessorsΒ #2564 too regarding how to define this per project. -
If I'm not mistaken, header templates can be applied at the workspace level too which automatically get applied to all projects with it
- This would mean the template header is only ever created once per workspace rather than for every individual project, we can convert the mapper to a
WorkspaceMapper
and apply the same logic you have already applied here such that the plist is placed in<WorkspaceName>.xcworkspace/xcshareddata/IDETemplateMacros.plist
- If we proceed with discussions above regarding deprecating config, perhaps having this at the workspace level could be a bit easier to adopt globally rather than per-project (thought I still see the value of the config defined approach so not sure how to proceed with this one :/ )
- This would mean the template header is only ever created once per workspace rather than for every individual project, we can convert the mapper to a
-
Worth adding a fixture to show-case this in the various forms :)
7ea7b3d
to
15e34a4
Compare
Should be ready right now with following changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @olejnjak - thanks for all the updates, it's looking great!
Short description π
As working in team various file header templates might apply. This is done by using
IDETemplateMacros.plist
inside xcodeproj. This plist might be shared so located underxcshareddata
and also user-specific. This PR currently addresses shared data.Currently this PR is a draft to discuss the implementation, tests and docs will be added afterwards.
As it might be desired to add also user-specific macros, I implemented new
ProjectMapper
that is responsible for created the above mentioned plist. If later theConfig
is extended with user-specific macros then theIDETemplateMacrosProjectMapper
can be easily updated to create more plists.Checklist β
CHANGELOG.md
has been updated to reflect the changes. In case of a breaking change, it's been flagged as such.