Add support for C# Implicit Usings#2697
Conversation
Jarod42
left a comment
There was a problem hiding this comment.
Tests are missing.
Appreciated to add testing project into https://github.com/Jarod42/premake-sample-projects too ;-)
bea454d to
5724229
Compare
|
Updated (amended commit) to add "Default" option which doesn't add the ImplicitUsings project property to ensure backwards compatibility. Updated documentation to match. Added tests. Require VS2022 or above (which is when I think it was first available). For the samples, I'll take a look. I've got a few PRs to follow for changes I needed to get my project working. I might try to get those in first and then add a sample which uses them all, if that makes sense. |
There was a problem hiding this comment.
NP. Removed. Would you like me to submit it in a separate PR or not at all?
| On = "true" | ||
| } | ||
|
|
||
| if _ACTION >= "vs2022" and |
There was a problem hiding this comment.
Typical style throughout the code base is to put this on a single line.
|
|
||
| if _ACTION >= "vs2022" and | ||
| dotnetbase.isNewFormatProject(cfg) and | ||
| types[cfg.enableImplicitUsings] then |
There was a problem hiding this comment.
Should this be cfg.enableimplicitusings?
There was a problem hiding this comment.
Yes, it should! Fixed. I'm not sure why it also worked with the incorrect casing?
It looks like dotnetbase.netcore.enableDefaultCompileItems has the same issue with cfg.enableDefaultCompileItems.
5724229 to
dd4c5d0
Compare
What does this PR do?
Adds support for Implicit Usings
How does this PR change Premake's behavior?
It adds a new project property called
enableimplicitusingswhich defaults to "Off" but can be switched to "On"Anything else we should know?
It's pretty much a straight copy of the
enabledefaultcompileitemsimplementationDid you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!