-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 property UsingGodotNETSdk
to Godot.NET.Sdk
#89652
Conversation
The Godot.NET.Sdk (for C# use) should define the property `UsingGodotNETSdk` in its [SDK.props](https://github.com/godotengine/godot/blob/a07dd0d6a520723c4838fb4b65461a16b7a50f90/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props). ## Why Defining this property allows shared build configuration (e.g. Directory.Build.targets or other imported msbuild files) to detect deterministically when they are operating within the scope of a project controlled by Godot.NET.Sdk. This enables shared build configuration that may span many different projects within a folder to have Godot.NET.Sdk-specific configuration that only applies to Godot projects. ## Why named UsingGodotNETSdk This naming scheme is common practice in Microsoft Dotnet SDKs. For example, the property `UsingMicrosoftNETSdk` is defined by the default SDK, `UsingMicrosoftTraversalSdk` is defined by [Microsoft.Build.Traversal](https://github.com/microsoft/MSBuildSdks/blob/363532de5b406c9afc6e6ff0f276431c27b11347/src/Traversal/Sdk/Sdk.props#L10), `UsingMicrosoftNoTargetsSdk` by [Microsoft.Build.NoTargets](https://github.com/microsoft/MSBuildSdks/blob/363532de5b406c9afc6e6ff0f276431c27b11347/src/NoTargets/Sdk/Sdk.props#L10), and so on. The property `UsingMicrosoftNETSdk` is even used in the implementation of Godot.NET.Sdk for conditional logic of the type predicted here. Note that these "Using*" properties are _additive_ in the sense that more than one can be defined for a given project (as SDKs can effectively be built upon other SDKs, using them as components). So, it is normal and appropriate for both `UsingMicrosoftNETSdk` and `UsingGodotNETSdk` to be simultaneously defined within the same project.
Hello, thanks for the PR 🙂 |
Hey Paul, I had similar thoughts about just using While it might be possible to distinguish using some coincidental property, such as Defining Plus, this PR is trivial. :) As a historical note, the Dotnet SDK didn't originally define |
Thanks for the detailed write up. Yes. I agree with explicitness being a good thing, and the fact the constants might evolve with time, etc. |
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.
This makes sense to me, it's a small change and seems consistent with other SDKs.
UsingGodotNETSdk
to Godot.NET.Sdk
06abc86
Add property `UsingGodotNETSdk` to Godot.NET.Sdk
Thanks! |
The Godot.NET.Sdk (for C# use) should define the property
UsingGodotNETSdk
in its SDK.props.Why
Defining this property allows shared build configuration (e.g. Directory.Build.targets or other imported msbuild files) to detect deterministically when they are operating within the scope of a project controlled by Godot.NET.Sdk. This enables shared build configuration that may span many different projects within a folder to have Godot.NET.Sdk-specific configuration that only applies to Godot projects.
Why named UsingGodotNETSdk
This naming scheme is common practice in Microsoft Dotnet SDKs. For example, the property
UsingMicrosoftNETSdk
is defined by the default SDK,UsingMicrosoftTraversalSdk
is defined by Microsoft.Build.Traversal,UsingMicrosoftNoTargetsSdk
by Microsoft.Build.NoTargets, and so on. The propertyUsingMicrosoftNETSdk
is even used in the implementation of Godot.NET.Sdk for conditional logic of the type predicted here.Note that these "Using*" properties are additive in the sense that more than one can be defined for a given project (as SDKs can effectively be built upon other SDKs, using them as components). So, it is normal and appropriate for both
UsingMicrosoftNETSdk
andUsingGodotNETSdk
to be simultaneously defined within the same project.