Cleaned up pom file, improved packaging script.

This commit is contained in:
Andrew Lalis 2021-07-07 23:48:46 +02:00
parent 0e926d628a
commit f9d3d35be4
3 changed files with 44 additions and 10 deletions

View File

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

27
client/package.ps1 Normal file
View File

@ -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!"

View File

@ -25,7 +25,7 @@
<configuration>
<archive>
<manifest>
<mainClass>nl.andrewlalis.aos_client.Client</mainClass>
<mainClass>nl.andrewlalis.aos_client.launcher.Launcher</mainClass>
</manifest>
</archive>
<descriptorRefs>
@ -42,6 +42,22 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>