You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively, you can put all the command line arguments into a JSON file which might look like this:
39
39
40
-
> my-packaging-config.json
41
40
```json
42
41
{
43
42
"platform": "mac",
@@ -62,7 +61,7 @@ Alternatively, you can put all the command line arguments into a JSON file which
62
61
You can then invoke the tool like this:
63
62
64
63
```bash
65
-
java -jar packr.jar my-packaging-config.json
64
+
java -jar packr.jar my-packr-config.json
66
65
```
67
66
68
67
Finally, you can use packr from within your code. Just add the JAR file to your project, either manually, or via the following Maven dependency:
@@ -145,17 +144,17 @@ outdir/
145
144
icons.icns [if config.icon is set]
146
145
```
147
146
148
-
You can futher modify the Info.plist to your liking, e.g. add icons, a bundle identifier etc. If your `outdir` has the `.app` extension it will be treated as an application bundle by Mac OS X.
147
+
You can further modify the Info.plist to your liking, e.g. add icons, a bundle identifier etc. If your `outdir` has the `.app` extension it will be treated as an application bundle by Mac OS X.
149
148
150
149
## Executable command line interface
151
150
152
151
By default, the native executables forward any command line parameters to your Java application's main() function. So, with the configurations above, `./myapp -x y.z` is passed as `com.my.app.MainClass.main(new String[] {"-x", "y.z" })`.
153
152
154
-
The executables themselves expose an own interface, which has to be explicitely enabled by passing `-c` or `--cli` as the **very first** parameter. In this case, a special delimiter paramter`--` is used to separate the native CLI from parameters to be passed to Java. In this case, the example above would be equal to `./myapp -c [arguments] -- -x y.z`.
153
+
The executables themselves expose an own interface, which has to be explicitly enabled by passing `-c` or `--cli` as the **very first** parameter. In this case, a special delimiter parameter`--` is used to separate the native CLI from parameters to be passed to Java. In this case, the example above would be equal to `./myapp -c [arguments] -- -x y.z`.
155
154
156
-
Try `./myapp -c --help` for a list of available options.
155
+
Try `./myapp -c --help` for a list of available options. They are also listed [here](https://github.com/libgdx/packr/blob/master/src/main/native/README.md#command-line-interface).
157
156
158
-
The Windows executables do not show any output by default. Here you can use `myapp.exe -c --console --help` to spawn a console window, making terminal output visible.
157
+
> Note: On Windows, the executable does not show any output by default. Here you can use `myapp.exe -c --console --help` to spawn a console window, making terminal output visible.
159
158
160
159
## Building
161
160
@@ -167,13 +166,14 @@ mvn clean package
167
166
168
167
This will create a `packr-VERSION.jar` file in `target` which you can invoke as described in the Usage section above.
169
168
170
-
If you want to compile the native executables used by packr, please follow [these instructions](https://github.com/libgdx/packr/blob/master/src/main/native/README.md). Each of the build scripts will create executable files for the specific platform and copy them to src/main/resources.
169
+
If you want to compile the native executables, please follow [these instructions](https://github.com/libgdx/packr/blob/master/src/main/native/README.md). Each of the build scripts will create executable files for the specific platform and copy them to src/main/resources.
171
170
172
171
## Limitations
173
172
174
173
* Icons aren't set yet on Windows and Linux, you need to do that manually.
175
174
* Minimum platform requirement on MacOS is OS X 10.7.
176
-
* JRE minimization is very conservative. Depending on your app, you can carve out stuff from a JRE yourself, disable minimization and pass your custom JRE to packr
175
+
* JRE minimization is very conservative. Depending on your app, you can carve out stuff from a JRE yourself, disable minimization and pass your custom JRE to packr.
176
+
* On MacOS, the JVM is spawned in its own thread by default, which is a requirement of AWT. This does not work with code based on LWJGL3/GLFW, which needs the JVM be spawned on the main thread. You can enforce the latter with the `-XstartOnFirstThread` VM argument in your packr config.
0 commit comments