Skip to content

Commit

Permalink
Added script to generate compatibility suppression files.
Browse files Browse the repository at this point in the history
  • Loading branch information
MoFtZ committed Jun 25, 2022
1 parent a15f336 commit 1801ea2
Showing 1 changed file with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## ---------------------------------------------------------------------------------------
## ILGPU
## Copyright (c) 2022 ILGPU Project
## www.ilgpu.net
##
## File: GenerateCompatibilitySuppressionFile.ps1
##
## This file is part of ILGPU and is distributed under the University of Illinois Open
## Source License. See LICENSE.txt for details.
## ---------------------------------------------------------------------------------------

using namespace System.IO

$basePath = [Path]::Combine($PSScriptRoot, '..\..')
$srcPath = [Path]::Combine($basePath, 'Src')

# Reset by deleting existing compatibility suppression files.
# Otherwise, the existing suppression rules are never removed.
Write-Host `
"Removing Existing Compatibility Suppression Files:" `
-ForegroundColor Yellow

$files = `
Get-ChildItem `
-path $srcPath `
-Filter "CompatibilitySuppressions.xml" `
-Recurse `
-File
ForEach ($file in $files) {
Write-Host " - $($file.FullName)" -ForegroundColor Red
Remove-Item $file.FullName
}

# Regenerate compatibility suppression files.
# Set GitHub Actions environment variable to enable building all
# configurations.
$propsFilePath = [Path]::Combine($srcPath, 'Directory.Build.props')
$xml = New-Object XML
$xml.Load($propsFilePath)
$node = $xml.SelectSingleNode(
'/Project/*/LibraryPackageValidationBaselineVersion');

Write-Host `
"Generating Compatibility Suppression Files for:" `
"$($node.InnerText)" `
-ForegroundColor Yellow

$env:GITHUB_ACTIONS = 'true'
dotnet pack /p:GenerateCompatibilitySuppressionFile=true $srcPath

0 comments on commit 1801ea2

Please sign in to comment.