Workplace Widget 5.10.23
This commit is contained in:
23
hmi-scripts/build-jaas-bridge.ps1
Normal file
23
hmi-scripts/build-jaas-bridge.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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
|
||||
}
|
||||
Reference in New Issue
Block a user