From eb299afb6be4dfd3f37a5153a949309d5aa37aff Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Thu, 24 Mar 2022 10:40:13 +0000 Subject: [PATCH] Try build with dotnet root --- azure-pipelines.yml | 2 +- build.cake | 2 ++ eng/cake/dotnet.cake | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 88e6d0a..52fe6c6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -106,7 +106,7 @@ stages: - pwsh: dotnet tool restore displayName: install dotnet tools - - pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration.name }}" --verbosity=diagnostic --DotNetDirectory "$env:DOTNET_ROOT" + - pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration.name }}" --verbosity=diagnostic displayName: 'Install .NET' retryCountOnTaskFailure: 3 env: diff --git a/build.cake b/build.cake index fa8f69a..f3093fb 100644 --- a/build.cake +++ b/build.cake @@ -42,6 +42,8 @@ string envProgramFiles = EnvironmentVariable("ProgramFiles(x86)"); var configuration = GetBuildVariable("BUILD_CONFIGURATION", GetBuildVariable("configuration", "DEBUG")); bool isHostedAgent = agentName.StartsWith("Azure Pipelines") || agentName.StartsWith("Hosted Agent"); +var dotnetInstallDirectory = EnvironmentVariable("DOTNET_ROOT"); + var localDotnet = GetBuildVariable("workloads", (target == "VS-WINUI") ? "global" : "local") == "local"; var vsVersion = GetBuildVariable("VS", ""); diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index cbab2f7..33f2b77 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -14,9 +14,19 @@ Task("dotnet") DotNetCoreBuild("./build/DotNet/DotNet.csproj", new DotNetCoreBuildSettings { - MSBuildSettings = new DotNetCoreMSBuildSettings() + // MSBuildSettings = new DotNetCoreMSBuildSettings() + // .EnableBinaryLogger($"{logDirectory}/dotnet-{configuration}.binlog") + // .WithProperty("InstallWorkloadPacks", "false") + // .SetConfiguration(configuration), + + // if(!string.IsNullOrEmpty(dotnetInstallDirectory)) + // { + MSBuildSettings= new DotNetCoreMSBuildSettings() .EnableBinaryLogger($"{logDirectory}/dotnet-{configuration}.binlog") + .WithProperty("InstallWorkloadPacks", "false") + .WithProperty("DotNetDirectory", dotnetInstallDirectory) .SetConfiguration(configuration), + //} }); });