提交 31c6325a 编写于 作者: J Jared Parsons

Remove diagnostic file hack

The compiler now properly emits the determinism diagnostic file into the output directory.  MSBuild was updated to copy this file when present to the final output directory (typically emitted into the intermediate one).
上级 f173cb3e
......@@ -304,4 +304,16 @@
<AuthenticodeCertificateName>MicrosoftSHA1</AuthenticodeCertificateName>
<FakeSignToolPath>$(NuGetPackageRoot)\FakeSign\0.9.2\tools\FakeSign.exe</FakeSignToolPath>
</PropertyGroup>
<!--
When running our determinism tests we need to copy the diagnostic file from the intermediate directory
to the location of the binary. This ensures .dll and .dll.key are next to each other to be picked up
by our test scripts
-->
<Target Name="CopyDeterministicBuildDiagnosticFile" Condition="'$(DebugDeterminism)' != ''" AfterTargets="CoreCompile">
<Copy
Condition="Exists(@(IntermediateAssembly -> '%(fullpath).key'))"
SourceFiles="@(IntermediateAssembly -> '%(fullpath).key')"
DestinationFolder="$(OutDir)" />
</Target>
</Project>
......@@ -39,7 +39,7 @@ while ($i -lt 3 -and $allGood) {
& msbuild /nologo /v:m /t:clean $sln
write-host "Building the Solution"
& msbuild /nologo /v:m /m /p:BootstrapBuildPath=$buildDir /p:Features="debug-determinism=$debugDir" /p:UseRoslynAnalyzers=false $sln
& msbuild /nologo /v:m /m /p:DebugDeterminism=true /p:BootstrapBuildPath=$buildDir /p:Features=debug-determinism /p:UseRoslynAnalyzers=false $sln
pushd $debugDir
......
......@@ -60,10 +60,9 @@ public CommonCompiler(CommandLineParser parser, string responseFile, string[] ar
this.AnalyzerLoader = analyzerLoader;
#if DEBUG
string value;
if (Arguments.ParseOptions.Features.TryGetValue("debug-determinism", out value))
if (Arguments.ParseOptions.Features.ContainsKey("debug-determinism"))
{
EmitDeterminismKey(Arguments, args, baseDirectory, parser, value);
EmitDeterminismKey(Arguments, args, baseDirectory, parser);
}
#endif
}
......@@ -856,10 +855,10 @@ protected virtual CultureInfo Culture
}
}
private static void EmitDeterminismKey(CommandLineArguments args, string[] rawArgs, string baseDirectory, CommandLineParser parser, string outputDirectory)
private static void EmitDeterminismKey(CommandLineArguments args, string[] rawArgs, string baseDirectory, CommandLineParser parser)
{
var key = CreateDeterminismKey(args, rawArgs, baseDirectory, parser);
var filePath = Path.Combine(outputDirectory, args.OutputFileName + ".key");
var filePath = Path.Combine(args.OutputDirectory, args.OutputFileName + ".key");
using (var stream = PortableShim.File.Create(filePath))
{
var bytes = Encoding.UTF8.GetBytes(key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册