mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[ARM64][ci]Verify solution files configurations (#19878)
* [ARM64] Initial configuration verification script * Updated text. Added solution verifications * Updated spell checking * Updated with proper argument to PowerShell tasks * Use pwsh. Moved before .NET 6 task * Load vswhere from installer location.
This commit is contained in:
1
.github/actions/spell-check/expect.txt
vendored
1
.github/actions/spell-check/expect.txt
vendored
@@ -2202,6 +2202,7 @@ vsonline
|
|||||||
vstemplate
|
vstemplate
|
||||||
VSTHRD
|
VSTHRD
|
||||||
VSTT
|
VSTT
|
||||||
|
vswhere
|
||||||
vtable
|
vtable
|
||||||
Vtbl
|
Vtbl
|
||||||
wbem
|
wbem
|
||||||
|
|||||||
@@ -7,6 +7,41 @@ steps:
|
|||||||
submodules: true
|
submodules: true
|
||||||
clean: true
|
clean: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Arm64 configuration for PowerToys.sln
|
||||||
|
inputs:
|
||||||
|
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
|
||||||
|
arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln'
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Arm64 configuration for BugReportTool.sln
|
||||||
|
inputs:
|
||||||
|
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
|
||||||
|
arguments: -solution '$(build.sourcesdirectory)\tools\BugReportTool\BugReportTool.sln'
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Arm64 configuration for WebcamReportTool.sln
|
||||||
|
inputs:
|
||||||
|
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
|
||||||
|
arguments: -solution '$(build.sourcesdirectory)\tools\WebcamReportTool\WebcamReportTool.sln'
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Arm64 configuration for StylesReportTool.sln
|
||||||
|
inputs:
|
||||||
|
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
|
||||||
|
arguments: -solution '$(build.sourcesdirectory)\tools\StylesReportTool\StylesReportTool.sln'
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Arm64 configuration for PowerToysSetup.sln
|
||||||
|
inputs:
|
||||||
|
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
|
||||||
|
arguments: -solution '$(build.sourcesdirectory)\installer\PowerToysSetup.sln'
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: 'Use .NET 6 SDK'
|
displayName: 'Use .NET 6 SDK'
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
63
.pipelines/verifyArm64Configuration.ps1
Normal file
63
.pipelines/verifyArm64Configuration.ps1
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
Param(
|
||||||
|
[Parameter(Mandatory=$True,Position=1)]
|
||||||
|
[string]$solution
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Output "Verifying Arm64 configuration for $solution"
|
||||||
|
|
||||||
|
$errorTable = @{}
|
||||||
|
|
||||||
|
$MSBuildLoc = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\Microsoft.Build.dll
|
||||||
|
if ($null -eq $MSBuildLoc) {
|
||||||
|
throw "Unable to locate Microsoft.Build.dll"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Add-Type -Path $MSBuildLoc
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
# Catching because it may error on loading all the types from the assembly, but we only need one
|
||||||
|
}
|
||||||
|
|
||||||
|
$solutionFile = [Microsoft.Build.Construction.SolutionFile]::Parse($solution);
|
||||||
|
$arm64SlnConfigs = $solutionFile.SolutionConfigurations | Where-Object {
|
||||||
|
$_.PlatformName -eq "ARM64"
|
||||||
|
};
|
||||||
|
|
||||||
|
# Should have two configurations. Debug and Release.
|
||||||
|
if($arm64SlnConfigs.Length -lt 2) {
|
||||||
|
Write-Host -ForegroundColor Red "Missing Solution-level Arm64 platforms"
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# List projects only.
|
||||||
|
$projects = $solutionFile.ProjectsInOrder | Where-Object {
|
||||||
|
$_.ProjectType -eq "KnownToBeMSBuildFormat"
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enumerate through the projects and add any project with a mismatched platform and project configuration
|
||||||
|
foreach ($project in $projects) {
|
||||||
|
foreach ($slnConfig in $arm64SlnConfigs.FullName) {
|
||||||
|
if ($project.ProjectConfigurations.$slnConfig.FullName -ne $slnConfig) {
|
||||||
|
$errorTable[$project.ProjectName] += @(""
|
||||||
|
| Select-Object @{n = "Configuration"; e = { $project.ProjectConfigurations.$slnConfig.FullName } },
|
||||||
|
@{n = "ExpectedConfiguration"; e = { $slnConfig } })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($errorTable.Count -gt 0) {
|
||||||
|
Write-Host -ForegroundColor Red "Verification failed for the following projects:`n"
|
||||||
|
$errorTable.Keys | ForEach-Object {
|
||||||
|
Write-Host -ForegroundColor Red $_`:;
|
||||||
|
$errorTable[$_] | ForEach-Object {
|
||||||
|
Write-Host -ForegroundColor Red "$($_.ExpectedConfiguration)=$($_.Configuration)";
|
||||||
|
};
|
||||||
|
Write-Host -ForegroundColor Red `r
|
||||||
|
}
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Verification Complete"
|
||||||
|
exit 0;
|
||||||
Reference in New Issue
Block a user