Files
sophena/_wiki/check-jar.ps1
2025-12-04 11:35:53 +01:00

38 lines
1.3 KiB
PowerShell

param([string]$JarPath = "target/scrape-ui-1.0-SNAPSHOT.jar")
Add-Type -AssemblyName System.IO.Compression.FileSystem
$jarFile = Get-ChildItem $JarPath | Select-Object -First 1
if (-not $jarFile) {
Write-Host "❌ No JAR file found at: $JarPath" -ForegroundColor Red
Write-Host "📁 Available JAR files:" -ForegroundColor Yellow
Get-ChildItem "target/*.jar" | ForEach-Object { Write-Host " - $($_.Name)" }
exit 1
}
Write-Host "🔍 Examining JAR: $($jarFile.Name)" -ForegroundColor Cyan
Write-Host "Size: $([math]::Round($jarFile.Length/1MB, 2)) MB`n"
$zip = [System.IO.Compression.ZipFile]::OpenRead($jarFile.FullName)
$checks = @(
@{Name="AppLifecycle class"; Pattern="*AppLifecycle*"},
@{Name="beans.xml"; Pattern="*beans.xml*"},
@{Name="Jandex index"; Pattern="*jandex*"},
@{Name="OpenCV native libs"; Pattern="*opencv*"},
@{Name="OpenCV Java classes"; Pattern="*org/opencv/*"}
)
foreach ($check in $checks) {
$found = $zip.Entries | Where-Object { $_.FullName -like $check.Pattern } | Select-Object -First 1
if ($found) {
Write-Host "$($check.Name): FOUND ($($found.FullName))" -ForegroundColor Green
} else {
Write-Host "$($check.Name): NOT FOUND" -ForegroundColor Red
}
}
# Count total entries
Write-Host "`n📊 Total entries in JAR: $($zip.Entries.Count)"
$zip.Dispose()