If you use jMonkeyEngine libraries together with the jMonkeyEngine SDK (recommended) then you benefit from the provided build script. Every new project comes with a default Ant script. The toolbar buttons and clean/build/run actions in the jMonkeyEngine SDK are already pre-configured.
The build script includes targets for the following tasks:
clean – deletes the built classes and executables in the dist directory.
jar – compiles the classes, bundles the assets, builds the executable JAR in the dist directory, copies libraries.
run – builds and runs the executable JAR (e.g. for the developers to test it).
javadoc – compiles javadoc from your java files into html files.
debug – used by the jMonkeyEngine SDK Debugger plugin.
test – Used by the jMonkeyEngine SDK JUnit Test plugin.
You can call these targets on the command line using default Ant commands:
ant clean ant jar ant run
We recommended to use the user-friendly menu items, F-keys, or toolbar buttons in the jMonkeyEngine SDK to trigger clean, build, and run actions.
Browsing the Build Script
To see the build script and the predefined tasks
Open your project in the jMonkeyEngine SDK if it isn’t already open (File > Open Project…)
Open the Files window (Window > Files)
Open the project node. You see
build.xmlto see how the jme3-specify build targets were defined. You typically do not need to edit the existing ones, but you can.
Click the triangle next to
build.xmlto see all targets.
Double-click a target in the Files window, or the Navigator, to see how the target was defined.
You will notice that the file
nbproject/build-impl.xmlopens. It contains very generic targets that you typically will never need to edit. Note that
Adding Custom Targets
The build script is a non-proprietary Apache Ant script. It will work out-of-the-box, but if necessary, you can extend and customize it.
Read the comments in
build.xml, they explain how to override targets, or extend them, to customize the build process without breaking the existing functionality.
Additionally, you can manually override the targets in the
*-impl.xml files that are created when you change the deployment settings:
Simply copy&paste a target from these files into the main build.xml and that will be run instead with all modifications.
* Don’t edit the base
-impl.xml files directly, if you deactivate and reactivate a deployment setting, the SDK resets these files, so you have to copy the whole target and its dependencies, else your build script will become invalid when you disable the deployment option.