2
0
Эх сурвалжийг харах

[.NET] Skip re-saving `.csproj` when TFM is unchanged

Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.

(cherry picked from commit 57d5b664d35fbb13f1ebec74fa45272b8183e623)
Raul Santos 6 сар өмнө
parent
commit
10b2b76347

+ 7 - 0
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs

@@ -191,6 +191,13 @@ namespace GodotTools.ProjectEditor
                 // Otherwise, it can be removed.
                 if (mainTfmVersion > minTfmVersion)
                 {
+                    var propertyTfmVersion = NuGetFramework.Parse(property.Value).Version;
+                    if (propertyTfmVersion == minTfmVersion)
+                    {
+                        // The 'TargetFramework' property already matches the minimum version.
+                        continue;
+                    }
+
                     property.Value = minTfmValue;
                 }
                 else