Skip to content

Commit ecb00fa

Browse files
committed
Add Windows jpackage native installer build script
1 parent cc3e3a4 commit ecb00fa

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

installer/build-native.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[CmdletBinding()]
2+
param([switch]$SkipMaven)
3+
$ErrorActionPreference = 'Stop'
4+
Set-Location $PSScriptRoot
5+
if (-not $SkipMaven) { mvn -B clean package }
6+
$version = (mvn -q -DforceStdout help:evaluate '-Dexpression=project.version').Trim()
7+
$jar = "target\us-house-installer-$version.jar"
8+
if (-not (Test-Path $jar)) { throw "Build did not produce $jar" }
9+
New-Item -ItemType Directory -Force -Path dist | Out-Null
10+
jpackage --type app-image --name US-House-Installer --input target --main-jar (Split-Path $jar -Leaf) --main-class us.house.installer.USHouseInstaller --dest dist
11+
jpackage --type exe --name US-House-Installer --input target --main-jar (Split-Path $jar -Leaf) --main-class us.house.installer.USHouseInstaller --dest dist
12+
Write-Host "Native Windows installer written to $PSScriptRoot\dist"

0 commit comments

Comments
 (0)