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 + + + +