Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added script to generate compatibility suppression files. #821

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## ---------------------------------------------------------------------------------------
## ILGPU
## Copyright (c) 2022 ILGPU Project
## www.ilgpu.net
##
## File: GenerateCompatibilitySuppressionFiles.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