diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index ed53e1d0e..ca95e66f4 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -19,7 +19,7 @@ SetupStage; CompileStage; BuildProjectsForNuGetPackages; - GenerateNuGetPackagesArchive" /> + GetNuGetPackagesArchive" /> diff --git a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets index 04620d875..acb9e16c8 100644 --- a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets +++ b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets @@ -1,9 +1,56 @@ + + + + + + + + + + + + $(CoreSetupChannel)/Binaries/$(SharedFrameworkVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + + + + + + + + + + + Inputs="$(IntermediateArchive)" + Outputs="$(IntermediateArchive)"> + + true + + @@ -31,28 +78,18 @@ Configuration="$(Configuration)" /> - - + nuGetPackagesArchive.$(SharedFrameworkVersion).lzma $(IntermediateDirectory)/NuGetPackagesArchiveProject $(IntermediateDirectory)/NuGetPackagesArchiveFolder $(ToolsOutputDirectory)/Archiver.dll - $(IntermediateDirectory)/nuGetPackagesArchive.lzma + $(IntermediateDirectory)/$(NugetPackagesArchiveName) $(Stage2Directory)/sdk/$(SdkVersion)/nuGetPackagesArchive.lzma + $(SharedFrameworkArchiveBlobRootUrl)/$(NugetPackagesArchiveName) - - - - - - \ No newline at end of file diff --git a/build_projects/dotnet-cli-build/DownloadFile.cs b/build_projects/dotnet-cli-build/DownloadFile.cs index 6c8633f07..f207a75bf 100644 --- a/build_projects/dotnet-cli-build/DownloadFile.cs +++ b/build_projects/dotnet-cli-build/DownloadFile.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using System.IO; using System.Net.Http; using Microsoft.Build.Framework; @@ -33,9 +34,17 @@ namespace Microsoft.DotNet.Cli.Build { var getTask = httpClient.GetStreamAsync(Uri); - using (var outStream = File.Create(DestinationPath)) + try { - getTask.Result.CopyTo(outStream); + using (var outStream = File.Create(DestinationPath)) + { + getTask.Result.CopyTo(outStream); + } + } + catch (Exception) + { + File.Delete(DestinationPath); + throw; } }