Files
TinyORM/tools/Find-Exports.ps1
T
silverqx 4e1fed5083 renamed powershell script
To match powershell verbs requirements.
2022-01-03 17:21:40 +01:00

33 lines
769 B
PowerShell

#!/usr/bin/env pwsh
# Detect SHAREDLIB_EXPORT in header files that don't have a cpp file
Set-StrictMode -Version 3.0
$hppFiles = Get-ChildItem -Path ..\include\*.hpp -Recurse
$cppFiles = Get-ChildItem -Path ..\src\*.cpp -Recurse
foreach ($hppFile in $hppFiles)
{
$cppFile = $hppFile -replace '\\include\\', '\src\'
$cppFile = $cppFile -replace '\.hpp', '.cpp'
$hasCpp = @($cppFiles | Where-Object FullName -CEQ $cppFile)
if ($hasCpp.Count -gt 1)
{
throw 'More results for ' + $cppFile
}
if ($hasCpp.Count -eq 1)
{
continue
}
$containsExport = @(Select-String -Path $hppFile -Pattern 'SHAREDLIB_EXPORT')
if ($containsExport.Count -eq 0)
{
continue
}
Write-Output $hppFile.FullName
}