diff --git a/.pipelines/ci/templates/build-powertoys-steps.yml b/.pipelines/ci/templates/build-powertoys-steps.yml index 74edf81ec8..26754babe8 100644 --- a/.pipelines/ci/templates/build-powertoys-steps.yml +++ b/.pipelines/ci/templates/build-powertoys-steps.yml @@ -8,7 +8,7 @@ steps: clean: true - task: PowerShell@2 - displayName: Verifying Nuget packages for PowerToys.sln + displayName: Verifying Nuget package versions for PowerToys.sln inputs: filePath: '$(build.sourcesdirectory)\.pipelines\verifyNugetPackages.ps1' arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln' @@ -69,7 +69,7 @@ steps: configPath: NuGet.config restoreSolution: PowerToys.sln restoreDirectory: '$(Build.SourcesDirectory)\packages' - + - task: VSBuild@1 displayName: 'Build PowerToys.sln' inputs: @@ -137,12 +137,6 @@ steps: msbuildArgs: ${{ parameters.additionalBuildArguments }} maximumCpuCount: true -- task: PowerShell@2 - displayName: Download and install WiX 3.14 development build - inputs: - targetType: filePath - filePath: '$(build.sourcesdirectory)\.pipelines\installWiX.ps1' - - task: NuGetCommand@2 displayName: Restore NuGet packages for PowerToysSetup.sln inputs: @@ -152,6 +146,12 @@ steps: restoreSolution: installer\PowerToysSetup.sln restoreDirectory: '$(Build.SourcesDirectory)\installer\packages' +- task: PowerShell@2 + displayName: Download and install WiX 3.14 development build + inputs: + targetType: filePath + filePath: '$(build.sourcesdirectory)\.pipelines\installWiX.ps1' + - task: VSBuild@1 displayName: 'Build PowerToys MSI' inputs: @@ -227,3 +227,10 @@ steps: **\powerpreviewTest.dll **\UnitTests-FancyZones.dll !**\obj\** + +- task: PowerShell@2 + displayName: Verifying Notice.md and Nuget packages match + inputs: + filePath: '$(build.sourcesdirectory)\.pipelines\verifyNoticeMdAgainstNugetPackages.ps1' + arguments: -path '$(build.sourcesdirectory)\' + pwsh: true \ No newline at end of file diff --git a/.pipelines/verifyNoticeMdAgainstNugetPackages.ps1 b/.pipelines/verifyNoticeMdAgainstNugetPackages.ps1 new file mode 100644 index 0000000000..affff4c782 --- /dev/null +++ b/.pipelines/verifyNoticeMdAgainstNugetPackages.ps1 @@ -0,0 +1,73 @@ +[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) + { + $temp = New-Object System.Collections.ArrayList + $temp.AddRange($nugetTemp) + $temp.RemoveRange(0, 3) + + foreach($p in $temp) + { + # breaking item down to usable array and getting 1 and 2, see below of a sample output + # > PACKAGE VERSION VERSION + + $p = -split $p + $p = $p[1, 2] + $tempString = $p[0] + " " + $p[1] + + if(![string]::IsNullOrWhiteSpace($tempString)) + { + echo "- $tempString"; + } + } + $csproj = $null; + } +} -ThrottleLimit 4 | Sort-Object + +$returnList = [System.Collections.Generic.HashSet[string]]($totalList) -join "`r`n" + +Write-Host $returnList + +if (!$noticeFile.Trim().EndsWith($returnList.Trim())) +{ + Write-Host -ForegroundColor Red "Notice.md does not match NuGet list." + exit 1 +} + +exit 0 diff --git a/NOTICE.md b/NOTICE.md index 6db0f8bf42..79ac437363 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -274,3 +274,55 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## NuGet Packages used by PowerToys + +- CommunityToolkit.Labs.WinUI.SettingsControls 0.0.7 +- CommunityToolkit.Mvvm 8.0.0 +- CommunityToolkit.WinUI.UI 7.1.2 +- CommunityToolkit.WinUI.UI.Controls 7.1.2 +- ControlzEx 5.0.1 +- HelixToolkit 2.20.2 +- HelixToolkit.Core.Wpf 2.20.2 +- hyjiacan.pinyin4net 4.1.1 +- Interop.Microsoft.Office.Interop.OneNote 1.1.0.2 +- LazyCache 2.4.0 +- Mages 2.0.1 +- Markdig.Signed 0.27.0 +- Microsoft.CodeAnalysis.NetAnalyzers 7.0.0 +- Microsoft.Data.Sqlite 7.0.0 +- Microsoft.Extensions.Hosting 7.0.0 +- Microsoft.NET.Test.Sdk 17.4.1 +- Microsoft.Toolkit.Uwp.Notifications 7.1.2 +- Microsoft.Web.WebView2 1.0.1343.22 +- Microsoft.Windows.CsWin32 0.2.46-beta +- Microsoft.Windows.CsWinRT 2.0.0 +- Microsoft.Windows.SDK.BuildTools 10.0.22621.755 +- Microsoft.WindowsAppSDK 1.2.221116.1 +- Microsoft.Xaml.Behaviors.WinUI.Managed 2.0.9 +- Microsoft.Xaml.Behaviors.Wpf 1.1.39 +- ModernWpfUI 0.9.4 +- Moq 4.18.3 +- MSTest.TestAdapter 3.0.1 +- MSTest.TestFramework 3.0.1 +- NLog 5.0.4 +- NLog.Extensions.Logging 5.0.4 +- NLog.Schema 5.0.4 +- ScipBe.Common.Office.OneNote 3.0.1 +- StyleCop.Analyzers 1.2.0-beta.435 +- System.CommandLine 2.0.0-beta1.20071.2 +- System.ComponentModel.Composition 7.0.0 +- System.Configuration.ConfigurationManager 6.0.0 +- System.Data.OleDb 7.0.0 +- System.Drawing.Common 7.0.0 +- System.IO.Abstractions 17.2.3 +- System.IO.Abstractions.TestingHelpers 17.2.3 +- System.Management 7.0.0 +- System.Reactive 5.0.0 +- System.Runtime.Caching 7.0.0 +- System.ServiceProcess.ServiceController 7.0.0 +- UnicodeInformation 2.6.0 +- UnitsNet 4.145.0 +- Vanara.PInvoke.Shell32 3.4.11 +- Vanara.PInvoke.User32 3.4.11 +- WinUIEx 1.8.0