25 lines
825 B
PowerShell
25 lines
825 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$root = Split-Path $PSScriptRoot -Parent
|
|
$forbiddenDirectories = @('auth', 'iam', 'order', 'firstleg', 'common-core', 'common-web',
|
|
'common-security', 'common-openapi', 'common-audit', 'common-event-contract')
|
|
|
|
foreach ($directory in $forbiddenDirectories) {
|
|
if (Test-Path (Join-Path $root $directory)) {
|
|
throw "FORBIDDEN_DIRECTORY: $directory"
|
|
}
|
|
}
|
|
|
|
$pomFiles = Get-ChildItem -Path $root -Recurse -Filter pom.xml
|
|
foreach ($pom in $pomFiles) {
|
|
$document = New-Object System.Xml.XmlDocument
|
|
$document.Load($pom.FullName)
|
|
}
|
|
|
|
$excluded = Get-ChildItem -Path $root -Recurse -Directory |
|
|
Where-Object { $_.Name -in @('.git', '.idea', 'target') }
|
|
if ($excluded) {
|
|
throw "EXCLUDED_DIRECTORY: $($excluded.FullName -join ',')"
|
|
}
|
|
|
|
Write-Host "BOUNDARY_AND_POM_XML_OK"
|