Skip to content

Commit

Permalink
Pass the path around (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jul 21, 2021
1 parent 4c1edec commit 5222efe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
3 changes: 1 addition & 2 deletions build.cake
Expand Up @@ -43,7 +43,6 @@ string testResultsDirectory = EnvironmentVariable("TestResultsDirectory", $"{art
string workingDirectory = EnvironmentVariable("SYSTEM_DEFAULTWORKINGDIRECTORY", ".");
string envProgramFiles = EnvironmentVariable("ProgramFiles(x86)");
var configuration = GetBuildVariable("configuration", GetBuildVariable("BUILD_CONFIGURATION", "DEBUG"));
var msbuildPath = GetBuildVariable("msbuild", $"{envProgramFiles}\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe");

var target = Argument("target", "Default");
if(String.IsNullOrWhiteSpace(target))
Expand Down Expand Up @@ -169,7 +168,7 @@ Information ("artifactStagingDirectory: {0}", artifactStagingDirectory);
Information("workingDirectory: {0}", workingDirectory);
Information("NUNIT_TEST_WHERE: {0}", NUNIT_TEST_WHERE);
Information("TARGET: {0}", target);
Information("MSBUILD: {0}", msbuildPath);
Information("MSBUILD: {0}", MSBuildExe);


var releaseChannel = ReleaseChannel.Stable;
Expand Down
8 changes: 7 additions & 1 deletion eng/package.ps1
Expand Up @@ -4,7 +4,8 @@ param(
)

$ErrorActionPreference = "Stop"
Write-Host $msbuild
Write-Host "-msbuild: $msbuild"
Write-Host "MSBUILD_EXE: $env:MSBUILD_EXE"

$artifacts = Join-Path $PSScriptRoot ../artifacts
$sln = Join-Path $PSScriptRoot ../Microsoft.Maui-net6.sln
Expand All @@ -21,6 +22,11 @@ $dotnet = (Get-Item $dotnet).FullName

if ($IsWindows)
{
if (-not $msbuild)
{
$msbuild = $env:MSBUILD_EXE
}

if (-not $msbuild)
{
# If MSBuild path isn't specified, use the standard location of 'vswhere' to determine an appropriate MSBuild to use.
Expand Down
8 changes: 7 additions & 1 deletion eng/pipelines/handlers.yml
Expand Up @@ -149,6 +149,7 @@ stages:
displayName: install dotnet tools
- powershell: |
$msbuild = "$env:ProgramFiles/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/MSBuild.exe"
$env:MSBUILD_EXE = "$msbuild"
& dotnet cake --target=VS-WINUI-CI --configuration=${{ BuildCondition }} --msbuild="$msbuild"
displayName: 'Build WinUI SLN'
- task: CopyFiles@2
Expand Down Expand Up @@ -251,10 +252,15 @@ stages:
displayName: 'Provision VSWindows'
inputs:
provisioning_script: $(provisionator.vs)
- pwsh: |
$msbuild = "$env:ProgramFiles/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/MSBuild.exe"
echo "MSBUILD_EXE: $msbuild"
echo "##vso[task.setvariable variable=MSBUILD_EXE]$msbuild"
displayName: set MSBUILD_EXE
- script: dotnet tool restore
displayName: install dotnet tools
- script: dotnet cake --configuration=Release
- powershell: dotnet cake --configuration=Release
displayName: pack nugets
- task: CopyFiles@2
condition: always()
Expand Down
6 changes: 5 additions & 1 deletion src/Controls/samples/Controls.Sample.SingleProject/MyApp.cs
Expand Up @@ -15,5 +15,9 @@ public IWindow CreateWindow(IActivationState activationState)
_windows.Add(window);
return window;
}

public void ThemeChanged()
{
}
}
}
}

0 comments on commit 5222efe

Please sign in to comment.