2023-01-09 04:27:57 -08:00
|
|
|
[CmdletBinding()]
|
|
|
|
|
Param(
|
|
|
|
|
[Parameter(Mandatory=$True,Position=1)]
|
|
|
|
|
[string]$path
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$noticeFile = Get-Content -Raw "NOTICE.md"
|
|
|
|
|
|
|
|
|
|
Write-Host $noticeFile
|
|
|
|
|
|
|
|
|
|
Write-Host "Verifying NuGet packages"
|
|
|
|
|
|
|
|
|
|
$projFiles = Get-ChildItem $path -Filter *.csproj -force -Recurse
|
|
|
|
|
$projFiles.Count
|
|
|
|
|
|
|
|
|
|
Write-Host "Going through all csproj files"
|
|
|
|
|
|
|
|
|
|
$totalList = $projFiles | ForEach-Object -Parallel {
|
|
|
|
|
$csproj = $_
|
|
|
|
|
$nugetTemp = @();
|
|
|
|
|
|
|
|
|
|
#Workaround for preventing exit code from dotnet process from reflecting exit code in PowerShell
|
|
|
|
|
$procInfo = New-Object System.Diagnostics.ProcessStartInfo -Property @{
|
|
|
|
|
FileName = "dotnet.exe";
|
|
|
|
|
Arguments = "list $csproj package";
|
|
|
|
|
RedirectStandardOutput = $true;
|
|
|
|
|
RedirectStandardError = $true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$proc = [System.Diagnostics.Process]::Start($procInfo);
|
|
|
|
|
|
|
|
|
|
while (!$proc.StandardOutput.EndOfStream) {
|
|
|
|
|
$nugetTemp += $proc.StandardOutput.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$proc = $null;
|
|
|
|
|
$procInfo = $null;
|
|
|
|
|
|
|
|
|
|
if($nugetTemp -is [array] -and $nugetTemp.count -gt 3)
|
|
|
|
|
{
|
2023-02-14 18:38:53 -08:00
|
|
|
# Need to debug this script? Uncomment this line.
|
|
|
|
|
# Write-Host $csproj "`r`n" $nugetTemp "`r`n"
|
2023-01-09 04:27:57 -08:00
|
|
|
$temp = New-Object System.Collections.ArrayList
|
|
|
|
|
$temp.AddRange($nugetTemp)
|
|
|
|
|
$temp.RemoveRange(0, 3)
|
|
|
|
|
|
|
|
|
|
foreach($p in $temp)
|
|
|
|
|
{
|
2024-12-09 10:17:38 +08:00
|
|
|
# ignore "Auto-referenced" string in the output
|
|
|
|
|
if ($p -match "Auto-referenced") {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-09 04:27:57 -08:00
|
|
|
# breaking item down to usable array and getting 1 and 2, see below of a sample output
|
|
|
|
|
# > PACKAGE VERSION VERSION
|
2024-12-09 10:17:38 +08:00
|
|
|
# if a package is Auto-referenced, "(A)" will appear in position 1 instead of a version number.
|
2023-01-09 04:27:57 -08:00
|
|
|
|
|
|
|
|
$p = -split $p
|
|
|
|
|
$p = $p[1, 2]
|
2025-08-21 03:30:42 -05:00
|
|
|
$tempString = $p[0]
|
2023-01-09 04:27:57 -08:00
|
|
|
|
2025-08-21 03:30:42 -05:00
|
|
|
if([string]::IsNullOrWhiteSpace($tempString))
|
2023-01-09 04:27:57 -08:00
|
|
|
{
|
2025-08-21 03:30:42 -05:00
|
|
|
Continue
|
2023-01-09 04:27:57 -08:00
|
|
|
}
|
2025-08-21 03:30:42 -05:00
|
|
|
|
|
|
|
|
if($tempString.StartsWith("Microsoft.") -Or $tempString.StartsWith("System."))
|
|
|
|
|
{
|
|
|
|
|
Continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "- $tempString"
|
2023-01-09 04:27:57 -08:00
|
|
|
}
|
|
|
|
|
$csproj = $null;
|
|
|
|
|
}
|
|
|
|
|
} -ThrottleLimit 4 | Sort-Object
|
|
|
|
|
|
|
|
|
|
$returnList = [System.Collections.Generic.HashSet[string]]($totalList) -join "`r`n"
|
|
|
|
|
|
|
|
|
|
Write-Host $returnList
|
|
|
|
|
|
2025-06-11 18:15:25 -07:00
|
|
|
# Extract the current package list from NOTICE.md
|
|
|
|
|
$noticePattern = "## NuGet Packages used by PowerToys\s*((?:\r?\n- .+)+)"
|
|
|
|
|
$noticeMatch = [regex]::Match($noticeFile, $noticePattern)
|
|
|
|
|
|
|
|
|
|
if ($noticeMatch.Success) {
|
|
|
|
|
$currentNoticePackageList = $noticeMatch.Groups[1].Value.Trim()
|
|
|
|
|
} else {
|
|
|
|
|
Write-Warning "Warning: Could not find 'NuGet Packages used by PowerToys' section in NOTICE.md"
|
|
|
|
|
$currentNoticePackageList = ""
|
|
|
|
|
}
|
|
|
|
|
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
# Test-only packages that are allowed to be in NOTICE.md but not in the build
|
|
|
|
|
# (e.g., when BuildTests=false, these packages won't appear in the NuGet list)
|
|
|
|
|
$allowedExtraPackages = @(
|
2026-02-14 08:47:56 +01:00
|
|
|
"- Moq",
|
|
|
|
|
"- MSTest"
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
)
|
|
|
|
|
|
2023-01-09 04:27:57 -08:00
|
|
|
if (!$noticeFile.Trim().EndsWith($returnList.Trim()))
|
|
|
|
|
{
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
Write-Host -ForegroundColor Yellow "Notice.md does not exactly match NuGet list. Analyzing differences..."
|
2025-06-11 18:15:25 -07:00
|
|
|
|
|
|
|
|
# Show detailed differences
|
|
|
|
|
$generatedPackages = $returnList -split "`r`n|`n" | Where-Object { $_.Trim() -ne "" } | Sort-Object
|
|
|
|
|
$noticePackages = $currentNoticePackageList -split "`r`n|`n" | Where-Object { $_.Trim() -ne "" } | ForEach-Object { $_.Trim() } | Sort-Object
|
|
|
|
|
|
|
|
|
|
Write-Host ""
|
|
|
|
|
Write-Host -ForegroundColor Cyan "=== DETAILED DIFFERENCE ANALYSIS ==="
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
# Find packages in proj file list but not in NOTICE.md
|
|
|
|
|
$missingFromNotice = $generatedPackages | Where-Object { $noticePackages -notcontains $_ }
|
|
|
|
|
if ($missingFromNotice.Count -gt 0) {
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
Write-Host -ForegroundColor Red "MissingFromNotice (ERROR - these must be added to NOTICE.md):"
|
2025-06-11 18:15:25 -07:00
|
|
|
foreach ($pkg in $missingFromNotice) {
|
|
|
|
|
Write-Host -ForegroundColor Red " $pkg"
|
|
|
|
|
}
|
|
|
|
|
Write-Host ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Find packages in NOTICE.md but not in proj file list
|
|
|
|
|
$extraInNotice = $noticePackages | Where-Object { $generatedPackages -notcontains $_ }
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
|
|
|
|
|
# Filter out allowed extra packages (test-only dependencies)
|
|
|
|
|
$unexpectedExtra = $extraInNotice | Where-Object { $allowedExtraPackages -notcontains $_ }
|
|
|
|
|
$allowedExtra = $extraInNotice | Where-Object { $allowedExtraPackages -contains $_ }
|
|
|
|
|
|
|
|
|
|
if ($allowedExtra.Count -gt 0) {
|
|
|
|
|
Write-Host -ForegroundColor Green "ExtraInNotice (OK - allowed test-only packages):"
|
|
|
|
|
foreach ($pkg in $allowedExtra) {
|
|
|
|
|
Write-Host -ForegroundColor Green " $pkg"
|
|
|
|
|
}
|
|
|
|
|
Write-Host ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($unexpectedExtra.Count -gt 0) {
|
|
|
|
|
Write-Host -ForegroundColor Red "ExtraInNotice (ERROR - unexpected packages in NOTICE.md):"
|
|
|
|
|
foreach ($pkg in $unexpectedExtra) {
|
|
|
|
|
Write-Host -ForegroundColor Red " $pkg"
|
2025-06-11 18:15:25 -07:00
|
|
|
}
|
|
|
|
|
Write-Host ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show counts for summary
|
|
|
|
|
Write-Host -ForegroundColor Cyan "Summary:"
|
|
|
|
|
Write-Host " Proj file list has $($generatedPackages.Count) packages"
|
|
|
|
|
Write-Host " NOTICE.md has $($noticePackages.Count) packages"
|
|
|
|
|
Write-Host " MissingFromNotice: $($missingFromNotice.Count) packages"
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
Write-Host " ExtraInNotice (allowed): $($allowedExtra.Count) packages"
|
|
|
|
|
Write-Host " ExtraInNotice (unexpected): $($unexpectedExtra.Count) packages"
|
2025-06-11 18:15:25 -07:00
|
|
|
Write-Host ""
|
|
|
|
|
|
Build: Fix release pipeline and local build failure (#45211)
## Summary of the Pull Request
Release pipeline is keeping failed, and local build failed at ut.
This pull request introduces changes to improve how test projects are
handled during release builds, ensuring that test code is not compiled
or analyzed when not needed - in doing release build, to - succeed the
execution and reduce built time.
And, to upgrade from VS17 to VS18 in cmdpal sdk build, this is to keep
consistency with all other build step
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Local build & release pipeline build should all pass:
Local build:
<img width="1815" height="281" alt="image"
src="https://github.com/user-attachments/assets/f350cf3f-b856-432d-97f3-e392d38ef7fa"
/>
Release pipeline is working too:
<img width="1195" height="163" alt="image"
src="https://github.com/user-attachments/assets/ce58de38-f0fb-45ad-9d70-2b8eb1c4db60"
/>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 09:15:53 +08:00
|
|
|
# Fail if there are missing packages OR unexpected extra packages
|
|
|
|
|
if ($missingFromNotice.Count -gt 0 -or $unexpectedExtra.Count -gt 0) {
|
|
|
|
|
Write-Host -ForegroundColor Red "FAILED: NOTICE.md mismatch detected."
|
|
|
|
|
exit 1
|
|
|
|
|
} else {
|
|
|
|
|
Write-Host -ForegroundColor Green "PASSED: NOTICE.md matches (with allowed test-only packages)."
|
|
|
|
|
}
|
2023-01-09 04:27:57 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exit 0
|