Repository navigation
Add unique prefixes to all .targets properties and items - #321
Conversation
Nirmal4G
left a comment
There was a problem hiding this comment.
Seems like these properties are not meant to be public. So, you can use a _ prefix to denote that. But even _CurrentCompilerVersion sometimes could be used elsewhere as the name is too generic. Hence, my suggestions!
Either _ or _MVVMToolkit_ is fine. But if you think they don't need to be unique then select the former.
@Nirmal4G Is there some official docs or something to document this? I can't find anything regarding the "_" prefix being used specifically for private properties in .targets files or similar. I don't have anything against using that once we confirm this 🙂 |
|
There's no official docs on this as far as I know. It's just a convention (doesn't actually make your property internal/private) to make sure we don't accidentally use potential MSBuild properties that could be used by users. You can refer to other props and targets shipped by M$FT and you can see this pattern even in Common props and targets. |
|
I see. In that case I don't think we need that, just using "MVVMToolkit" as prefix should be enough. This has been the original suggestion from Sam as well (from the Roslyn team), and what he's been doing as well in the Antlr4cs project too. |
|
Okay, he doesn't seem to use the prefix even for properties that shouldn't be available to user. I'm okay with that. It looks neat. But you do have targets name prefixed. And it's inconsistent with elsewhere, not that I'm complaining but yeah...😅 |
|
That's a fair point, I think Sam must've also changed his mind on this as he was the one that used "_" in the first place. |
This PR adds unique prefixes to all properties and items in the .targets file bundled with the MVVM Toolkit.
This ensures there can be no conflicts with other targets defining the same elements from other NuGet packages.
Essentially, this PR fixes this: https://github.com/Sergio0694/ComputeSharp/actions/runs/2523630796.
PR Checklist