| JamPlus manual
    | 
The Java module contains special build rules to create Java applications and modules.
The first step when using the java module is to include it.
A simple example follows showing the process for building dlib.jar for a Defold build.
Note: This documentation came from the Android Rules. It is not fully up to date yet.
Compiles SOURCES and links them into TARGET.
| TARGET | The target to link SOURCESinto. The target name is given without extension.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| SOURCES | The list of .javato link into the application. Object and compiled Windows resource files may also be passed with this list. | 
An Android application may contain user assets. The Java.Assets rule allows specification of the directory to be recursed and stored within the Android .apk application package.
Call Java.Assets before calling android.Package.
| TARGET | The target to attach the assets directory to. | 
| DIRECTORY | The base directory to use for the assets. There can only be one directory specified. | 
Specify paths to search when locating prebuilt JARs during the Java.Library and android.Package rule calls.
| TARGET | The target to apply the JAR search DIRECTORIESto.TARGETis optional if rule ActiveTarget TARGET has been specified. IfTARGETis*, the directories are applied to every target needing them. | 
| DIRECTORIES | The list of directories to use when searching for JAR files. If relative directories are specified, they are rooted against the current rule SubDir VAR d1...dn : TARGET_DIRECTORY : OPTIONS. | 
Java.Library takes a list of Java SOURCES and builds a Java library out of them. It takes into account the following:
- Any directories given for .jar searching via rule Java.JarDirectories TARGET : DIRECTORIES.
- Any prebuilt .jar files listed via rule Java.PrebuiltJars TARGET : LIBRARIES.
- Any prebuilt .aar files listed via rule Java.PrebuiltAars TARGET : LIBRARIES. Any
AndroidManifest.xmlfiles within the .aar files are merged into a finalAndroidManifest.xmlfor rule android.Package TARGET [ : TOOLCHAINS [ : OPTIONS ] ].- The search paths for .java files specified with rule Java.SourcePaths TARGET : DIRECTORIES.
- An
AndroidManifest.xmlfor the target whose target name is given with rule Java.Manifest TARGET : MANIFEST.- A package name given with rule Java.Package TARGET [ : TOOLCHAINS [ : OPTIONS ] ] or automatically derived from the target's
AndroidManifest.xml.- An assets directory given via rule Java.Assets TARGET : DIRECTORY.
- A resources directory given by rule Java.Resources TARGET : DIRECTORIES.
Dependencies are automatically derived, where possible, by looking at the contents of the .java files.
The resulting file is a .jar file.
| TARGET | The target to assign the FLAGSto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| SOURCES | The list of .javaand.aidlfiles to build into a.jar. | 
| OPTIONS | Unused (except that rule Java.Application TARGET : SOURCES just calls Java.LibrarywithOPTIONSofapplication). | 
Makes TARGET depend on Jam-generated .jar LIBRARIES and uses them during linking.
| TARGET | The target to link LIBRARIESto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| LIBRARIES | The list of libraries to apply. These libraries are those generated from the rule Java.Library TARGET : SOURCES : OPTIONS rule. They do not include prebuilt libraries. To link prebuilt libraries, use the rule android.PrebuiltJars TARGET : LIBRARIES rule. | 
Assigns MANIFEST to be the "AndroidManifest.xml" file for this TARGET.
This rule is unneeded if MANIFEST is just an AndroidManifest.xml file found within $(SUBDIR).
| TARGET | The target to assign the MANIFESTto. | 
| MANIFEST | The target name of the AndroidManifest.xml. | 
Makes TARGET depend on Jam-generated NATIVE_LIBRARIES. These are packaged during the rule Java.Package TARGET [ : TOOLCHAINS [ : OPTIONS ] ] process.
| TARGET | The target to package the NATIVE_LIBRARIESinto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| NATIVE_LIBRARIES | The list of libraries to apply. These are shared libraries are those generated from the rule C.Library TARGET : SOURCES [ : OPTIONS ] rule. They do not include prebuilt libraries. To package native prebuilt libraries, use the rule Java.NativePrebuiltLibraries TARGET : NATIVE_PREBUILT_LIBRARIES rule. | 
Makes TARGET depend on preexisting shared NATIVE_PREBUILT_LIBRARIES. These are packaged during the rule Java.Package TARGET [ : TOOLCHAINS [ : OPTIONS ] ] process.
| TARGET | The target to package the NATIVE_PREBUILT_LIBRARIESinto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| NATIVE_PREBUILT_LIBRARIES | The list of native prebuilt shared libraries to apply. These libraries are shared libraries existing somewhere in the filesystem and are specified without an extension and without the leading 'lib' prefix. For shared libraries generated from the rule C.Library TARGET : SOURCES [ : OPTIONS ] rule, use the rule Java.NativeLibraries TARGET : NATIVE_LIBRARIES rule. | 
For the given TARGET, search DIRECTORIES for any libraries requested via rule Java.NativeLibraries TARGET : NATIVE_LIBRARIES. This rule must be called before rule android.Package TARGET [ : TOOLCHAINS [ : OPTIONS ] ].
Native libraries are searched for the following order:
- Whatever
SEARCHdirectories the user added.- The directories given through
DIRECTORIESwith an architecture appended. Current architectures arearm,armeabi-v7a, andx86.
| TARGET | The target to assign the native prebuilt library search DIRECTORIESto.TARGETis optional if rule ActiveTarget TARGET has been specified. IfTARGETis*, the defines are made available globally. | 
| DIRECTORIES | The list of directories to apply. Absolute paths are used directly. Relative paths are local to $(SUBDIR). That is, they are relative to the subdirectory specified via SubDir. | 
In order to output a final .apk to be installed on an Android device, the Java.Package rule must be called. If TOOLCHAINS is specified, those requested toolchain components are packaged into the .apk. The passed in OPTIONS include additional build instructions such as automatic installation on a USB-connected Android device.
Java.Package should be the last rule called in a sequence of rule calls describing the build of an Android application.
| TARGET | The target to build. | 
| TOOLCHAINS | (optional) The list of toolchains used to build multiple architectures for the package. The default toolchain is used if none are specified. | 
| OPTIONS | The list of options applied when building the package. | 
install- Installs the .apk on the USB-connected Android device.
Specify the package name for TARGET, generally in the form of com.module.submodule.
By default, this is read from the AndroidManifest.xml, so only call this if an override is needed.
| TARGET | The target to assign the link FLAGSto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| PACKAGE_NAME | The package name to use. | 
Assigns the location to output the final .apk to. This rule must be called prior to Java.Package.
| TARGET | The target to build. | 
| PACKAGE_OUTPUT_PATH | The directory to output the final .apk to. If a relative path is provided, that path is rooted against $(SUBDIR). | 
List out .aar files that Java.Library or android.Application need to link against. Makes TARGET depend on these preexisting .aar files.
By default, .aar files are searched for in $(SUBDIR)/libs.
| TARGET | The target to link the LIBRARIESinto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| LIBRARIES | The list of preexisting .aarfiles to use as part of the build, specified without the.aarextension. | 
List out the .jar files that Java.Library or android.Application need to link against. Makes TARGET depend on these preexisting .jar files.
The LIBRARIES specified are, by default, searched for in $(SUBDIR).
| TARGET | The target to link the LIBRARIESinto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| LIBRARIES | The list of preexisting .jarfiles to use as part of the build, specified without the.jarextension. | 
Sets the Java.versionName and android.versionCode properties in a build.gradle file.
| VERSION_NAME | The version name to be put into the AndroidManifest.xml'sandroid:versionName. | 
| VERSION_CODE | The version code to be put into the AndroidManifest.xml'sandroid:versionCode. | 
Sets DIRECTORIES as the locations to search for Android resources at when TARGET is built.
| TARGET | The target to which the resource search DIRECTORIESshould be applied. If not specified,TARGETdefaults to the active target set via ActiveTarget. | 
| DIRECTORIES | The list of directories to search for resources. Relative directories are rooted against $(SUBDIR). | 
Sets the Android SDK_VERSION and ARCHITECTURE for the toolchain. Call this before any other Java.* rules.
Java.SDK attempts detection number of Android-specific tools and SDKs:
- If the variable
NDKROOTis not specified, the location of the Android NDK is searched for in an OS-dependent fashion.
- On Windows,
c:/Program Files (x86)/Androidand thenc:/is searched for a directory namedandroid-ndkand a couple versioned derivatives.- Afterward,
C.ARCHITECTUREis evaluated, and various compilation and linker flags are setup for use with the NDK.- Next,
C.COMPILERis evaluated, and an NDK compiler toolchain is selected based on whetherC.COMPILERis set togccorclang.- The Android SDK is detected next. If
ANDROID_SDK_ROOTis set to a path, that path is assumed to be the root of the Android SDK toolchain. Otherwise, an OS-dependent default is chosen:
- On Windows,
c:/Program Files (x86)/Android/android-sdkis assumed to contain a properly installed Android SDK.
| SDK_VERSION | Defaults to 19. | 
| ARCHITECTURE | Defaults to armv7-a. | 
Sets the Android SDK_COMPILE_VERSION to build against. Corresponds to the Java.compileSdkVersion property in a build.gradle file.
| SDK_COMPILE_VERSION | Defaults to the version specified by rule Java.SDK SDK_VERSION : ARCHITECTURE. | 
Sets the Android SDK_MINIMUM_VERSION to ensure a build against. Corresponds to the Java.minSdkVersion property in a build.gradle file.
| SDK_MINIMUM_VERSION | Defaults to the version specified by rule Java.SDK SDK_VERSION : ARCHITECTURE. | 
Sets up the keystore information for the Android package. Java.Sign must be called before android.Package.
| TARGET | The target to sign. TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| KEYSTORE_PATH_PASSWORD_KEY | This parameter contains 4 entries, the path to the keystore, the password of the keystore, the key to use when accessing the keystore, and the password. | 
Specify the source path for the Java files being built by TARGET. Java.SourcePaths must be called before android.Application or android.Library.
| TARGET | The target to assign the Java search path DIRECTORIESto.TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| DIRECTORIES | The list of directories to scan to find .javafiles. A given directory may either be absolute or relative. If relative, it is assumed to be based off of$(SUBDIR). | 
Specify extensions to leave uncompressed when building the .apk. This must be called before Java.Package.
| TARGET | The target to leave the uncompressed file entries within. TARGETis optional if rule ActiveTarget TARGET has been specified. | 
| UNCOMPRESSED_ASSET_EXTENSIONS | The list of extensions to leave uncompressed. Do not include a period in front of the extension. |