-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [2.0.17] - 2022-12-06 Integration: - Fix rare deadlocks while discovering or launching Visual Studio on Windows. - Improve launching Visual Studio on macOs. Project generation: - Include analyzers from response files. - Update supported C# versions. - Performance improvements.
- Loading branch information
Unity Technologies
committed
Dec 6, 2022
1 parent
7c58d41
commit 4893e3b
Showing
16 changed files
with
410 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
Direct style: | ||
cl /EHsc /std:c++17 COMIntegration.cpp /link Shlwapi.lib /out:"..\Release\COMIntegration.exe" | ||
|
||
For a debug build with PDB: | ||
cl /EHsc /std:c++17 /Z7 /DEBUG:FULL COMIntegration.cpp /link Shlwapi.lib /out:"..\Release\COMIntegration.exe" | ||
|
||
CMake style: | ||
cmake ../COMIntegration~ -B ./build | ||
cmake --build ./build --config=release -- /p:OutDir=.. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+160 Bytes
(100%)
Editor/Plugins/AppleEventIntegration.bundle/Contents/MacOS/AppleEventIntegration
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.Unity.VisualStudio.Editor | ||
{ | ||
internal class ProcessRunnerResult | ||
{ | ||
public bool Success { get; set; } | ||
public string Output { get; set; } | ||
public string Error { get; set; } | ||
} | ||
|
||
internal static class ProcessRunner | ||
{ | ||
public const int DefaultTimeoutInMilliseconds = 300000; | ||
|
||
public static ProcessStartInfo ProcessStartInfoFor(string filename, string arguments) | ||
{ | ||
return new ProcessStartInfo | ||
{ | ||
UseShellExecute = false, | ||
CreateNoWindow = true, | ||
RedirectStandardOutput = true, | ||
RedirectStandardError = true, | ||
FileName = filename, | ||
Arguments = arguments | ||
}; | ||
} | ||
|
||
public static ProcessRunnerResult StartAndWaitForExit(string filename, string arguments, int timeoutms = DefaultTimeoutInMilliseconds, Action<string> onOutputReceived = null) | ||
{ | ||
return StartAndWaitForExit(ProcessStartInfoFor(filename, arguments), timeoutms, onOutputReceived); | ||
} | ||
|
||
public static ProcessRunnerResult StartAndWaitForExit(ProcessStartInfo processStartInfo, int timeoutms = DefaultTimeoutInMilliseconds, Action<string> onOutputReceived = null) | ||
{ | ||
var process = new Process { StartInfo = processStartInfo }; | ||
|
||
using (process) | ||
{ | ||
var sbOutput = new StringBuilder(); | ||
var sbError = new StringBuilder(); | ||
|
||
var outputSource = new TaskCompletionSource<bool>(); | ||
var errorSource = new TaskCompletionSource<bool>(); | ||
|
||
process.OutputDataReceived += (_, e) => | ||
{ | ||
Append(sbOutput, e.Data, outputSource); | ||
if (onOutputReceived != null && e.Data != null) | ||
onOutputReceived(e.Data); | ||
}; | ||
process.ErrorDataReceived += (_, e) => Append(sbError, e.Data, errorSource); | ||
|
||
process.Start(); | ||
process.BeginOutputReadLine(); | ||
process.BeginErrorReadLine(); | ||
|
||
var run = Task.Run(() => process.WaitForExit(timeoutms)); | ||
var processTask = Task.WhenAll(run, outputSource.Task, errorSource.Task); | ||
|
||
if (Task.WhenAny(Task.Delay(timeoutms), processTask).Result == processTask && run.Result) | ||
return new ProcessRunnerResult {Success = true, Error = sbError.ToString(), Output = sbOutput.ToString()}; | ||
|
||
try | ||
{ | ||
process.Kill(); | ||
} | ||
catch | ||
{ | ||
/* ignore */ | ||
} | ||
|
||
return new ProcessRunnerResult {Success = false, Error = sbError.ToString(), Output = sbOutput.ToString()}; | ||
} | ||
} | ||
|
||
private static void Append(StringBuilder sb, string data, TaskCompletionSource<bool> taskSource) | ||
{ | ||
if (data == null) | ||
{ | ||
taskSource.SetResult(true); | ||
return; | ||
} | ||
|
||
sb?.Append(data); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.