1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

C#: Don't overwrite newer Godot.NET.Sdk patch version in csproj

Allow game projects to use a Godot.NET.Sdk with a newer patch version.
The major and minor version are still required to be the same.

For example: Allow a Godot 3.2.4 C# project to use a hypothetical
3.2.5 version of Godot.NET.Sdk.
This commit is contained in:
Ignacio Etcheverry
2020-12-06 00:56:47 +01:00
parent 185520c5b0
commit 9b24d5f2d0
3 changed files with 32 additions and 9 deletions

View File

@@ -9,8 +9,7 @@ namespace GodotTools.ProjectEditor
public static class ProjectGenerator
{
public const string GodotSdkVersionToUse = "3.2.3";
public static string GodotSdkAttrValue => $"Godot.NET.Sdk/{GodotSdkVersionToUse}";
public const string GodotSdkNameToUse = "Godot.NET.Sdk";
public static ProjectRootElement GenGameProject(string name)
{
@@ -19,7 +18,7 @@ namespace GodotTools.ProjectEditor
var root = ProjectRootElement.Create(NewProjectFileOptions.None);
root.Sdk = GodotSdkAttrValue;
root.Sdk = $"{GodotSdkNameToUse}/{GodotSdkVersionToUse}";
var mainGroup = root.AddPropertyGroup();
mainGroup.AddProperty("TargetFramework", "net472");