diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-12-21 17:07:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-21 17:07:18 +0100 |
commit | a10449bbbc1c04f3ca151e067974717145a396d7 (patch) | |
tree | 6587e8b336f6e99126b2c23795ed397359d312de /modules/mono/editor/GodotTools | |
parent | 78f1513928bd5a683f0a0b40d4a4fec42fb1d4f3 (diff) | |
parent | 5a3ccf4f144a00e750f023c1a1d7f9347cc54a5b (diff) |
Merge pull request #34514 from neikeq/remove-dep-on-mono-posix
Mono/C#: Remove GodotTools dependency on the Mono.Posix assembly
Diffstat (limited to 'modules/mono/editor/GodotTools')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj | 4 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj index dbd774a66a..15b9e50a8d 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj +++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj @@ -34,7 +34,6 @@ <HintPath>..\packages\JetBrains.Annotations.2019.1.3\lib\net20\JetBrains.Annotations.dll</HintPath> <Private>True</Private> </Reference> - <Reference Include="Mono.Posix" /> <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> @@ -100,8 +99,5 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> - <ItemGroup> - <Content Include="Ides\Rider\.editorconfig" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs index 5a867b7f8b..09719d8721 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs @@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Runtime.CompilerServices; -using Mono.Unix.Native; namespace GodotTools.Utils { @@ -15,6 +14,9 @@ namespace GodotTools.Utils [MethodImpl(MethodImplOptions.InternalCall)] static extern string GetPlatformName(); + [MethodImpl(MethodImplOptions.InternalCall)] + static extern bool UnixFileHasExecutableAccess(string filePath); + public static class Names { public const string Windows = "Windows"; @@ -131,7 +133,7 @@ namespace GodotTools.Utils searchDirs.Add(System.IO.Directory.GetCurrentDirectory()); // last in the list return searchDirs.Select(dir => Path.Combine(dir, name)) - .FirstOrDefault(path => File.Exists(path) && Syscall.access(path, AccessModes.X_OK) == 0); + .FirstOrDefault(path => File.Exists(path) && UnixFileHasExecutableAccess(path)); } public static void RunProcess(string command, IEnumerable<string> arguments) |