From f9d3d35be45430a121fc5b3bdfcad50a2208024c Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 7 Jul 2021 23:48:46 +0200 Subject: [PATCH] Cleaned up pom file, improved packaging script. --- client/package.bat | 9 --------- client/package.ps1 | 27 +++++++++++++++++++++++++++ client/pom.xml | 18 +++++++++++++++++- 3 files changed, 44 insertions(+), 10 deletions(-) delete mode 100644 client/package.bat create mode 100644 client/package.ps1 diff --git a/client/package.bat b/client/package.bat deleted file mode 100644 index 55215de..0000000 --- a/client/package.bat +++ /dev/null @@ -1,9 +0,0 @@ -cd target -jpackage^ - --type exe^ - --name "Ace-of-Shades"^ - --description "Top-down 2D shooter game inspired by Ace of Spades."^ - --module-path "aos-client-5.0.jar;../../core/target/aos-core-5.0.jar"^ - --module aos_client/nl.andrewlalis.aos_client.launcher.Launcher^ - --win-shortcut^ - --win-dir-chooser \ No newline at end of file diff --git a/client/package.ps1 b/client/package.ps1 new file mode 100644 index 0000000..0410681 --- /dev/null +++ b/client/package.ps1 @@ -0,0 +1,27 @@ +# This script prepares and runs the jpackage command to generate a Windows AOS Client installer. + +Push-Location $PSScriptRoot\target + +# Remove existing file if it exists. +Write-Output "Removing existing exe file." +Get-ChildItem *.exe | ForEach-Object { Remove-Item -Path $_.FullName -Force } +Write-Output "Done." + +# Get list of dependency modules that maven copied into the lib directory. +$modules = Get-ChildItem -Path lib -Name | ForEach-Object { "lib\$_" } +# Add our own main module. +$mainModuleJar = Get-ChildItem -Name -Include "aos-client-*.jar" -Exclude "*-jar-with-dependencies.jar" +$modules += $mainModuleJar +Write-Output "Found modules: $modules" +$modulePath = $modules -join ';' + +Write-Output "Running jpackage..." +jpackage ` + --type exe ` + --name "Ace-of-Shades" ` + --description "Top-down 2D shooter game inspired by Ace of Spades." ` + --module-path "$modulePath" ` + --module aos_client/nl.andrewlalis.aos_client.launcher.Launcher ` + --win-shortcut ` + --win-dir-chooser +Write-Output "Done!" diff --git a/client/pom.xml b/client/pom.xml index cb1f0ed..906d536 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -25,7 +25,7 @@ - nl.andrewlalis.aos_client.Client + nl.andrewlalis.aos_client.launcher.Launcher @@ -42,6 +42,22 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 2.8 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + +