24 lines
1.2 KiB
PowerShell
24 lines
1.2 KiB
PowerShell
# Build the unsigned, vendor-independent Java 11 identity helper on Windows.
|
|
[CmdletBinding()]
|
|
param()
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
|
$Source = Join-Path $Root 'hmi-docs/cheerpj/JaasIdentityBridge.java'
|
|
$Dest = Join-Path $Root 'hmi-frontend/public/cheerpj/jaas-identity-bridge.jar'
|
|
$Temp = Join-Path ([System.IO.Path]::GetTempPath()) ('hmi-jaas-' + [Guid]::NewGuid().ToString('N'))
|
|
New-Item -ItemType Directory -Path $Temp -Force | Out-Null
|
|
try {
|
|
& javac --release 11 -d $Temp $Source
|
|
if ($LASTEXITCODE -ne 0) { throw 'javac --release 11 failed' }
|
|
& jar --create --file $Dest -C $Temp 'com/widgetworkbench/cheerpj/JaasIdentityBridge.class'
|
|
if ($LASTEXITCODE -ne 0) { throw 'JAR creation failed' }
|
|
$entries = @(& jar tf $Dest)
|
|
if ($LASTEXITCODE -ne 0 -or ($entries -notcontains 'com/widgetworkbench/cheerpj/JaasIdentityBridge.class')) {
|
|
throw 'JAR did not contain the JAAS helper class'
|
|
}
|
|
Write-Host "JAAS Hilfsklasse erstellt: $Dest"
|
|
} finally {
|
|
Remove-Item -LiteralPath $Temp -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|