From 0b1a5b10c2cf6b053c24fb06612508fd9251014f Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Thu, 11 May 2017 17:56:24 -0700 Subject: [PATCH 01/17] Provide a way to not include the ASP.NET Runtime Packages --- build/BuildDefaults.props | 1 + build/BundledRuntimes.props | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 8561a45b0..ae7b03962 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -4,6 +4,7 @@ Debug true false + true true true true diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 5828d0c23..43af1746e 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -80,21 +80,21 @@ <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerWixLibFile" - Condition=" '$(AspNetCoreRuntimeInstallerWixLibFile)' != '' And !Exists('$(AspNetCoreRuntimeInstallerWixLibFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And '$(SkipBuildingInstallers)' != 'true' And '$(AspNetCoreRuntimeInstallerWixLibFile)' != '' And !Exists('$(AspNetCoreRuntimeInstallerWixLibFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerWixLibFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreRuntimeInstallerWixLibFile) <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerArchiveFile" - Condition="!Exists('$(AspNetCoreRuntimeInstallerArchiveFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreRuntimeInstallerArchiveFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerArchiveFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreRuntimeInstallerArchiveFile) $(AspNetRuntimePackageStorePublishDirectory) <_DownloadAndExtractItem Include="AspNetCoreSharedRuntimeVersionFile" - Condition="!Exists('$(AspNetCoreSharedRuntimeVersionFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreSharedRuntimeVersionFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreSharedRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreSharedRuntimeVersionFile) From 428d541627d529dfab097882f99a8bc3190ddaba Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Thu, 11 May 2017 17:58:28 -0700 Subject: [PATCH 02/17] Provide a way to not include the SDK Resolver When building the entire stack for a non windows target, the windows resolver packages will not be present (and in the case of a windows build, you'd only have one architecture anyway). Provide a way to opt out of including the resolver. It's only interesting for Visual Studio insertion cases, which is something the community at large doesn't need to worry about. --- build/BuildDefaults.props | 1 + build/Compile.targets | 5 +++-- build/Prepare.targets | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index ae7b03962..60977b327 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -5,6 +5,7 @@ true false true + true true true true diff --git a/build/Compile.targets b/build/Compile.targets index d2a3747aa..044c10303 100644 --- a/build/Compile.targets +++ b/build/Compile.targets @@ -14,11 +14,12 @@ Targets="Publish" /> - + diff --git a/build/Prepare.targets b/build/Prepare.targets index 3b373ecfc..d363483a5 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -68,7 +68,8 @@ - + + From eacc4d248c4789e0c28825200e11c526e524fae8 Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Mon, 22 May 2017 11:37:59 -0700 Subject: [PATCH 03/17] Don't pull down stage 0 from the internet The composed build will set `PREBUILT_DOTNET_TOOL_DIR` to a location where the dotnet tool can be copied from. Long term we should get rid of the copy in favor of just using one from a common location, but some of the Stage0 logic in the CLI build system will need to change, I think. --- .../update-dependencies/update-dependencies.ps1 | 4 +--- .../update-dependencies/update-dependencies.sh | 11 ++++------- run-build.ps1 | 10 +--------- run-build.sh | 8 +------- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index b76d10bc1..e6422b1b2 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -35,9 +35,7 @@ if (!$env:DOTNET_INSTALL_DIR) } # Install a stage 0 -Write-Output "Installing .NET Core CLI Stage 0" -& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture -if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } +cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index 4781c8453..8a0d7f940 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -30,15 +30,12 @@ if [ -z "${DOTNET_INSTALL_DIR:-}" ]; then export DOTNET_INSTALL_DIR=$REPO_ROOT/.dotnet_stage0/x64 fi -# Install a stage 0 -echo "Installing .NET Core CLI Stage 0" -$REPO_ROOT/scripts/obtain/dotnet-install.sh -Channel master -Architecture x64 - -if [ $? -ne 0 ]; then - echo "Failed to install stage 0" - exit 1 +if [ ! -d "$DOTNET_INSTALL_DIR" ]; then + mkdir -p $DOTNET_INSTALL_DIR fi +cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ + # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH diff --git a/run-build.ps1 b/run-build.ps1 index 6acbb15ce..ea5df284b 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -66,15 +66,7 @@ $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 # install a stage0 -$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" - -Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -if ($LastExitCode -ne 0) -{ - Write-Output "The .NET CLI installation failed with exit code $LastExitCode" - exit $LastExitCode -} +cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/run-build.sh b/run-build.sh index 0dce787e9..4d1959cf0 100755 --- a/run-build.sh +++ b/run-build.sh @@ -150,13 +150,7 @@ export VSTEST_TRACE_BUILD=1 export DOTNET_MULTILEVEL_LOOKUP=0 # Install a stage 0 -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) - -EXIT_CODE=$? -if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE -fi +cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" From 218b887d87f268b3b06a6a5d6b83ea79c349248b Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 08:10:22 -0700 Subject: [PATCH 04/17] Download stage0 when DOTNET_TOOL_DIR is not set --- .../update-dependencies/update-dependencies.ps1 | 12 +++++++++++- .../update-dependencies/update-dependencies.sh | 13 ++++++++++++- run-build.ps1 | 17 ++++++++++++++++- run-build.sh | 13 ++++++++++++- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index e6422b1b2..4c70b197b 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -35,7 +35,17 @@ if (!$env:DOTNET_INSTALL_DIR) } # Install a stage 0 -cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR + Write-Output "Installing .NET Core CLI Stage 0" + +if (!$env:DOTNET_TOOL_DIR) +{ + & "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture + if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } +} +else +{ + cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR +} # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index 8a0d7f940..fadffe928 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -33,8 +33,19 @@ fi if [ ! -d "$DOTNET_INSTALL_DIR" ]; then mkdir -p $DOTNET_INSTALL_DIR fi +# Install a stage 0 +echo "Installing .NET Core CLI Stage 0" -cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ +if [ -z "$DOTNET_TOOL_DIR" ]; then + $REPO_ROOT/scripts/obtain/dotnet-install.sh -Channel master -Architecture x64 + + if [ $? -ne 0 ]; then + echo "Failed to install stage 0" + exit 1 + fi +else + cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ +fi # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH diff --git a/run-build.ps1 b/run-build.ps1 index ea5df284b..b0b04dbff 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -66,7 +66,22 @@ $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 # install a stage0 -cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR +if (!$env:DOTNET_TOOL_DIR) +{ + $dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" + + Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" + Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" + if ($LastExitCode -ne 0) + { + Write-Output "The .NET CLI installation failed with exit code $LastExitCode" + exit $LastExitCode + } +} +else +{ + cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR +} # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/run-build.sh b/run-build.sh index 4d1959cf0..f4e7a90ed 100755 --- a/run-build.sh +++ b/run-build.sh @@ -150,7 +150,18 @@ export VSTEST_TRACE_BUILD=1 export DOTNET_MULTILEVEL_LOOKUP=0 # Install a stage 0 -cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ +if [ -z "$DOTNET_TOOL_DIR" ]; then + (set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) + + EXIT_CODE=$? + if [ $EXIT_CODE != 0 ]; then + echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 + exit $EXIT_CODE + fi +else + cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ +fi + # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" From 16ec23f86b1a32083868e20b097b1f7632111bf8 Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Wed, 24 May 2017 17:28:07 -0700 Subject: [PATCH 05/17] Provide a way to explicitly set commit count and sha --- build/GitCommitInfo.targets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/GitCommitInfo.targets b/build/GitCommitInfo.targets index 6ac729e50..a81e1a7f3 100644 --- a/build/GitCommitInfo.targets +++ b/build/GitCommitInfo.targets @@ -1,12 +1,14 @@ + ConsoleToMSBuild="true" + Condition="'$(GitInfoCommitCount)' == ''"> + ConsoleToMSBuild="true" + Condition="'$(GitInfoCommitHash)' == ''"> From ce7d434ae89427d1070e8dcaf499dd7ca1bed8dc Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Fri, 9 Jun 2017 16:53:50 -0700 Subject: [PATCH 06/17] Remove some unneeded package references --- build_projects/dotnet-cli-build/dotnet-cli-build.csproj | 9 --------- .../shared-build-targets-utils.csproj | 2 -- 2 files changed, 11 deletions(-) diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 2b6c115d8..1dde3cee3 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -15,19 +15,10 @@ - - - - - - - - diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index ed7002589..042a5fe8a 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -13,8 +13,6 @@ - - From 62224b34359d653cf5c14b790f5cfc30cd52baf3 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 08:27:37 -0700 Subject: [PATCH 07/17] Add back NuGet.Protocol dependency --- build_projects/dotnet-cli-build/dotnet-cli-build.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 1dde3cee3..a21e6b05f 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -18,6 +18,7 @@ + From b63fb1aaf8646e15769d5c72144be887202b269a Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Fri, 9 Jun 2017 17:01:01 -0700 Subject: [PATCH 08/17] Remove Azure dependency from build --- ...icrosoft.DotNet.Cli.Build.Framework.csproj | 2 +- .../Publishing/AzurePublisher.cs | 166 ++---------------- .../shared-build-targets-utils.csproj | 4 +- 3 files changed, 19 insertions(+), 153 deletions(-) diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj index fefc8affe..ea3d8e435 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj +++ b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj @@ -12,7 +12,7 @@ - + diff --git a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs index 1f1047644..6b0400faa 100644 --- a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs +++ b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs @@ -9,9 +9,6 @@ using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Microsoft.WindowsAzure.Storage; -using Microsoft.WindowsAzure.Storage.Auth; -using Microsoft.WindowsAzure.Storage.Blob; namespace Microsoft.DotNet.Cli.Build { @@ -25,113 +22,44 @@ namespace Microsoft.DotNet.Cli.Build Sdk, } - private const string s_dotnetBlobContainerName = "dotnet"; - - private string _connectionString { get; set; } - private string _containerName { get; set; } - private CloudBlobContainer _blobContainer { get; set; } - - public AzurePublisher(string containerName = s_dotnetBlobContainerName) + public AzurePublisher(string containerName) { - _connectionString = EnvVars.EnsureVariable("CONNECTION_STRING").Trim('"'); - _containerName = containerName; - _blobContainer = GetDotnetBlobContainer(_connectionString, containerName); + throw new NotImplementedException(); } - public AzurePublisher(string accountName, string accountKey, string containerName = s_dotnetBlobContainerName) + public AzurePublisher(string accountName, string accountKey, string containerName) { - _containerName = containerName; - _blobContainer = GetDotnetBlobContainer(accountName, accountKey, containerName); - } - - private CloudBlobContainer GetDotnetBlobContainer(string connectionString, string containerName) - { - CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString); - - return GetDotnetBlobContainer(storageAccount, containerName); - } - - private CloudBlobContainer GetDotnetBlobContainer(string accountName, string accountKey, string containerName) - { - var storageCredentials = new StorageCredentials(accountName, accountKey); - var storageAccount = new CloudStorageAccount(storageCredentials, true); - return GetDotnetBlobContainer(storageAccount, containerName); - } - - private CloudBlobContainer GetDotnetBlobContainer(CloudStorageAccount storageAccount, string containerName) - { - CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); - - return blobClient.GetContainerReference(containerName); + throw new NotImplementedException(); } public string UploadFile(string file, Product product, string version) { - string url = CalculateRelativePathForFile(file, product, version); - CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(url); - blob.UploadFromFileAsync(file).Wait(); - SetBlobPropertiesBasedOnFileType(blob); - return url; + throw new NotImplementedException(); } public void PublishStringToBlob(string blob, string content) { - CloudBlockBlob blockBlob = _blobContainer.GetBlockBlobReference(blob); - blockBlob.UploadTextAsync(content).Wait(); - - SetBlobPropertiesBasedOnFileType(blockBlob); + throw new NotImplementedException(); } public void CopyBlob(string sourceBlob, string targetBlob) { - CloudBlockBlob source = _blobContainer.GetBlockBlobReference(sourceBlob); - CloudBlockBlob target = _blobContainer.GetBlockBlobReference(targetBlob); - - // Create the empty blob - using (MemoryStream ms = new MemoryStream()) - { - target.UploadFromStreamAsync(ms).Wait(); - } - - // Copy actual blob data - target.StartCopyAsync(source).Wait(); + throw new NotImplementedException(); } public void SetBlobPropertiesBasedOnFileType(string path) { - CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(path); - SetBlobPropertiesBasedOnFileType(blob); - } - - private void SetBlobPropertiesBasedOnFileType(CloudBlockBlob blockBlob) - { - if (Path.GetExtension(blockBlob.Uri.AbsolutePath.ToLower()) == ".svg") - { - blockBlob.Properties.ContentType = "image/svg+xml"; - blockBlob.Properties.CacheControl = "no-cache"; - blockBlob.SetPropertiesAsync().Wait(); - } - else if (Path.GetExtension(blockBlob.Uri.AbsolutePath.ToLower()) == ".version") - { - blockBlob.Properties.ContentType = "text/plain"; - blockBlob.Properties.CacheControl = "no-cache"; - blockBlob.SetPropertiesAsync().Wait(); - } + throw new NotImplementedException(); } public IEnumerable ListBlobs(Product product, string version) { - string virtualDirectory = $"{product}/{version}"; - return ListBlobs(virtualDirectory); + throw new NotImplementedException(); } public IEnumerable ListBlobs(string virtualDirectory) { - CloudBlobDirectory blobDir = _blobContainer.GetDirectoryReference(virtualDirectory); - BlobContinuationToken continuationToken = new BlobContinuationToken(); - - var blobFiles = blobDir.ListBlobsSegmentedAsync(continuationToken).Result; - return blobFiles.Results.Select(bf => bf.Uri.PathAndQuery.Replace($"/{_containerName}/", string.Empty)); + throw new NotImplementedException(); } public string AcquireLeaseOnBlob( @@ -139,94 +67,32 @@ namespace Microsoft.DotNet.Cli.Build TimeSpan? maxWaitDefault = null, TimeSpan? delayDefault = null) { - TimeSpan maxWait = maxWaitDefault ?? TimeSpan.FromSeconds(120); - TimeSpan delay = delayDefault ?? TimeSpan.FromMilliseconds(500); - - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); - - // This will throw an exception with HTTP code 409 when we cannot acquire the lease - // But we should block until we can get this lease, with a timeout (maxWaitSeconds) - while (stopWatch.ElapsedMilliseconds < maxWait.TotalMilliseconds) - { - try - { - CloudBlockBlob cloudBlob = _blobContainer.GetBlockBlobReference(blob); - Task task = cloudBlob.AcquireLeaseAsync(TimeSpan.FromMinutes(1), null); - task.Wait(); - return task.Result; - } - catch (Exception e) - { - Console.WriteLine($"Retrying lease acquisition on {blob}, {e.Message}"); - Thread.Sleep(delay); - } - } - - throw new Exception($"Unable to acquire lease on {blob}"); + throw new NotImplementedException(); } public void ReleaseLeaseOnBlob(string blob, string leaseId) { - CloudBlockBlob cloudBlob = _blobContainer.GetBlockBlobReference(blob); - AccessCondition ac = new AccessCondition() { LeaseId = leaseId }; - cloudBlob.ReleaseLeaseAsync(ac).Wait(); + throw new NotImplementedException(); } public bool IsLatestSpecifiedVersion(string version) { - Task task = _blobContainer.GetBlockBlobReference(version).ExistsAsync(); - task.Wait(); - return task.Result; + throw new NotImplementedException(); } public void DropLatestSpecifiedVersion(string version) { - CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(version); - using (MemoryStream ms = new MemoryStream()) - { - blob.UploadFromStreamAsync(ms).Wait(); - } + throw new NotImplementedException(); } public void CreateBlobIfNotExists(string path) { - Task task = _blobContainer.GetBlockBlobReference(path).ExistsAsync(); - task.Wait(); - if (!task.Result) - { - CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(path); - using (MemoryStream ms = new MemoryStream()) - { - blob.UploadFromStreamAsync(ms).Wait(); - } - } + throw new NotImplementedException(); } public bool TryDeleteBlob(string path) { - try - { - DeleteBlob(path); - - return true; - } - catch (Exception e) - { - Console.WriteLine($"Deleting blob {path} failed with \r\n{e.Message}"); - - return false; - } - } - - private void DeleteBlob(string path) - { - _blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait(); - } - - private static string CalculateRelativePathForFile(string file, Product product, string version) - { - return $"{product}/{version}/{Path.GetFileName(file)}"; + throw new NotImplementedException(); } } } diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index 042a5fe8a..614b438f1 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -12,13 +12,13 @@ + - - + From 5a1021ac4bd97c61a7584c1b8279f34e7a352ce3 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 10:34:32 -0700 Subject: [PATCH 09/17] Only remove Azure dependency for source builds --- build/BuildDefaults.props | 2 + .../CheckIfAllBuildsHavePublished.cs | 4 + .../dotnet-cli-build/CopyBlobsToLatest.cs | 2 + .../SetBlobPropertiesBasedOnFileTypeTask.cs | 4 + .../Publishing/AzurePublisher.cs | 168 ++++++++++++++++-- .../shared-build-targets-utils.csproj | 1 + 6 files changed, 165 insertions(+), 16 deletions(-) diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 60977b327..fc76770a0 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -18,5 +18,7 @@ NU1701 true + + $(DefineConstants);SOURCE_BUILD diff --git a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs index 1dfb0b3de..090a128be 100644 --- a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs +++ b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs @@ -1,6 +1,8 @@ // 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. +#if !SOURCE_BUILD + using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System; @@ -84,3 +86,5 @@ namespace Microsoft.DotNet.Cli.Build } } } + +#endif diff --git a/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs b/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs index 3078a2b39..1adab0114 100644 --- a/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs +++ b/build_projects/dotnet-cli-build/CopyBlobsToLatest.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. +#if !SOURCE_BUILD using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.IO; @@ -112,3 +113,4 @@ namespace Microsoft.DotNet.Cli.Build } } } +#endif diff --git a/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs b/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs index d4caddc04..6a7c8d446 100644 --- a/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs +++ b/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs @@ -1,6 +1,8 @@ // 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. +#if !SOURCE_BUILD + using System; using System.Collections.Generic; using System.IO; @@ -65,3 +67,5 @@ namespace Microsoft.DotNet.Cli.Build } } } + +#endif \ No newline at end of file diff --git a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs index 6b0400faa..5d77dfc76 100644 --- a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs +++ b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.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. +#if !SOURCE_BUILD using System; using System.Collections.Generic; using System.Diagnostics; @@ -9,6 +10,9 @@ using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Microsoft.WindowsAzure.Storage; +using Microsoft.WindowsAzure.Storage.Auth; +using Microsoft.WindowsAzure.Storage.Blob; namespace Microsoft.DotNet.Cli.Build { @@ -22,44 +26,113 @@ namespace Microsoft.DotNet.Cli.Build Sdk, } - public AzurePublisher(string containerName) + private const string s_dotnetBlobContainerName = "dotnet"; + + private string _connectionString { get; set; } + private string _containerName { get; set; } + private CloudBlobContainer _blobContainer { get; set; } + + public AzurePublisher(string containerName = s_dotnetBlobContainerName) { - throw new NotImplementedException(); + _connectionString = EnvVars.EnsureVariable("CONNECTION_STRING").Trim('"'); + _containerName = containerName; + _blobContainer = GetDotnetBlobContainer(_connectionString, containerName); } - public AzurePublisher(string accountName, string accountKey, string containerName) + public AzurePublisher(string accountName, string accountKey, string containerName = s_dotnetBlobContainerName) { - throw new NotImplementedException(); + _containerName = containerName; + _blobContainer = GetDotnetBlobContainer(accountName, accountKey, containerName); + } + + private CloudBlobContainer GetDotnetBlobContainer(string connectionString, string containerName) + { + CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString); + + return GetDotnetBlobContainer(storageAccount, containerName); + } + + private CloudBlobContainer GetDotnetBlobContainer(string accountName, string accountKey, string containerName) + { + var storageCredentials = new StorageCredentials(accountName, accountKey); + var storageAccount = new CloudStorageAccount(storageCredentials, true); + return GetDotnetBlobContainer(storageAccount, containerName); + } + + private CloudBlobContainer GetDotnetBlobContainer(CloudStorageAccount storageAccount, string containerName) + { + CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); + + return blobClient.GetContainerReference(containerName); } public string UploadFile(string file, Product product, string version) { - throw new NotImplementedException(); + string url = CalculateRelativePathForFile(file, product, version); + CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(url); + blob.UploadFromFileAsync(file).Wait(); + SetBlobPropertiesBasedOnFileType(blob); + return url; } public void PublishStringToBlob(string blob, string content) { - throw new NotImplementedException(); + CloudBlockBlob blockBlob = _blobContainer.GetBlockBlobReference(blob); + blockBlob.UploadTextAsync(content).Wait(); + + SetBlobPropertiesBasedOnFileType(blockBlob); } public void CopyBlob(string sourceBlob, string targetBlob) { - throw new NotImplementedException(); + CloudBlockBlob source = _blobContainer.GetBlockBlobReference(sourceBlob); + CloudBlockBlob target = _blobContainer.GetBlockBlobReference(targetBlob); + + // Create the empty blob + using (MemoryStream ms = new MemoryStream()) + { + target.UploadFromStreamAsync(ms).Wait(); + } + + // Copy actual blob data + target.StartCopyAsync(source).Wait(); } public void SetBlobPropertiesBasedOnFileType(string path) { - throw new NotImplementedException(); + CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(path); + SetBlobPropertiesBasedOnFileType(blob); + } + + private void SetBlobPropertiesBasedOnFileType(CloudBlockBlob blockBlob) + { + if (Path.GetExtension(blockBlob.Uri.AbsolutePath.ToLower()) == ".svg") + { + blockBlob.Properties.ContentType = "image/svg+xml"; + blockBlob.Properties.CacheControl = "no-cache"; + blockBlob.SetPropertiesAsync().Wait(); + } + else if (Path.GetExtension(blockBlob.Uri.AbsolutePath.ToLower()) == ".version") + { + blockBlob.Properties.ContentType = "text/plain"; + blockBlob.Properties.CacheControl = "no-cache"; + blockBlob.SetPropertiesAsync().Wait(); + } } public IEnumerable ListBlobs(Product product, string version) { - throw new NotImplementedException(); + string virtualDirectory = $"{product}/{version}"; + return ListBlobs(virtualDirectory); } public IEnumerable ListBlobs(string virtualDirectory) { - throw new NotImplementedException(); + CloudBlobDirectory blobDir = _blobContainer.GetDirectoryReference(virtualDirectory); + BlobContinuationToken continuationToken = new BlobContinuationToken(); + + var blobFiles = blobDir.ListBlobsSegmentedAsync(continuationToken).Result; + return blobFiles.Results.Select(bf => bf.Uri.PathAndQuery.Replace($"/{_containerName}/", string.Empty)); } public string AcquireLeaseOnBlob( @@ -67,32 +140,95 @@ namespace Microsoft.DotNet.Cli.Build TimeSpan? maxWaitDefault = null, TimeSpan? delayDefault = null) { - throw new NotImplementedException(); + TimeSpan maxWait = maxWaitDefault ?? TimeSpan.FromSeconds(120); + TimeSpan delay = delayDefault ?? TimeSpan.FromMilliseconds(500); + + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + + // This will throw an exception with HTTP code 409 when we cannot acquire the lease + // But we should block until we can get this lease, with a timeout (maxWaitSeconds) + while (stopWatch.ElapsedMilliseconds < maxWait.TotalMilliseconds) + { + try + { + CloudBlockBlob cloudBlob = _blobContainer.GetBlockBlobReference(blob); + Task task = cloudBlob.AcquireLeaseAsync(TimeSpan.FromMinutes(1), null); + task.Wait(); + return task.Result; + } + catch (Exception e) + { + Console.WriteLine($"Retrying lease acquisition on {blob}, {e.Message}"); + Thread.Sleep(delay); + } + } + + throw new Exception($"Unable to acquire lease on {blob}"); } public void ReleaseLeaseOnBlob(string blob, string leaseId) { - throw new NotImplementedException(); + CloudBlockBlob cloudBlob = _blobContainer.GetBlockBlobReference(blob); + AccessCondition ac = new AccessCondition() { LeaseId = leaseId }; + cloudBlob.ReleaseLeaseAsync(ac).Wait(); } public bool IsLatestSpecifiedVersion(string version) { - throw new NotImplementedException(); + Task task = _blobContainer.GetBlockBlobReference(version).ExistsAsync(); + task.Wait(); + return task.Result; } public void DropLatestSpecifiedVersion(string version) { - throw new NotImplementedException(); + CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(version); + using (MemoryStream ms = new MemoryStream()) + { + blob.UploadFromStreamAsync(ms).Wait(); + } } public void CreateBlobIfNotExists(string path) { - throw new NotImplementedException(); + Task task = _blobContainer.GetBlockBlobReference(path).ExistsAsync(); + task.Wait(); + if (!task.Result) + { + CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(path); + using (MemoryStream ms = new MemoryStream()) + { + blob.UploadFromStreamAsync(ms).Wait(); + } + } } public bool TryDeleteBlob(string path) { - throw new NotImplementedException(); + try + { + DeleteBlob(path); + + return true; + } + catch (Exception e) + { + Console.WriteLine($"Deleting blob {path} failed with \r\n{e.Message}"); + + return false; + } + } + + private void DeleteBlob(string path) + { + _blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait(); + } + + private static string CalculateRelativePathForFile(string file, Product product, string version) + { + return $"{product}/{version}/{Path.GetFileName(file)}"; } } } +#endif \ No newline at end of file diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index 614b438f1..252e89bb6 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -18,6 +18,7 @@ + From 26d8d75fef88465d81d0bd1134ab10a89adc0231 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 10:43:50 -0700 Subject: [PATCH 10/17] Use stable System.Reflection.Metadata --- build_projects/dotnet-cli-build/dotnet-cli-build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index a21e6b05f..35ca73f22 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -15,7 +15,7 @@ - + From c9eeef1790a39b328442e2f2abb982255c3429ea Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 10:47:27 -0700 Subject: [PATCH 11/17] Remove dependency on VersionTools in source builds --- build_projects/dotnet-cli-build/UpdateVersionsRepo.cs | 7 ++++++- build_projects/dotnet-cli-build/dotnet-cli-build.csproj | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs index f528e05ad..584cc0b11 100644 --- a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs +++ b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs @@ -3,9 +3,12 @@ using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -using Microsoft.DotNet.VersionTools.Automation; using System.IO; +#if !SOURCE_BUILD +using Microsoft.DotNet.VersionTools.Automation; +#endif + namespace Microsoft.DotNet.Cli.Build { public class UpdateVersionsRepo : Task @@ -21,6 +24,7 @@ namespace Microsoft.DotNet.Cli.Build public override bool Execute() { +#if !SOURCE_BUILD string versionsRepoPath = $"build-info/dotnet/cli/{BranchName}"; GitHubAuth auth = new GitHubAuth(GitHubPassword); @@ -28,6 +32,7 @@ namespace Microsoft.DotNet.Cli.Build repoUpdater.UpdateBuildInfoAsync( Directory.GetFiles(PackagesDirectory, "*.nupkg"), versionsRepoPath).Wait(); +#endif return true; } diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 35ca73f22..f76765aff 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -21,6 +21,6 @@ - + From 57d256dbf5a10e8296820fbac074ff73e29bdd51 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Tue, 17 Oct 2017 14:32:36 -0700 Subject: [PATCH 12/17] Make copy idempotent --- build_projects/update-dependencies/update-dependencies.ps1 | 2 +- run-build.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index 4c70b197b..3f79992a3 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -44,7 +44,7 @@ if (!$env:DOTNET_TOOL_DIR) } else { - cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR + Copy-Item -Force -Recurse $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR } # Put the stage0 on the path diff --git a/run-build.ps1 b/run-build.ps1 index b0b04dbff..b3caef1e1 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -80,7 +80,7 @@ if (!$env:DOTNET_TOOL_DIR) } else { - cp -r $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR + Copy-Item -Recurse -Force $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR } # Put the stage0 on the path From 12931ba3200f3e963504da92609e1afd42e47d5f Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 6 Sep 2017 15:27:16 -0500 Subject: [PATCH 13/17] Fix update-dependencies. Don't import the root Directory.Build.props during update-dependencies because it imports generated .props files that don't exist outside of the build. (cherry picked from commit 0491fd3826a9474f7db9cd89589edf53dbc280ae) --- .../update-dependencies/Directory.Build.props | 8 ++++++++ .../update-dependencies/update-dependencies.ps1 | 7 ++----- .../update-dependencies/update-dependencies.sh | 10 ++-------- 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 build_projects/update-dependencies/Directory.Build.props diff --git a/build_projects/update-dependencies/Directory.Build.props b/build_projects/update-dependencies/Directory.Build.props new file mode 100644 index 000000000..a8d332ca6 --- /dev/null +++ b/build_projects/update-dependencies/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index 3f79992a3..ed5411110 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -34,6 +34,8 @@ if (!$env:DOTNET_INSTALL_DIR) $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" } +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Install a stage 0 Write-Output "Installing .NET Core CLI Stage 0" @@ -50,11 +52,6 @@ else # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" -# Restore the app -Write-Output "Restoring $ProjectPath..." -dotnet restore "$ProjectPath" -if($LASTEXITCODE -ne 0) { throw "Failed to restore" } - # Run the app Write-Output "Invoking App $ProjectPath..." dotnet run -p "$ProjectPath" "$ProjectArgs" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index fadffe928..ff95d79a6 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -30,6 +30,8 @@ if [ -z "${DOTNET_INSTALL_DIR:-}" ]; then export DOTNET_INSTALL_DIR=$REPO_ROOT/.dotnet_stage0/x64 fi +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + if [ ! -d "$DOTNET_INSTALL_DIR" ]; then mkdir -p $DOTNET_INSTALL_DIR fi @@ -50,14 +52,6 @@ fi # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH -echo "Restoring $PROJECT_PATH..." -dotnet restore "$PROJECT_PATH" - -if [ $? -ne 0 ]; then - echo "Failed to restore" - exit 1 -fi - echo "Invoking App $PROJECT_PATH..." dotnet run -p "$PROJECT_PATH" $@ From aea3f64ab26726dc9fa65dfdce366bcd39fc5bfe Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Sat, 7 Oct 2017 22:04:43 -0500 Subject: [PATCH 14/17] Enable CLI to build on Windows during source-build. Don't build for net46 and use correct RID for core-setup. --- build/BundledRuntimes.props | 2 +- .../Microsoft.DotNet.Cli.Utils.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 43af1746e..8e0b2eca7 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -1,7 +1,7 @@ $(HostRid) - $(HostMonikerRid) + $(HostMonikerRid) -internal diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index a1dd1e22f..dc4ff23d6 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -3,7 +3,7 @@ $(SdkVersion) netstandard1.5;net46 - netstandard1.5 + netstandard1.5 true ../../tools/Key.snk true From a7aeab79d8a971e99d8b2678985abe7dc01dca80 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Wed, 18 Oct 2017 12:17:03 -0700 Subject: [PATCH 15/17] Fix problems with excluding MSBuildSdkResolver from build --- build/Compile.targets | 2 +- build/Prepare.targets | 4 ++-- build/package/Nupkg.targets | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Compile.targets b/build/Compile.targets index 044c10303..1369ad7d5 100644 --- a/build/Compile.targets +++ b/build/Compile.targets @@ -15,7 +15,7 @@ + Condition="'$(IncludeMSBuildSdkResolver)' == 'true'" /> - - + + diff --git a/build/package/Nupkg.targets b/build/package/Nupkg.targets index d7287c8b7..07b7524cc 100644 --- a/build/package/Nupkg.targets +++ b/build/package/Nupkg.targets @@ -11,7 +11,7 @@ Microsoft.DotNet.Cli.Utils $(SdkNugetVersion) - + Microsoft.DotNet.MSBuildSdkResolver $(SdkNugetVersion) From 2cdfe936f402b049671915e58550f129a54135b3 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Wed, 18 Oct 2017 12:32:36 -0700 Subject: [PATCH 16/17] Eliminate downgrade errors --- src/tool_fsharp/tool_fsc.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj index 1ec0f52b5..729c2bdb4 100644 --- a/src/tool_fsharp/tool_fsc.csproj +++ b/src/tool_fsharp/tool_fsc.csproj @@ -13,6 +13,8 @@ + + From b18db615946288f2f9028dfe333d775b7f180598 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Thu, 19 Oct 2017 11:00:13 -0700 Subject: [PATCH 17/17] ifdef out entire update versions task in source build --- build_projects/dotnet-cli-build/UpdateVersionsRepo.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs index 584cc0b11..615a2e5ca 100644 --- a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs +++ b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs @@ -1,13 +1,12 @@ // 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. +#if !SOURCE_BUILD using Microsoft.Build.Framework; using Microsoft.Build.Utilities; +using Microsoft.DotNet.VersionTools.Automation; using System.IO; -#if !SOURCE_BUILD -using Microsoft.DotNet.VersionTools.Automation; -#endif namespace Microsoft.DotNet.Cli.Build { @@ -24,7 +23,6 @@ namespace Microsoft.DotNet.Cli.Build public override bool Execute() { -#if !SOURCE_BUILD string versionsRepoPath = $"build-info/dotnet/cli/{BranchName}"; GitHubAuth auth = new GitHubAuth(GitHubPassword); @@ -32,9 +30,9 @@ namespace Microsoft.DotNet.Cli.Build repoUpdater.UpdateBuildInfoAsync( Directory.GetFiles(PackagesDirectory, "*.nupkg"), versionsRepoPath).Wait(); -#endif return true; } } } +#endif