Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
40aa31e9
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
40aa31e9
编写于
10月 27, 2016
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Everything compiling again
上级
d00363d8
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
682 addition
and
527 deletion
+682
-527
Compilers.sln
Compilers.sln
+1
-0
src/Compilers/CSharp/CscCore/CscCore.csproj
src/Compilers/CSharp/CscCore/CscCore.csproj
+4
-1
src/Compilers/CSharp/csc/csc.csproj
src/Compilers/CSharp/csc/csc.csproj
+7
-1
src/Compilers/Core/CommandLine/CommandLine.projitems
src/Compilers/Core/CommandLine/CommandLine.projitems
+0
-1
src/Compilers/Core/MSBuildTask/Csc.cs
src/Compilers/Core/MSBuildTask/Csc.cs
+3
-0
src/Compilers/Core/MSBuildTask/MSBuildTask.csproj
src/Compilers/Core/MSBuildTask/MSBuildTask.csproj
+4
-0
src/Compilers/Core/MSBuildTask/ManagedCompiler.cs
src/Compilers/Core/MSBuildTask/ManagedCompiler.cs
+9
-11
src/Compilers/Core/MSBuildTask/Utilities.cs
src/Compilers/Core/MSBuildTask/Utilities.cs
+0
-11
src/Compilers/Core/MSBuildTask/Vbc.cs
src/Compilers/Core/MSBuildTask/Vbc.cs
+3
-0
src/Compilers/Server/VBCSCompiler/DesktopBuildServerController.cs
...ilers/Server/VBCSCompiler/DesktopBuildServerController.cs
+4
-4
src/Compilers/Server/VBCSCompiler/VBCSCompiler.csproj
src/Compilers/Server/VBCSCompiler/VBCSCompiler.csproj
+7
-1
src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
...mpilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
+2
-2
src/Compilers/Server/VBCSCompilerTests/DesktopBuildClientTests.cs
...ilers/Server/VBCSCompilerTests/DesktopBuildClientTests.cs
+6
-6
src/Compilers/Server/VBCSCompilerTests/ServerUtil.cs
src/Compilers/Server/VBCSCompilerTests/ServerUtil.cs
+3
-3
src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
...ilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
+2
-2
src/Compilers/Shared/BuildClient.cs
src/Compilers/Shared/BuildClient.cs
+0
-41
src/Compilers/Shared/BuildServerConnection.cs
src/Compilers/Shared/BuildServerConnection.cs
+595
-0
src/Compilers/Shared/CoreClrBuildClient.cs
src/Compilers/Shared/CoreClrBuildClient.cs
+1
-1
src/Compilers/Shared/DesktopBuildClient.cs
src/Compilers/Shared/DesktopBuildClient.cs
+20
-440
src/Compilers/VisualBasic/VbcCore/VbcCore.csproj
src/Compilers/VisualBasic/VbcCore/VbcCore.csproj
+4
-1
src/Compilers/VisualBasic/vbc/vbc.csproj
src/Compilers/VisualBasic/vbc/vbc.csproj
+7
-1
未找到文件。
Compilers.sln
浏览文件 @
40aa31e9
...
...
@@ -127,6 +127,7 @@ Global
src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4
src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13
src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4
src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4
src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4
src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4
src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4
...
...
src/Compilers/CSharp/CscCore/CscCore.csproj
浏览文件 @
40aa31e9
...
...
@@ -44,6 +44,9 @@
<PlatformTarget>
AnyCPU
</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildClient.cs"
>
<Link>
BuildClient.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\CoreClrAnalyzerAssemblyLoader.cs"
>
<Link>
CoreClrAnalyzerAssemblyLoader.cs
</Link>
</Compile>
...
...
@@ -69,4 +72,4 @@
</ItemGroup>
<Import
Project=
"..\..\Core\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
</Project>
\ No newline at end of file
src/Compilers/CSharp/csc/csc.csproj
浏览文件 @
40aa31e9
...
...
@@ -35,6 +35,12 @@
<Reference
Include=
"System"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildClient.cs"
>
<Link>
BuildClient.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\BuildServerConnection.cs"
>
<Link>
BuildServerConnection.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\DesktopBuildClient.cs"
>
<Link>
DesktopBuildClient.cs
</Link>
</Compile>
...
...
@@ -61,4 +67,4 @@
</ItemGroup>
<Import
Project=
"..\..\Core\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
</Project>
\ No newline at end of file
src/Compilers/Core/CommandLine/CommandLine.projitems
浏览文件 @
40aa31e9
...
...
@@ -10,7 +10,6 @@
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)BuildProtocol.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)BuildClient.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConsoleUtil.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)NativeMethods.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)CompilerServerLogger.cs"
/>
...
...
src/Compilers/Core/MSBuildTask/Csc.cs
浏览文件 @
40aa31e9
...
...
@@ -8,6 +8,7 @@
using
Microsoft.Build.Framework
;
using
Microsoft.Build.Tasks.Hosting
;
using
Microsoft.Build.Utilities
;
using
Microsoft.CodeAnalysis.CommandLine
;
namespace
Microsoft.CodeAnalysis.BuildTasks
{
...
...
@@ -277,6 +278,8 @@ protected internal override void AddResponseFileCommands(CommandLineBuilderExten
#
endregion
internal
override
RequestLanguage
Language
=>
RequestLanguage
.
CSharpCompile
;
/// <summary>
/// The C# compiler (starting with Whidbey) supports assembly aliasing for references.
/// See spec at http://devdiv/spectool/Documents/Whidbey/VCSharp/Design%20Time/M3%20DCRs/DCR%20Assembly%20aliases.doc.
...
...
src/Compilers/Core/MSBuildTask/MSBuildTask.csproj
浏览文件 @
40aa31e9
...
...
@@ -31,6 +31,9 @@
<!-- A reference to the entire .NET Framework is automatically included -->
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildServerConnection.cs"
>
<Link>
BuildServerConnection.cs
</Link>
</Compile>
<Compile
Include=
"..\Portable\InternalUtilities\CommandLineUtilities.cs"
>
<Link>
CommandLineUtilities.cs
</Link>
</Compile>
...
...
@@ -69,5 +72,6 @@
<LastGenOutput>
ErrorString.Designer.cs
</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import
Project=
"..\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
\ No newline at end of file
src/Compilers/Core/MSBuildTask/ManagedCompiler.cs
浏览文件 @
40aa31e9
...
...
@@ -11,6 +11,7 @@
using
Microsoft.Build.Framework
;
using
Microsoft.Build.Utilities
;
using
Roslyn.Utilities
;
using
Microsoft.CodeAnalysis.CommandLine
;
namespace
Microsoft.CodeAnalysis.BuildTasks
{
...
...
@@ -23,6 +24,8 @@ public abstract class ManagedCompiler : ToolTask
private
CancellationTokenSource
_sharedCompileCts
;
internal
readonly
PropertyDictionary
_store
=
new
PropertyDictionary
();
internal
abstract
RequestLanguage
Language
{
get
;
}
public
ManagedCompiler
()
{
TaskResources
=
ErrorString
.
ResourceManager
;
...
...
@@ -391,12 +394,11 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
if
(!
UseSharedCompilation
||
!
string
.
IsNullOrEmpty
(
ToolPath
)
||
!
Utilities
.
IsCompilerServerSupported
)
!
BuildServerConnection
.
IsCompilerServerSupported
)
{
return
base
.
ExecuteTool
(
pathToTool
,
responseFileCommands
,
commandLineCommands
);
}
/* TODO: This needs to get fixed obviously
using
(
_sharedCompileCts
=
new
CancellationTokenSource
())
{
try
...
...
@@ -416,14 +418,14 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
Log
.
LogMessage
(
ErrorString
.
UsingSharedCompilation
,
clientDir
);
var
workingDir
=
CurrentDirectoryToUse
();
var buildPaths = new BuildPaths(
var
buildPaths
=
new
BuildPaths
Alt
(
clientDir
:
clientDir
,
// MSBuild doesn't need the .NET SDK directory
sdkDir
:
null
,
workingDir
:
workingDir
,
tempDir: Build
Client
.GetTempPath(workingDir));
tempDir
:
Build
ServerConnection
.
GetTempPath
(
workingDir
));
var responseTask =
DesktopBuildClient
.RunServerCompilation(
var
responseTask
=
BuildServerConnection
.
RunServerCompilation
(
Language
,
GetArguments
(
commandLineCommands
,
responseFileCommands
).
ToList
(),
buildPaths
,
...
...
@@ -456,12 +458,10 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
ExitCode
=
-
1
;
}
}
*/
return
ExitCode
;
}
/// <summary>
/// Try to get the directory this assembly is in. Returns null if assembly
/// was in the GAC or DLL location can not be retrieved.
...
...
@@ -572,7 +572,6 @@ private string LibDirectoryToUse()
[
Output
]
public
new
int
ExitCode
{
get
;
private
set
;
}
/*
/// <summary>
/// Handle a response from the server, reporting messages and returning
/// the appropriate exit code.
...
...
@@ -582,7 +581,7 @@ private int HandleResponse(BuildResponse response, string pathToTool, string res
switch
(
response
.
Type
)
{
case
BuildResponse
.
ResponseType
.
MismatchedVersion
:
LogErrorOutput(
CommandLineParser.MismatchedVersionErrorText
);
LogErrorOutput
(
"Roslyn compiler server reports different protocol version than build task."
);
return
-
1
;
case
BuildResponse
.
ResponseType
.
Completed
:
...
...
@@ -608,7 +607,6 @@ private int HandleResponse(BuildResponse response, string pathToTool, string res
throw
new
InvalidOperationException
(
"Encountered unknown response type"
);
}
}
*/
private
void
LogErrorOutput
(
string
output
)
{
...
...
src/Compilers/Core/MSBuildTask/Utilities.cs
浏览文件 @
40aa31e9
...
...
@@ -15,17 +15,6 @@ namespace Microsoft.CodeAnalysis.BuildTasks
/// </summary>
internal
static
class
Utilities
{
/// <summary>
/// False if the compiler server is not supported on this platform.
/// </summary>
internal
static
bool
IsCompilerServerSupported
=>
true
;
/* TODO: fix this
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
DesktopBuildClient.GetRuntimeDirectoryOpt() != null &&
// Test that we can retrieve a valid pipe name
DesktopBuildClient.GetPipeNameForPathOpt("") != null;
*/
/// <summary>
/// Convert a task item metadata to bool. Throw an exception if the string is badly formed and can't
/// be converted.
...
...
src/Compilers/Core/MSBuildTask/Vbc.cs
浏览文件 @
40aa31e9
...
...
@@ -9,6 +9,7 @@
using
Microsoft.Build.Framework
;
using
Microsoft.Build.Utilities
;
using
Microsoft.Build.Tasks.Hosting
;
using
Microsoft.CodeAnalysis.CommandLine
;
namespace
Microsoft.CodeAnalysis.BuildTasks
{
...
...
@@ -34,6 +35,8 @@ public class Vbc : ManagedCompiler
private
bool
_isDoneOutputtingErrorMessage
;
private
int
_numberOfLinesInErrorMessage
;
internal
override
RequestLanguage
Language
=>
RequestLanguage
.
VisualBasicCompile
;
#
region
Properties
// Please keep these alphabetized. These are the parameters specific to Vbc. The
...
...
src/Compilers/Server/VBCSCompiler/DesktopBuildServerController.cs
浏览文件 @
40aa31e9
...
...
@@ -80,13 +80,13 @@ protected override Task<Stream> ConnectForShutdownAsync(string pipeName, int tim
protected
override
string
GetDefaultPipeName
()
{
var
clientDirectory
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
return
DesktopBuildClient
.
GetPipeNameForPathOpt
(
clientDirectory
);
return
BuildServerConnection
.
GetPipeNameForPathOpt
(
clientDirectory
);
}
protected
override
bool
?
WasServerRunning
(
string
pipeName
)
{
string
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
return
DesktopBuildClient
.
WasServerMutexOpen
(
mutexName
);
string
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
return
BuildServerConnection
.
WasServerMutexOpen
(
mutexName
);
}
protected
override
int
RunServerCore
(
string
pipeName
,
IClientConnectionHost
connectionHost
,
IDiagnosticListener
listener
,
TimeSpan
?
keepAlive
,
CancellationToken
cancellationToken
)
...
...
@@ -94,7 +94,7 @@ protected override int RunServerCore(string pipeName, IClientConnectionHost conn
// Grab the server mutex to prevent multiple servers from starting with the same
// pipename and consuming excess resources. If someone else holds the mutex
// exit immediately with a non-zero exit code
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
bool
holdsMutex
;
using
(
var
serverMutex
=
new
Mutex
(
initiallyOwned
:
true
,
name
:
mutexName
,
...
...
src/Compilers/Server/VBCSCompiler/VBCSCompiler.csproj
浏览文件 @
40aa31e9
...
...
@@ -45,6 +45,12 @@
<Reference
Include=
"System.Core"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildClient.cs"
>
<Link>
BuildClient.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\BuildServerConnection.cs"
>
<Link>
BuildServerConnection.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\DesktopAnalyzerAssemblyLoader.cs"
>
<Link>
DesktopAnalyzerAssemblyLoader.cs
</Link>
</Compile>
...
...
@@ -77,4 +83,4 @@
<Import
Project=
"..\..\Core\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\ServerShared\ServerShared.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
</Project>
\ No newline at end of file
src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
浏览文件 @
40aa31e9
...
...
@@ -301,7 +301,7 @@ public void ClientExceptionShouldBeginShutdown()
public
void
MutexStopsServerStarting
()
{
var
pipeName
=
Guid
.
NewGuid
().
ToString
(
"N"
);
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
bool
holdsMutex
;
using
(
var
mutex
=
new
Mutex
(
initiallyOwned
:
true
,
...
...
@@ -326,7 +326,7 @@ public void MutexStopsServerStarting()
public
void
MutexAcquiredWhenRunningServer
()
{
var
pipeName
=
Guid
.
NewGuid
().
ToString
(
"N"
);
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
var
host
=
new
Mock
<
IClientConnectionHost
>(
MockBehavior
.
Strict
);
host
.
Setup
(
x
=>
x
.
CreateListenTask
(
It
.
IsAny
<
CancellationToken
>()))
...
...
src/Compilers/Server/VBCSCompilerTests/DesktopBuildClientTests.cs
浏览文件 @
40aa31e9
...
...
@@ -62,7 +62,7 @@ public bool TryConnectToNamedPipeWithSpinWait(int timeoutMs, CancellationToken c
{
using
(
var
pipeStream
=
new
NamedPipeClientStream
(
"."
,
_pipeName
,
PipeDirection
.
InOut
,
PipeOptions
.
Asynchronous
))
{
return
TryConnectToNamedPipeWithSpinWait
(
pipeStream
,
timeoutMs
,
cancellationToken
);
return
BuildServerConnection
.
TryConnectToNamedPipeWithSpinWait
(
pipeStream
,
timeoutMs
,
cancellationToken
);
}
}
}
...
...
@@ -127,7 +127,7 @@ public void ConnectToServerFails()
// compilation.
bool
holdsMutex
;
using
(
var
serverMutex
=
new
Mutex
(
initiallyOwned
:
true
,
name
:
DesktopBuildClient
.
GetServerMutexName
(
_pipeName
),
name
:
BuildServerConnection
.
GetServerMutexName
(
_pipeName
),
createdNew
:
out
holdsMutex
))
{
Assert
.
True
(
holdsMutex
);
...
...
@@ -371,10 +371,10 @@ public class MiscTest
public
void
GetBasePipeNameSlashes
()
{
var
path
=
string
.
Format
(
@"q:{0}the{0}path"
,
Path
.
DirectorySeparatorChar
);
var
name
=
DesktopBuildClient
.
GetBasePipeName
(
path
);
Assert
.
Equal
(
name
,
DesktopBuildClient
.
GetBasePipeName
(
path
));
Assert
.
Equal
(
name
,
DesktopBuildClient
.
GetBasePipeName
(
path
+
Path
.
DirectorySeparatorChar
));
Assert
.
Equal
(
name
,
DesktopBuildClient
.
GetBasePipeName
(
path
+
Path
.
DirectorySeparatorChar
+
Path
.
DirectorySeparatorChar
));
var
name
=
BuildServerConnection
.
GetBasePipeName
(
path
);
Assert
.
Equal
(
name
,
BuildServerConnection
.
GetBasePipeName
(
path
));
Assert
.
Equal
(
name
,
BuildServerConnection
.
GetBasePipeName
(
path
+
Path
.
DirectorySeparatorChar
));
Assert
.
Equal
(
name
,
BuildServerConnection
.
GetBasePipeName
(
path
+
Path
.
DirectorySeparatorChar
+
Path
.
DirectorySeparatorChar
));
}
}
}
...
...
src/Compilers/Server/VBCSCompilerTests/ServerUtil.cs
浏览文件 @
40aa31e9
...
...
@@ -95,7 +95,7 @@ internal static BuildPaths CreateBuildPaths(string workingDir, string tempDir)
var
serverStatsSource
=
new
TaskCompletionSource
<
ServerStats
>();
var
serverListenSource
=
new
TaskCompletionSource
<
bool
>();
var
cts
=
new
CancellationTokenSource
();
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
var
thread
=
new
Thread
(
_
=>
{
var
listener
=
new
TestableDiagnosticListener
();
...
...
@@ -122,7 +122,7 @@ internal static BuildPaths CreateBuildPaths(string workingDir, string tempDir)
// The contract of this function is that it will return once the server has started. Spin here until
// we can verify the server has started or simply failed to start.
while
(
DesktopBuildClient
.
WasServerMutexOpen
(
mutexName
)
!=
true
&&
thread
.
IsAlive
)
while
(
BuildServerConnection
.
WasServerMutexOpen
(
mutexName
)
!=
true
&&
thread
.
IsAlive
)
{
Thread
.
Yield
();
}
...
...
@@ -143,7 +143,7 @@ internal static ServerData CreateServerFailsConnection(string pipeName = null)
{
var
thread
=
new
Thread
(
_
=>
{
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
bool
holdsMutex
;
using
(
var
serverMutex
=
new
Mutex
(
initiallyOwned
:
true
,
name
:
mutexName
,
...
...
src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
浏览文件 @
40aa31e9
...
...
@@ -55,7 +55,7 @@ public async Task NoServerConnection()
using
(
var
doneMre
=
new
ManualResetEvent
(
initialState
:
false
))
{
var
pipeName
=
Guid
.
NewGuid
().
ToString
();
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
bool
created
=
false
;
bool
connected
=
false
;
...
...
@@ -104,7 +104,7 @@ public async Task ServerShutdownsDuringProcessing()
using
(
var
doneMre
=
new
ManualResetEvent
(
initialState
:
false
))
{
var
pipeName
=
Guid
.
NewGuid
().
ToString
();
var
mutexName
=
DesktopBuildClient
.
GetServerMutexName
(
pipeName
);
var
mutexName
=
BuildServerConnection
.
GetServerMutexName
(
pipeName
);
bool
created
=
false
;
bool
connected
=
false
;
...
...
src/Compilers/
Core/CommandLine
/BuildClient.cs
→
src/Compilers/
Shared
/BuildClient.cs
浏览文件 @
40aa31e9
...
...
@@ -207,46 +207,5 @@ private static IEnumerable<string> GetCommandLineWindows(IEnumerable<string> arg
// The first argument will be the executable name hence we skip it.
return
CommandLineParser
.
SplitCommandLineIntoArguments
(
commandLine
,
removeHashComments
:
false
).
Skip
(
1
);
}
/// <summary>
/// Gets the value of the temporary path for the current environment assuming the working directory
/// is <paramref name="workingDir"/>. This function must emulate <see cref="Path.GetTempPath"/> as
/// closely as possible.
/// </summary>
public
static
string
GetTempPath
(
string
workingDir
)
{
var
tmp
=
Environment
.
GetEnvironmentVariable
(
"TMP"
);
if
(
Path
.
IsPathRooted
(
tmp
))
{
return
tmp
;
}
var
temp
=
Environment
.
GetEnvironmentVariable
(
"TEMP"
);
if
(
Path
.
IsPathRooted
(
temp
))
{
return
temp
;
}
if
(!
string
.
IsNullOrEmpty
(
workingDir
))
{
if
(!
string
.
IsNullOrEmpty
(
tmp
))
{
return
Path
.
Combine
(
workingDir
,
tmp
);
}
if
(!
string
.
IsNullOrEmpty
(
temp
))
{
return
Path
.
Combine
(
workingDir
,
temp
);
}
}
var
userProfile
=
Environment
.
GetEnvironmentVariable
(
"USERPROFILE"
);
if
(
Path
.
IsPathRooted
(
userProfile
))
{
return
userProfile
;
}
return
Environment
.
GetEnvironmentVariable
(
"SYSTEMROOT"
);
}
}
}
src/Compilers/Shared/BuildServerConnection.cs
0 → 100644
浏览文件 @
40aa31e9
此差异已折叠。
点击以展开。
src/Compilers/Shared/CoreClrBuildClient.cs
浏览文件 @
40aa31e9
...
...
@@ -32,7 +32,7 @@ internal static int Run(IEnumerable<string> arguments, RequestLanguage language,
var
client
=
new
CoreClrBuildClient
(
language
,
compileFunc
);
var
clientDir
=
AppContext
.
BaseDirectory
;
var
workingDir
=
Directory
.
GetCurrentDirectory
();
var
tempDir
=
GetTempPath
(
workingDir
);
var
tempDir
=
Path
.
GetTempPath
(
);
var
buildPaths
=
new
BuildPaths
(
clientDir
:
clientDir
,
workingDir
:
workingDir
,
sdkDir
:
null
,
tempDir
:
tempDir
);
return
client
.
RunCompilation
(
arguments
,
buildPaths
).
ExitCode
;
}
...
...
src/Compilers/Shared/DesktopBuildClient.cs
浏览文件 @
40aa31e9
此差异已折叠。
点击以展开。
src/Compilers/VisualBasic/VbcCore/VbcCore.csproj
浏览文件 @
40aa31e9
...
...
@@ -44,6 +44,9 @@
<PlatformTarget>
AnyCPU
</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildClient.cs"
>
<Link>
BuildClient.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\CoreClrAnalyzerAssemblyLoader.cs"
>
<Link>
CoreClrAnalyzerAssemblyLoader.cs
</Link>
</Compile>
...
...
@@ -69,4 +72,4 @@
</ItemGroup>
<Import
Project=
"..\..\Core\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
</Project>
\ No newline at end of file
src/Compilers/VisualBasic/vbc/vbc.csproj
浏览文件 @
40aa31e9
...
...
@@ -35,6 +35,12 @@
<Reference
Include=
"System"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Shared\BuildClient.cs"
>
<Link>
BuildClient.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\BuildServerConnection.cs"
>
<Link>
BuildServerConnection.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Shared\DesktopBuildClient.cs"
>
<Link>
DesktopBuildClient.cs
</Link>
</Compile>
...
...
@@ -61,4 +67,4 @@
</ItemGroup>
<Import
Project=
"..\..\Core\CommandLine\CommandLine.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\VSL.Imports.targets"
/>
</Project>
</Project>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录