Browse Source

C#: Use Sdks in GodotTools csprojs and switch to nuget Microsoft.Build

Ignacio Etcheverry 5 years ago
parent
commit
f3bcd5f8dd
26 changed files with 140 additions and 531 deletions
  1. 13 1
      modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs
  2. 4 54
      modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj
  3. 0 35
      modules/mono/editor/GodotTools/GodotTools.BuildLogger/Properties/AssemblyInfo.cs
  4. 3 36
      modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj
  5. 0 26
      modules/mono/editor/GodotTools/GodotTools.Core/Properties/AssemblyInfo.cs
  6. 2 12
      modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
  7. 4 46
      modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj
  8. 0 35
      modules/mono/editor/GodotTools/GodotTools.IdeConnection/Properties/AssemblyInfo.cs
  9. 15 49
      modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj
  10. 4 7
      modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectExtensions.cs
  11. 2 5
      modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
  12. 0 27
      modules/mono/editor/GodotTools/GodotTools.ProjectEditor/Properties/AssemblyInfo.cs
  13. 0 4
      modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config
  14. 2 2
      modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
  15. 26 24
      modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
  16. 6 8
      modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
  17. 6 6
      modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
  18. 1 1
      modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs
  19. 1 1
      modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
  20. 4 6
      modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
  21. 11 86
      modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj
  22. 1 1
      modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs
  23. 6 6
      modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
  24. 0 26
      modules/mono/editor/GodotTools/GodotTools/Properties/AssemblyInfo.cs
  25. 29 22
      modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
  26. 0 5
      modules/mono/editor/GodotTools/GodotTools/packages.config

+ 13 - 1
modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs

@@ -2,7 +2,6 @@ using System;
 using System.IO;
 using System.IO;
 using System.Security;
 using System.Security;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Framework;
-using GodotTools.Core;
 
 
 namespace GodotTools.BuildLogger
 namespace GodotTools.BuildLogger
 {
 {
@@ -183,4 +182,17 @@ namespace GodotTools.BuildLogger
         private StreamWriter issuesStreamWriter;
         private StreamWriter issuesStreamWriter;
         private int indent;
         private int indent;
     }
     }
+
+    internal static class StringExtensions
+    {
+        public static string CsvEscape(this string value, char delimiter = ',')
+        {
+            bool hasSpecialChar = value.IndexOfAny(new[] { '\"', '\n', '\r', delimiter }) != -1;
+
+            if (hasSpecialChar)
+                return "\"" + value.Replace("\"", "\"\"") + "\"";
+
+            return value;
+        }
+    }
 }
 }

+ 4 - 54
modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj

@@ -1,60 +1,10 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{6CE9A984-37B1-4F8A-8FE9-609F05F071B3}</ProjectGuid>
     <ProjectGuid>{6CE9A984-37B1-4F8A-8FE9-609F05F071B3}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>GodotTools.BuildLogger</RootNamespace>
-    <AssemblyName>GodotTools.BuildLogger</AssemblyName>
-    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <LangVersion>7</LangVersion>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <LangVersion>7.2</LangVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>portable</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>portable</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="Microsoft.Build.Framework" />
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="GodotBuildLogger.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj">
-      <Project>{639e48bd-44e5-4091-8edd-22d36dc0768d}</Project>
-      <Name>GodotTools.Core</Name>
-    </ProjectReference>
+    <PackageReference Include="Microsoft.Build.Framework" Version="16.5.0" />
   </ItemGroup>
   </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-         Other similar extension points exist, see Microsoft.Common.targets.
-    <Target Name="BeforeBuild">
-    </Target>
-    <Target Name="AfterBuild">
-    </Target>
-    -->
 </Project>
 </Project>

+ 0 - 35
modules/mono/editor/GodotTools/GodotTools.BuildLogger/Properties/AssemblyInfo.cs

@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("GodotTools.BuildLogger")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("Godot Engine contributors")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("6CE9A984-37B1-4F8A-8FE9-609F05F071B3")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 3 - 36
modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj

@@ -1,40 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{639E48BD-44E5-4091-8EDD-22D36DC0768D}</ProjectGuid>
     <ProjectGuid>{639E48BD-44E5-4091-8EDD-22D36DC0768D}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <RootNamespace>GodotTools.Core</RootNamespace>
-    <AssemblyName>GodotTools.Core</AssemblyName>
-    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
-    <LangVersion>7</LangVersion>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <LangVersion>7.2</LangVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="FileUtils.cs" />
-    <Compile Include="ProcessExtensions.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="StringExtensions.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 </Project>
 </Project>

+ 0 - 26
modules/mono/editor/GodotTools/GodotTools.Core/Properties/AssemblyInfo.cs

@@ -1,26 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("GodotTools.Core")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("Godot Engine contributors")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]

+ 2 - 12
modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs

@@ -33,23 +33,13 @@ namespace GodotTools.Core
             return rooted ? Path.DirectorySeparatorChar + path : path;
             return rooted ? Path.DirectorySeparatorChar + path : path;
         }
         }
 
 
-        private static readonly string driveRoot = Path.GetPathRoot(Environment.CurrentDirectory);
+        private static readonly string DriveRoot = Path.GetPathRoot(Environment.CurrentDirectory);
 
 
         public static bool IsAbsolutePath(this string path)
         public static bool IsAbsolutePath(this string path)
         {
         {
             return path.StartsWith("/", StringComparison.Ordinal) ||
             return path.StartsWith("/", StringComparison.Ordinal) ||
                    path.StartsWith("\\", StringComparison.Ordinal) ||
                    path.StartsWith("\\", StringComparison.Ordinal) ||
-                   path.StartsWith(driveRoot, StringComparison.Ordinal);
-        }
-
-        public static string CsvEscape(this string value, char delimiter = ',')
-        {
-            bool hasSpecialChar = value.IndexOfAny(new char[] { '\"', '\n', '\r', delimiter }) != -1;
-
-            if (hasSpecialChar)
-                return "\"" + value.Replace("\"", "\"\"") + "\"";
-
-            return value;
+                   path.StartsWith(DriveRoot, StringComparison.Ordinal);
         }
         }
 
 
         public static string ToSafeDirName(this string dirName, bool allowDirSeparator)
         public static string ToSafeDirName(this string dirName, bool allowDirSeparator)

+ 4 - 46
modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj

@@ -1,53 +1,11 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{92600954-25F0-4291-8E11-1FEE9FC4BE20}</ProjectGuid>
     <ProjectGuid>{92600954-25F0-4291-8E11-1FEE9FC4BE20}</ProjectGuid>
     <OutputType>Library</OutputType>
     <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>GodotTools.IdeConnection</RootNamespace>
-    <AssemblyName>GodotTools.IdeConnection</AssemblyName>
-    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <LangVersion>7</LangVersion>
+    <TargetFramework>net472</TargetFramework>
+    <LangVersion>7.2</LangVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>portable</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>portable</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-  </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="ConsoleLogger.cs" />
-    <Compile Include="GodotIdeMetadata.cs" />
-    <Compile Include="GodotIdeBase.cs" />
-    <Compile Include="GodotIdeClient.cs" />
-    <Compile Include="GodotIdeConnection.cs" />
-    <Compile Include="GodotIdeConnectionClient.cs" />
-    <Compile Include="GodotIdeConnectionServer.cs" />
-    <Compile Include="ILogger.cs" />
-    <Compile Include="Message.cs" />
-    <Compile Include="MessageComposer.cs" />
-    <Compile Include="MessageParser.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Folder Include="Properties" />
   </ItemGroup>
   </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>
 </Project>

+ 0 - 35
modules/mono/editor/GodotTools/GodotTools.IdeConnection/Properties/AssemblyInfo.cs

@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("GodotTools.IdeConnection")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("Godot Engine contributors")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("92600954-25F0-4291-8E11-1FEE9FC4BE20")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 15 - 49
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj

@@ -1,57 +1,23 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{A8CDAD94-C6D4-4B19-A7E7-76C53CC92984}</ProjectGuid>
     <ProjectGuid>{A8CDAD94-C6D4-4B19-A7E7-76C53CC92984}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <RootNamespace>GodotTools.ProjectEditor</RootNamespace>
-    <AssemblyName>GodotTools.ProjectEditor</AssemblyName>
-    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
-    <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath>
-    <LangVersion>7</LangVersion>
+    <TargetFramework>net472</TargetFramework>
+    <LangVersion>7.2</LangVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>portable</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="Microsoft.Build" />
-    <Reference Include="DotNet.Glob, Version=2.1.1.0, Culture=neutral, PublicKeyToken=b68cc888b4f632d1, processorArchitecture=MSIL">
-      <HintPath>$(SolutionDir)\packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll</HintPath>
-    </Reference>
-  </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="ApiAssembliesInfo.cs" />
-    <Compile Include="DotNetSolution.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="IdentifierUtils.cs" />
-    <Compile Include="ProjectExtensions.cs" />
-    <Compile Include="ProjectGenerator.cs" />
-    <Compile Include="ProjectUtils.cs" />
+    <PackageReference Include="Microsoft.Build" Version="16.5.0" />
+    <PackageReference Include="Microsoft.Build.Runtime" Version="16.5.0" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <None Include="packages.config" />
+    <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj" />
   </ItemGroup>
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj">
-      <Project>{639E48BD-44E5-4091-8EDD-22D36DC0768D}</Project>
-      <Name>GodotTools.Core</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <!--
+    The 'Microsoft.Build.Runtime' package includes an mscorlib reference assembly in contentFiles.
+    This causes our project build to fail. As a workaround, we remove {CandidateAssemblyFiles}
+    from AssemblySearchPaths as described here: https://github.com/microsoft/msbuild/issues/3486.
+    -->
+    <AssemblySearchPaths>$([System.String]::Copy('$(AssemblySearchPaths)').Replace('{CandidateAssemblyFiles}', ''))</AssemblySearchPaths>
+    <AssemblySearchPaths Condition=" '$(MSBuildRuntimeVersion)' != '' ">$(AssemblySearchPaths.Split(';'))</AssemblySearchPaths>
+  </PropertyGroup>
 </Project>
 </Project>

+ 4 - 7
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectExtensions.cs

@@ -2,8 +2,8 @@ using GodotTools.Core;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using DotNet.Globbing;
 using Microsoft.Build.Construction;
 using Microsoft.Build.Construction;
+using Microsoft.Build.Globbing;
 
 
 namespace GodotTools.ProjectEditor
 namespace GodotTools.ProjectEditor
 {
 {
@@ -11,8 +11,6 @@ namespace GodotTools.ProjectEditor
     {
     {
         public static ProjectItemElement FindItemOrNull(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
         public static ProjectItemElement FindItemOrNull(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
         {
         {
-            GlobOptions globOptions = new GlobOptions {Evaluation = {CaseInsensitive = false}};
-
             string normalizedInclude = include.NormalizePath();
             string normalizedInclude = include.NormalizePath();
 
 
             foreach (var itemGroup in root.ItemGroups)
             foreach (var itemGroup in root.ItemGroups)
@@ -25,7 +23,8 @@ namespace GodotTools.ProjectEditor
                     if (item.ItemType != itemType)
                     if (item.ItemType != itemType)
                         continue;
                         continue;
 
 
-                    var glob = Glob.Parse(item.Include.NormalizePath(), globOptions);
+                    //var glob = Glob.Parse(item.Include.NormalizePath(), globOptions);
+                    var glob = MSBuildGlob.Parse(item.Include.NormalizePath());
 
 
                     if (glob.IsMatch(normalizedInclude))
                     if (glob.IsMatch(normalizedInclude))
                         return item;
                         return item;
@@ -36,8 +35,6 @@ namespace GodotTools.ProjectEditor
         }
         }
         public static ProjectItemElement FindItemOrNullAbs(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
         public static ProjectItemElement FindItemOrNullAbs(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
         {
         {
-            GlobOptions globOptions = new GlobOptions {Evaluation = {CaseInsensitive = false}};
-
             string normalizedInclude = Path.GetFullPath(include).NormalizePath();
             string normalizedInclude = Path.GetFullPath(include).NormalizePath();
 
 
             foreach (var itemGroup in root.ItemGroups)
             foreach (var itemGroup in root.ItemGroups)
@@ -50,7 +47,7 @@ namespace GodotTools.ProjectEditor
                     if (item.ItemType != itemType)
                     if (item.ItemType != itemType)
                         continue;
                         continue;
 
 
-                    var glob = Glob.Parse(Path.GetFullPath(item.Include).NormalizePath(), globOptions);
+                    var glob = MSBuildGlob.Parse(Path.GetFullPath(item.Include).NormalizePath());
 
 
                     if (glob.IsMatch(normalizedInclude))
                     if (glob.IsMatch(normalizedInclude))
                         return item;
                         return item;

+ 2 - 5
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs

@@ -4,8 +4,8 @@ using System.Diagnostics;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using DotNet.Globbing;
 using Microsoft.Build.Construction;
 using Microsoft.Build.Construction;
+using Microsoft.Build.Globbing;
 
 
 namespace GodotTools.ProjectEditor
 namespace GodotTools.ProjectEditor
 {
 {
@@ -133,9 +133,6 @@ namespace GodotTools.ProjectEditor
             var result = new List<string>();
             var result = new List<string>();
             var existingFiles = GetAllFilesRecursive(Path.GetDirectoryName(projectPath), "*.cs");
             var existingFiles = GetAllFilesRecursive(Path.GetDirectoryName(projectPath), "*.cs");
 
 
-            var globOptions = new GlobOptions();
-            globOptions.Evaluation.CaseInsensitive = false;
-
             var root = ProjectRootElement.Open(projectPath);
             var root = ProjectRootElement.Open(projectPath);
             Debug.Assert(root != null);
             Debug.Assert(root != null);
 
 
@@ -151,7 +148,7 @@ namespace GodotTools.ProjectEditor
 
 
                     string normalizedInclude = item.Include.NormalizePath();
                     string normalizedInclude = item.Include.NormalizePath();
 
 
-                    var glob = Glob.Parse(normalizedInclude, globOptions);
+                    var glob = MSBuildGlob.Parse(normalizedInclude);
 
 
                     // TODO Check somehow if path has no blob to avoid the following loop...
                     // TODO Check somehow if path has no blob to avoid the following loop...
 
 

+ 0 - 27
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/Properties/AssemblyInfo.cs

@@ -1,27 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("GodotTools.ProjectEditor")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("Godot Engine contributors")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-

+ 0 - 4
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="DotNet.Glob" version="2.1.1" targetFramework="net45" />
-</packages>

+ 2 - 2
modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs

@@ -109,9 +109,9 @@ namespace GodotTools.Build
                 buildInfo.LogsDirPath, buildInfo.CustomProperties);
                 buildInfo.LogsDirPath, buildInfo.CustomProperties);
         }
         }
 
 
-        public static async Task<int> BuildAsync(BuildInfo buildInfo)
+        public static Task<int> BuildAsync(BuildInfo buildInfo)
         {
         {
-            return await BuildAsync(buildInfo.Solution, buildInfo.Configuration,
+            return BuildAsync(buildInfo.Solution, buildInfo.Configuration,
                 buildInfo.LogsDirPath, buildInfo.CustomProperties);
                 buildInfo.LogsDirPath, buildInfo.CustomProperties);
         }
         }
 
 

+ 26 - 24
modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs

@@ -28,15 +28,13 @@ namespace GodotTools.Build
                 {
                 {
                     case BuildManager.BuildTool.MsBuildVs:
                     case BuildManager.BuildTool.MsBuildVs:
                     {
                     {
-                        if (_msbuildToolsPath.Empty() || !File.Exists(_msbuildToolsPath))
+                        if (string.IsNullOrEmpty(_msbuildToolsPath) || !File.Exists(_msbuildToolsPath))
                         {
                         {
                             // Try to search it again if it wasn't found last time or if it was removed from its location
                             // Try to search it again if it wasn't found last time or if it was removed from its location
                             _msbuildToolsPath = FindMsBuildToolsPathOnWindows();
                             _msbuildToolsPath = FindMsBuildToolsPathOnWindows();
 
 
-                            if (_msbuildToolsPath.Empty())
-                            {
-                                throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMsbuildVs}'.");
-                            }
+                            if (string.IsNullOrEmpty(_msbuildToolsPath))
+                                throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMSBuildVs}'.");
                         }
                         }
 
 
                         if (!_msbuildToolsPath.EndsWith("\\"))
                         if (!_msbuildToolsPath.EndsWith("\\"))
@@ -49,44 +47,48 @@ namespace GodotTools.Build
                         string msbuildPath = Path.Combine(Internal.MonoWindowsInstallRoot, "bin", "msbuild.bat");
                         string msbuildPath = Path.Combine(Internal.MonoWindowsInstallRoot, "bin", "msbuild.bat");
 
 
                         if (!File.Exists(msbuildPath))
                         if (!File.Exists(msbuildPath))
-                        {
-                            throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMsbuildMono}'. Tried with path: {msbuildPath}");
-                        }
+                            throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMSBuildMono}'. Tried with path: {msbuildPath}");
 
 
                         return msbuildPath;
                         return msbuildPath;
                     }
                     }
                     case BuildManager.BuildTool.JetBrainsMsBuild:
                     case BuildManager.BuildTool.JetBrainsMsBuild:
+                    {
                         var editorPath = (string)editorSettings.GetSetting(RiderPathManager.EditorPathSettingName);
                         var editorPath = (string)editorSettings.GetSetting(RiderPathManager.EditorPathSettingName);
+
                         if (!File.Exists(editorPath))
                         if (!File.Exists(editorPath))
                             throw new FileNotFoundException($"Cannot find Rider executable. Tried with path: {editorPath}");
                             throw new FileNotFoundException($"Cannot find Rider executable. Tried with path: {editorPath}");
-                        var riderDir = new FileInfo(editorPath).Directory.Parent;
-                        return Path.Combine(riderDir.FullName, @"tools\MSBuild\Current\Bin\MSBuild.exe");
+
+                        var riderDir = new FileInfo(editorPath).Directory?.Parent;
+
+                        string msbuildPath = Path.Combine(riderDir.FullName, @"tools\MSBuild\Current\Bin\MSBuild.exe");
+
+                        if (!File.Exists(msbuildPath))
+                            throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMSBuildJetBrains}'. Tried with path: {msbuildPath}");
+
+                        return msbuildPath;
+                    }
                     default:
                     default:
                         throw new IndexOutOfRangeException("Invalid build tool in editor settings");
                         throw new IndexOutOfRangeException("Invalid build tool in editor settings");
                 }
                 }
             }
             }
 
 
-            if (OS.IsUnixLike())
+            if (OS.IsUnixLike)
             {
             {
                 if (buildTool == BuildManager.BuildTool.MsBuildMono)
                 if (buildTool == BuildManager.BuildTool.MsBuildMono)
                 {
                 {
-                    if (_msbuildUnixPath.Empty() || !File.Exists(_msbuildUnixPath))
+                    if (string.IsNullOrEmpty(_msbuildUnixPath) || !File.Exists(_msbuildUnixPath))
                     {
                     {
                         // Try to search it again if it wasn't found last time or if it was removed from its location
                         // Try to search it again if it wasn't found last time or if it was removed from its location
                         _msbuildUnixPath = FindBuildEngineOnUnix("msbuild");
                         _msbuildUnixPath = FindBuildEngineOnUnix("msbuild");
                     }
                     }
 
 
-                    if (_msbuildUnixPath.Empty())
-                    {
-                        throw new FileNotFoundException($"Cannot find binary for '{BuildManager.PropNameMsbuildMono}'");
-                    }
+                    if (string.IsNullOrEmpty(_msbuildUnixPath))
+                        throw new FileNotFoundException($"Cannot find binary for '{BuildManager.PropNameMSBuildMono}'");
 
 
                     return _msbuildUnixPath;
                     return _msbuildUnixPath;
                 }
                 }
-                else
-                {
-                    throw new IndexOutOfRangeException("Invalid build tool in editor settings");
-                }
+
+                throw new IndexOutOfRangeException("Invalid build tool in editor settings");
             }
             }
 
 
             throw new PlatformNotSupportedException();
             throw new PlatformNotSupportedException();
@@ -114,12 +116,12 @@ namespace GodotTools.Build
         {
         {
             string ret = OS.PathWhich(name);
             string ret = OS.PathWhich(name);
 
 
-            if (!ret.Empty())
+            if (!string.IsNullOrEmpty(ret))
                 return ret;
                 return ret;
 
 
             string retFallback = OS.PathWhich($"{name}.exe");
             string retFallback = OS.PathWhich($"{name}.exe");
 
 
-            if (!retFallback.Empty())
+            if (!string.IsNullOrEmpty(retFallback))
                 return retFallback;
                 return retFallback;
 
 
             foreach (string hintDir in MsBuildHintDirs)
             foreach (string hintDir in MsBuildHintDirs)
@@ -143,7 +145,7 @@ namespace GodotTools.Build
             string vsWherePath = Environment.GetEnvironmentVariable(Internal.GodotIs32Bits() ? "ProgramFiles" : "ProgramFiles(x86)");
             string vsWherePath = Environment.GetEnvironmentVariable(Internal.GodotIs32Bits() ? "ProgramFiles" : "ProgramFiles(x86)");
             vsWherePath += "\\Microsoft Visual Studio\\Installer\\vswhere.exe";
             vsWherePath += "\\Microsoft Visual Studio\\Installer\\vswhere.exe";
 
 
-            var vsWhereArgs = new[] { "-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild" };
+            var vsWhereArgs = new[] {"-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild"};
 
 
             var outputArray = new Godot.Collections.Array<string>();
             var outputArray = new Godot.Collections.Array<string>();
             int exitCode = Godot.OS.Execute(vsWherePath, vsWhereArgs,
             int exitCode = Godot.OS.Execute(vsWherePath, vsWhereArgs,
@@ -171,7 +173,7 @@ namespace GodotTools.Build
 
 
                 string value = line.Substring(sepIdx + 1).StripEdges();
                 string value = line.Substring(sepIdx + 1).StripEdges();
 
 
-                if (value.Empty())
+                if (string.IsNullOrEmpty(value))
                     throw new FormatException("installationPath value is empty");
                     throw new FormatException("installationPath value is empty");
 
 
                 if (!value.EndsWith("\\"))
                 if (!value.EndsWith("\\"))

+ 6 - 8
modules/mono/editor/GodotTools/GodotTools/BuildManager.cs

@@ -15,9 +15,9 @@ namespace GodotTools
     {
     {
         private static readonly List<BuildInfo> BuildsInProgress = new List<BuildInfo>();
         private static readonly List<BuildInfo> BuildsInProgress = new List<BuildInfo>();
 
 
-        public const string PropNameMsbuildMono = "MSBuild (Mono)";
-        public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)";
-        public const string PropNameMsbuildJetBrains = "MSBuild (JetBrains Rider)";
+        public const string PropNameMSBuildMono = "MSBuild (Mono)";
+        public const string PropNameMSBuildVs = "MSBuild (VS Build Tools)";
+        public const string PropNameMSBuildJetBrains = "MSBuild (JetBrains Rider)";
 
 
         public const string MsBuildIssuesFileName = "msbuild_issues.csv";
         public const string MsBuildIssuesFileName = "msbuild_issues.csv";
         public const string MsBuildLogFileName = "msbuild_log.txt";
         public const string MsBuildLogFileName = "msbuild_log.txt";
@@ -251,9 +251,7 @@ namespace GodotTools
             var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
             var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
             var msbuild = BuildTool.MsBuildMono;
             var msbuild = BuildTool.MsBuildMono;
             if (OS.IsWindows)
             if (OS.IsWindows)
-                msbuild = RiderPathManager.IsExternalEditorSetToRider(editorSettings)
-                        ? BuildTool.JetBrainsMsBuild
-                        : BuildTool.MsBuildVs;
+                msbuild = RiderPathManager.IsExternalEditorSetToRider(editorSettings) ? BuildTool.JetBrainsMsBuild : BuildTool.MsBuildVs;
 
 
             EditorDef("mono/builds/build_tool", msbuild);
             EditorDef("mono/builds/build_tool", msbuild);
 
 
@@ -263,8 +261,8 @@ namespace GodotTools
                 ["name"] = "mono/builds/build_tool",
                 ["name"] = "mono/builds/build_tool",
                 ["hint"] = Godot.PropertyHint.Enum,
                 ["hint"] = Godot.PropertyHint.Enum,
                 ["hint_string"] = OS.IsWindows ?
                 ["hint_string"] = OS.IsWindows ?
-                    $"{PropNameMsbuildMono},{PropNameMsbuildVs},{PropNameMsbuildJetBrains}" :
-                    $"{PropNameMsbuildMono}"
+                    $"{PropNameMSBuildMono},{PropNameMSBuildVs},{PropNameMSBuildJetBrains}" :
+                    $"{PropNameMSBuildMono}"
             });
             });
 
 
             EditorDef("mono/builds/print_build_output", false);
             EditorDef("mono/builds/print_build_output", false);

+ 6 - 6
modules/mono/editor/GodotTools/GodotTools/BuildTab.cs

@@ -72,7 +72,7 @@ namespace GodotTools
                     {
                     {
                         string[] csvColumns = file.GetCsvLine();
                         string[] csvColumns = file.GetCsvLine();
 
 
-                        if (csvColumns.Length == 1 && csvColumns[0].Empty())
+                        if (csvColumns.Length == 1 && string.IsNullOrEmpty(csvColumns[0]))
                             return;
                             return;
 
 
                         if (csvColumns.Length != 7)
                         if (csvColumns.Length != 7)
@@ -115,12 +115,12 @@ namespace GodotTools
             // Get correct issue idx from issue list
             // Get correct issue idx from issue list
             int issueIndex = (int)issuesList.GetItemMetadata(idx);
             int issueIndex = (int)issuesList.GetItemMetadata(idx);
 
 
-            if (idx < 0 || idx >= issues.Count)
+            if (issueIndex < 0 || issueIndex >= issues.Count)
                 throw new IndexOutOfRangeException("Issue index out of range");
                 throw new IndexOutOfRangeException("Issue index out of range");
 
 
             BuildIssue issue = issues[issueIndex];
             BuildIssue issue = issues[issueIndex];
 
 
-            if (issue.ProjectFile.Empty() && issue.File.Empty())
+            if (string.IsNullOrEmpty(issue.ProjectFile) && string.IsNullOrEmpty(issue.File))
                 return;
                 return;
 
 
             string projectDir = issue.ProjectFile.Length > 0 ? issue.ProjectFile.GetBaseDir() : BuildInfo.Solution.GetBaseDir();
             string projectDir = issue.ProjectFile.Length > 0 ? issue.ProjectFile.GetBaseDir() : BuildInfo.Solution.GetBaseDir();
@@ -158,14 +158,14 @@ namespace GodotTools
                     string tooltip = string.Empty;
                     string tooltip = string.Empty;
                     tooltip += $"Message: {issue.Message}";
                     tooltip += $"Message: {issue.Message}";
 
 
-                    if (!issue.Code.Empty())
+                    if (!string.IsNullOrEmpty(issue.Code))
                         tooltip += $"\nCode: {issue.Code}";
                         tooltip += $"\nCode: {issue.Code}";
 
 
                     tooltip += $"\nType: {(issue.Warning ? "warning" : "error")}";
                     tooltip += $"\nType: {(issue.Warning ? "warning" : "error")}";
 
 
                     string text = string.Empty;
                     string text = string.Empty;
 
 
-                    if (!issue.File.Empty())
+                    if (!string.IsNullOrEmpty(issue.File))
                     {
                     {
                         text += $"{issue.File}({issue.Line},{issue.Column}): ";
                         text += $"{issue.File}({issue.Line},{issue.Column}): ";
 
 
@@ -174,7 +174,7 @@ namespace GodotTools
                         tooltip += $"\nColumn: {issue.Column}";
                         tooltip += $"\nColumn: {issue.Column}";
                     }
                     }
 
 
-                    if (!issue.ProjectFile.Empty())
+                    if (!string.IsNullOrEmpty(issue.ProjectFile))
                         tooltip += $"\nProject: {issue.ProjectFile}";
                         tooltip += $"\nProject: {issue.ProjectFile}";
 
 
                     text += issue.Message;
                     text += issue.Message;

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs

@@ -587,7 +587,7 @@ MONO_AOT_MODE_LAST = 1000,
                         string arch = "x86_64";
                         string arch = "x86_64";
                         return $"{platform}-{arch}";
                         return $"{platform}-{arch}";
                     }
                     }
-                case OS.Platforms.X11:
+                case OS.Platforms.LinuxBSD:
                 case OS.Platforms.Server:
                 case OS.Platforms.Server:
                     {
                     {
                         string arch = bits == "64" ? "x86_64" : "i686";
                         string arch = bits == "64" ? "x86_64" : "i686";

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

@@ -414,7 +414,7 @@ namespace GodotTools.Export
                 case OS.Platforms.UWP:
                 case OS.Platforms.UWP:
                     return "net_4_x_win";
                     return "net_4_x_win";
                 case OS.Platforms.OSX:
                 case OS.Platforms.OSX:
-                case OS.Platforms.X11:
+                case OS.Platforms.LinuxBSD:
                 case OS.Platforms.Server:
                 case OS.Platforms.Server:
                 case OS.Platforms.Haiku:
                 case OS.Platforms.Haiku:
                     return "net_4_x";
                     return "net_4_x";

+ 4 - 6
modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs

@@ -256,10 +256,9 @@ namespace GodotTools
 
 
                     break;
                     break;
                 }
                 }
-
                 case ExternalEditorId.VsCode:
                 case ExternalEditorId.VsCode:
                 {
                 {
-                    if (_vsCodePath.Empty() || !File.Exists(_vsCodePath))
+                    if (string.IsNullOrEmpty(_vsCodePath) || !File.Exists(_vsCodePath))
                     {
                     {
                         // Try to search it again if it wasn't found last time or if it was removed from its location
                         // Try to search it again if it wasn't found last time or if it was removed from its location
                         _vsCodePath = VsCodeNames.SelectFirstNotNull(OS.PathWhich, orElse: string.Empty);
                         _vsCodePath = VsCodeNames.SelectFirstNotNull(OS.PathWhich, orElse: string.Empty);
@@ -311,7 +310,7 @@ namespace GodotTools
 
 
                     if (OS.IsOSX)
                     if (OS.IsOSX)
                     {
                     {
-                        if (!osxAppBundleInstalled && _vsCodePath.Empty())
+                        if (!osxAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath))
                         {
                         {
                             GD.PushError("Cannot find code editor: VSCode");
                             GD.PushError("Cannot find code editor: VSCode");
                             return Error.FileNotFound;
                             return Error.FileNotFound;
@@ -321,7 +320,7 @@ namespace GodotTools
                     }
                     }
                     else
                     else
                     {
                     {
-                        if (_vsCodePath.Empty())
+                        if (string.IsNullOrEmpty(_vsCodePath))
                         {
                         {
                             GD.PushError("Cannot find code editor: VSCode");
                             GD.PushError("Cannot find code editor: VSCode");
                             return Error.FileNotFound;
                             return Error.FileNotFound;
@@ -341,7 +340,6 @@ namespace GodotTools
 
 
                     break;
                     break;
                 }
                 }
-
                 default:
                 default:
                     throw new ArgumentOutOfRangeException();
                     throw new ArgumentOutOfRangeException();
             }
             }
@@ -505,7 +503,7 @@ namespace GodotTools
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
                                    $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
                                    $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
             }
             }
-            else if (OS.IsUnixLike())
+            else if (OS.IsUnixLike)
             {
             {
                 settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
                 settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +

+ 11 - 86
modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj

@@ -1,14 +1,8 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{27B00618-A6F2-4828-B922-05CAEB08C286}</ProjectGuid>
     <ProjectGuid>{27B00618-A6F2-4828-B922-05CAEB08C286}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <RootNamespace>GodotTools</RootNamespace>
-    <AssemblyName>GodotTools</AssemblyName>
-    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
-    <LangVersion>7</LangVersion>
+    <TargetFramework>net472</TargetFramework>
+    <LangVersion>7.2</LangVersion>
     <GodotApiConfiguration>Debug</GodotApiConfiguration> <!-- The Godot editor uses the Debug Godot API assemblies -->
     <GodotApiConfiguration>Debug</GodotApiConfiguration> <!-- The Godot editor uses the Debug Godot API assemblies -->
     <GodotSourceRootPath>$(SolutionDir)/../../../../</GodotSourceRootPath>
     <GodotSourceRootPath>$(SolutionDir)/../../../../</GodotSourceRootPath>
     <GodotOutputDataDir>$(GodotSourceRootPath)/bin/GodotSharp</GodotOutputDataDir>
     <GodotOutputDataDir>$(GodotSourceRootPath)/bin/GodotSharp</GodotOutputDataDir>
@@ -18,32 +12,12 @@
     <!-- The project is part of the Godot source tree -->
     <!-- The project is part of the Godot source tree -->
     <!-- Use the Godot source tree output folder instead of '$(ProjectDir)/bin' -->
     <!-- Use the Godot source tree output folder instead of '$(ProjectDir)/bin' -->
     <OutputPath>$(GodotOutputDataDir)/Tools</OutputPath>
     <OutputPath>$(GodotOutputDataDir)/Tools</OutputPath>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>portable</DebugType>
-    <Optimize>false</Optimize>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <Optimize>true</Optimize>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
+    <!-- Must not append '$(TargetFramework)' to the output path in this case -->
+    <AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <Reference Include="JetBrains.Annotations, Version=2019.1.3.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325">
-      <HintPath>..\packages\JetBrains.Annotations.2019.1.3\lib\net20\JetBrains.Annotations.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
-      <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System" />
+    <PackageReference Include="JetBrains.Annotations" Version="2019.1.3.0" ExcludeAssets="runtime" PrivateAssets="all" />
+    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
     <Reference Include="GodotSharp">
     <Reference Include="GodotSharp">
       <HintPath>$(GodotApiAssembliesDir)/GodotSharp.dll</HintPath>
       <HintPath>$(GodotApiAssembliesDir)/GodotSharp.dll</HintPath>
       <Private>False</Private>
       <Private>False</Private>
@@ -54,58 +28,9 @@
     </Reference>
     </Reference>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="Build\MsBuildFinder.cs" />
-    <Compile Include="Export\AotBuilder.cs" />
-    <Compile Include="Export\ExportPlugin.cs" />
-    <Compile Include="Export\XcodeHelper.cs" />
-    <Compile Include="ExternalEditorId.cs" />
-    <Compile Include="Ides\GodotIdeManager.cs" />
-    <Compile Include="Ides\GodotIdeServer.cs" />
-    <Compile Include="Ides\MonoDevelop\EditorId.cs" />
-    <Compile Include="Ides\MonoDevelop\Instance.cs" />
-    <Compile Include="Ides\Rider\RiderPathLocator.cs" />
-    <Compile Include="Ides\Rider\RiderPathManager.cs" />
-    <Compile Include="Internals\EditorProgress.cs" />
-    <Compile Include="Internals\GodotSharpDirs.cs" />
-    <Compile Include="Internals\Internal.cs" />
-    <Compile Include="Internals\ScriptClassParser.cs" />
-    <Compile Include="Internals\Globals.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Build\BuildSystem.cs" />
-    <Compile Include="Utils\Directory.cs" />
-    <Compile Include="Utils\File.cs" />
-    <Compile Include="Utils\NotifyAwaiter.cs" />
-    <Compile Include="Utils\OS.cs" />
-    <Compile Include="GodotSharpEditor.cs" />
-    <Compile Include="BuildManager.cs" />
-    <Compile Include="HotReloadAssemblyWatcher.cs" />
-    <Compile Include="BuildInfo.cs" />
-    <Compile Include="BuildTab.cs" />
-    <Compile Include="BottomPanel.cs" />
-    <Compile Include="CsProjOperations.cs" />
-    <Compile Include="Utils\CollectionExtensions.cs" />
-    <Compile Include="Utils\User32Dll.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\GodotTools.BuildLogger\GodotTools.BuildLogger.csproj">
-      <Project>{6ce9a984-37b1-4f8a-8fe9-609f05f071b3}</Project>
-      <Name>GodotTools.BuildLogger</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\GodotTools.IdeConnection\GodotTools.IdeConnection.csproj">
-      <Project>{92600954-25f0-4291-8e11-1fee9fc4be20}</Project>
-      <Name>GodotTools.IdeConnection</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\GodotTools.ProjectEditor\GodotTools.ProjectEditor.csproj">
-      <Project>{A8CDAD94-C6D4-4B19-A7E7-76C53CC92984}</Project>
-      <Name>GodotTools.ProjectEditor</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj">
-      <Project>{639E48BD-44E5-4091-8EDD-22D36DC0768D}</Project>
-      <Name>GodotTools.Core</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
+    <ProjectReference Include="..\GodotTools.BuildLogger\GodotTools.BuildLogger.csproj" />
+    <ProjectReference Include="..\GodotTools.IdeConnection\GodotTools.IdeConnection.csproj" />
+    <ProjectReference Include="..\GodotTools.ProjectEditor\GodotTools.ProjectEditor.csproj" />
+    <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj" />
   </ItemGroup>
   </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 </Project>
 </Project>

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs

@@ -118,7 +118,7 @@ namespace GodotTools.Ides.MonoDevelop
                     {EditorId.MonoDevelop, "MonoDevelop.exe"}
                     {EditorId.MonoDevelop, "MonoDevelop.exe"}
                 };
                 };
             }
             }
-            else if (OS.IsUnixLike())
+            else if (OS.IsUnixLike)
             {
             {
                 ExecutableNames = new Dictionary<EditorId, string>
                 ExecutableNames = new Dictionary<EditorId, string>
                 {
                 {

+ 6 - 6
modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs

@@ -36,7 +36,7 @@ namespace GodotTools.Ides.Rider
                 {
                 {
                     return CollectRiderInfosMac();
                     return CollectRiderInfosMac();
                 }
                 }
-                if (OS.IsUnixLike())
+                if (OS.IsUnixLike)
                 {
                 {
                     return CollectAllRiderPathsLinux();
                     return CollectAllRiderPathsLinux();
                 }
                 }
@@ -141,16 +141,16 @@ namespace GodotTools.Ides.Rider
             if (OS.IsOSX)
             if (OS.IsOSX)
             {
             {
                 var home = Environment.GetEnvironmentVariable("HOME");
                 var home = Environment.GetEnvironmentVariable("HOME");
-                if (string.IsNullOrEmpty(home)) 
+                if (string.IsNullOrEmpty(home))
                     return string.Empty;
                     return string.Empty;
                 var localAppData = Path.Combine(home, @"Library/Application Support");
                 var localAppData = Path.Combine(home, @"Library/Application Support");
                 return GetToolboxRiderRootPath(localAppData);
                 return GetToolboxRiderRootPath(localAppData);
             }
             }
 
 
-            if (OS.IsUnixLike())
+            if (OS.IsUnixLike)
             {
             {
                 var home = Environment.GetEnvironmentVariable("HOME");
                 var home = Environment.GetEnvironmentVariable("HOME");
-                if (string.IsNullOrEmpty(home)) 
+                if (string.IsNullOrEmpty(home))
                     return string.Empty;
                     return string.Empty;
                 var localAppData = Path.Combine(home, @".local/share");
                 var localAppData = Path.Combine(home, @".local/share");
                 return GetToolboxRiderRootPath(localAppData);
                 return GetToolboxRiderRootPath(localAppData);
@@ -209,7 +209,7 @@ namespace GodotTools.Ides.Rider
 
 
         private static string GetRelativePathToBuildTxt()
         private static string GetRelativePathToBuildTxt()
         {
         {
-            if (OS.IsWindows || OS.IsUnixLike())
+            if (OS.IsWindows || OS.IsUnixLike)
                 return "../../build.txt";
                 return "../../build.txt";
             if (OS.IsOSX)
             if (OS.IsOSX)
                 return "Contents/Resources/build.txt";
                 return "Contents/Resources/build.txt";
@@ -322,7 +322,7 @@ namespace GodotTools.Ides.Rider
         class SettingsJson
         class SettingsJson
         {
         {
             public string install_location;
             public string install_location;
-      
+
             [CanBeNull]
             [CanBeNull]
             public static string GetInstallLocationFromJson(string json)
             public static string GetInstallLocationFromJson(string json)
             {
             {

+ 0 - 26
modules/mono/editor/GodotTools/GodotTools/Properties/AssemblyInfo.cs

@@ -1,26 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("GodotTools")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("Godot Engine contributors")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]

+ 29 - 22
modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs

@@ -22,7 +22,10 @@ namespace GodotTools.Utils
         {
         {
             public const string Windows = "Windows";
             public const string Windows = "Windows";
             public const string OSX = "OSX";
             public const string OSX = "OSX";
-            public const string X11 = "X11";
+            public const string Linux = "Linux";
+            public const string FreeBSD = "FreeBSD";
+            public const string NetBSD = "NetBSD";
+            public const string BSD = "BSD";
             public const string Server = "Server";
             public const string Server = "Server";
             public const string UWP = "UWP";
             public const string UWP = "UWP";
             public const string Haiku = "Haiku";
             public const string Haiku = "Haiku";
@@ -35,7 +38,7 @@ namespace GodotTools.Utils
         {
         {
             public const string Windows = "windows";
             public const string Windows = "windows";
             public const string OSX = "osx";
             public const string OSX = "osx";
-            public const string X11 = "linuxbsd";
+            public const string LinuxBSD = "linuxbsd";
             public const string Server = "server";
             public const string Server = "server";
             public const string UWP = "uwp";
             public const string UWP = "uwp";
             public const string Haiku = "haiku";
             public const string Haiku = "haiku";
@@ -48,7 +51,10 @@ namespace GodotTools.Utils
         {
         {
             [Names.Windows] = Platforms.Windows,
             [Names.Windows] = Platforms.Windows,
             [Names.OSX] = Platforms.OSX,
             [Names.OSX] = Platforms.OSX,
-            [Names.X11] = Platforms.X11,
+            [Names.Linux] = Platforms.LinuxBSD,
+            [Names.FreeBSD] = Platforms.LinuxBSD,
+            [Names.NetBSD] = Platforms.LinuxBSD,
+            [Names.BSD] = Platforms.LinuxBSD,
             [Names.Server] = Platforms.Server,
             [Names.Server] = Platforms.Server,
             [Names.UWP] = Platforms.UWP,
             [Names.UWP] = Platforms.UWP,
             [Names.Haiku] = Platforms.Haiku,
             [Names.Haiku] = Platforms.Haiku,
@@ -62,38 +68,39 @@ namespace GodotTools.Utils
             return name.Equals(GetPlatformName(), StringComparison.OrdinalIgnoreCase);
             return name.Equals(GetPlatformName(), StringComparison.OrdinalIgnoreCase);
         }
         }
 
 
+        private static bool IsAnyOS(IEnumerable<string> names)
+        {
+            return names.Any(p => p.Equals(GetPlatformName(), StringComparison.OrdinalIgnoreCase));
+        }
+
+        private static readonly IEnumerable<string> LinuxBSDPlatforms =
+            new[] {Names.Linux, Names.FreeBSD, Names.NetBSD, Names.BSD};
+
+        private static readonly IEnumerable<string> UnixLikePlatforms =
+            new[] {Names.OSX, Names.Server, Names.Haiku, Names.Android, Names.iOS}
+                .Concat(LinuxBSDPlatforms).ToArray();
+
         private static readonly Lazy<bool> _isWindows = new Lazy<bool>(() => IsOS(Names.Windows));
         private static readonly Lazy<bool> _isWindows = new Lazy<bool>(() => IsOS(Names.Windows));
         private static readonly Lazy<bool> _isOSX = new Lazy<bool>(() => IsOS(Names.OSX));
         private static readonly Lazy<bool> _isOSX = new Lazy<bool>(() => IsOS(Names.OSX));
-        private static readonly Lazy<bool> _isX11 = new Lazy<bool>(() => IsOS(Names.X11));
+        private static readonly Lazy<bool> _isLinuxBSD = new Lazy<bool>(() => IsAnyOS(LinuxBSDPlatforms));
         private static readonly Lazy<bool> _isServer = new Lazy<bool>(() => IsOS(Names.Server));
         private static readonly Lazy<bool> _isServer = new Lazy<bool>(() => IsOS(Names.Server));
         private static readonly Lazy<bool> _isUWP = new Lazy<bool>(() => IsOS(Names.UWP));
         private static readonly Lazy<bool> _isUWP = new Lazy<bool>(() => IsOS(Names.UWP));
         private static readonly Lazy<bool> _isHaiku = new Lazy<bool>(() => IsOS(Names.Haiku));
         private static readonly Lazy<bool> _isHaiku = new Lazy<bool>(() => IsOS(Names.Haiku));
         private static readonly Lazy<bool> _isAndroid = new Lazy<bool>(() => IsOS(Names.Android));
         private static readonly Lazy<bool> _isAndroid = new Lazy<bool>(() => IsOS(Names.Android));
         private static readonly Lazy<bool> _isiOS = new Lazy<bool>(() => IsOS(Names.iOS));
         private static readonly Lazy<bool> _isiOS = new Lazy<bool>(() => IsOS(Names.iOS));
         private static readonly Lazy<bool> _isHTML5 = new Lazy<bool>(() => IsOS(Names.HTML5));
         private static readonly Lazy<bool> _isHTML5 = new Lazy<bool>(() => IsOS(Names.HTML5));
+        private static readonly Lazy<bool> _isUnixLike = new Lazy<bool>(() => IsAnyOS(UnixLikePlatforms));
 
 
         public static bool IsWindows => _isWindows.Value || IsUWP;
         public static bool IsWindows => _isWindows.Value || IsUWP;
         public static bool IsOSX => _isOSX.Value;
         public static bool IsOSX => _isOSX.Value;
-        public static bool IsX11 => _isX11.Value;
+        public static bool IsLinuxBSD => _isLinuxBSD.Value;
         public static bool IsServer => _isServer.Value;
         public static bool IsServer => _isServer.Value;
         public static bool IsUWP => _isUWP.Value;
         public static bool IsUWP => _isUWP.Value;
         public static bool IsHaiku => _isHaiku.Value;
         public static bool IsHaiku => _isHaiku.Value;
         public static bool IsAndroid => _isAndroid.Value;
         public static bool IsAndroid => _isAndroid.Value;
         public static bool IsiOS => _isiOS.Value;
         public static bool IsiOS => _isiOS.Value;
         public static bool IsHTML5 => _isHTML5.Value;
         public static bool IsHTML5 => _isHTML5.Value;
-
-        private static bool? _isUnixCache;
-        private static readonly string[] UnixLikePlatforms = { Names.OSX, Names.X11, Names.Server, Names.Haiku, Names.Android, Names.iOS };
-
-        public static bool IsUnixLike()
-        {
-            if (_isUnixCache.HasValue)
-                return _isUnixCache.Value;
-
-            string osName = GetPlatformName();
-            _isUnixCache = UnixLikePlatforms.Any(p => p.Equals(osName, StringComparison.OrdinalIgnoreCase));
-            return _isUnixCache.Value;
-        }
+        public static bool IsUnixLike => _isUnixLike.Value;
 
 
         public static char PathSep => IsWindows ? ';' : ':';
         public static char PathSep => IsWindows ? ';' : ':';
 
 
@@ -121,10 +128,10 @@ namespace GodotTools.Utils
                 return searchDirs.Select(dir => Path.Combine(dir, name)).FirstOrDefault(File.Exists);
                 return searchDirs.Select(dir => Path.Combine(dir, name)).FirstOrDefault(File.Exists);
 
 
             return (from dir in searchDirs
             return (from dir in searchDirs
-                    select Path.Combine(dir, name)
+                select Path.Combine(dir, name)
                 into path
                 into path
-                    from ext in windowsExts
-                    select path + ext).FirstOrDefault(File.Exists);
+                from ext in windowsExts
+                select path + ext).FirstOrDefault(File.Exists);
         }
         }
 
 
         private static string PathWhichUnix([NotNull] string name)
         private static string PathWhichUnix([NotNull] string name)
@@ -189,7 +196,7 @@ namespace GodotTools.Utils
 
 
             startInfo.UseShellExecute = false;
             startInfo.UseShellExecute = false;
 
 
-            using (var process = new Process { StartInfo = startInfo })
+            using (var process = new Process {StartInfo = startInfo})
             {
             {
                 process.Start();
                 process.Start();
                 process.WaitForExit();
                 process.WaitForExit();

+ 0 - 5
modules/mono/editor/GodotTools/GodotTools/packages.config

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="JetBrains.Annotations" version="2019.1.3" targetFramework="net45" />
-  <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
-</packages>