The process for deployment on Mac is very similar to that on Windows. We will use jpackage in a very similar way, but there are a few differences, including what needs to be installed for jpackage to work and what flags need to be given to jpackage.
<br>
# Installing Dependencies
For Mac, you'll need to install Xcode Developer Tools. If you have Xcode installed already, then you should already have these tools installed, and can move on to the next section.
Otherwise, you have a few options. You can either:
1. Open terminal, and run `xcode-select --install`
2. Open the App Store and install Xcode
Once you've done one of those, you should be ready to start using jpackage.
<br>
# Creating the Jar File
To start, you will want to export the FreshmanRPG client to a Jar file.
### If using IntelliJ...
1. Open the FreshmanRPG project in IntelliJ.
2. On the rightmost panel, click Gradle.
3. Under GameClient-desktop, click shadowJar, under shadow.
### If creating the Jar manually...
1. Navigate into `FreshmanRPG/GameClient-desktop`
2. Open a command prompt or terminal in that directory.
3. Run this command: `..\gradlew shadowJar`
<br>
# Finding the Jar File
Once created, the jar file will be in the following path:
Create a folder that you will dedicate to `jpackage`. **Don't create it inside of the repository.**
Next, go into your new folder, and create a folder, called `inputDir`, inside of it. Place your Jar file inside of that folder. The directory structure should look like this:
*`jpackage/inputDir/GameClient-linux.jar`
Next, find a file called `rpg_icon.ico`. It should exist in the FreshmanRPG Google Drive. Place that in the inputDir folder:
*`jpackage/inputDir/rpg_icon.ico`
> **It is very important that you DO NOT place these files directly in your jpackage folder. Move them into the inputDir folder. If you ignore this step, there's a bug in jpackage that will create a large folder that will take up space and be very difficult to delete.**
Now that you have those files, go into the jpackage directory, outside of inputDir, and create a new batch script:
* You can now run the new shell script by double-clicking it. It will create an installer in the jpackage folder you created.
<br>
# What the Command Does
*`--input:` specifies the folder where the Jar file and icon are stored. **Do not make this your current directory, i.e. do not specify "." as the input directory, due to the bug mentioned above.**
*`--name:` the name of the executable that will be installed
*`--main-class:` Java main class
*`--icon:` adds the icon to the executable that will be installed