Annotation Type Platform
-
@Documented @Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface PlatformDefines native properties for a top-level enclosing class as well as indicates classes and methods that should be generated or not, for specified platforms.A class or method annotated with only
value()ornot()letsGeneratorknow for which platforms it should generate code (or not). The strings are matched withString.startsWith(String). In particular,@Platform(value="")matches all platforms, while@Platform(not="")matches no platforms, providing a way to specify methods to skip or classes to ignore, as if they did not exist. Alternatively, regular expressions can also be used with@Platform(pattern="").Classes annotated with at least one of the other values define a top-enclosing class as returned by
Loader.getEnclosingClass(Class). By default, one native library gets created for each such class, butBuilderrecognizes more than one class with the samelibrary()name and produces only one library in that case.Further, with the
Propertiesannotation, properties can be inherited from other classes, and different properties can be defined for each platform.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String[]cincludeA list of C header files to include at the top of the generated code.java.lang.String[]compilerA list of options applied for the native compiler.java.lang.String[]defineA list of macros to#defineat the top of the generated code, beforeinclude()andcinclude()header files.java.lang.String[]excludeA list of C/C++ header files that should not be included in the generated code, even when they are inherited from an include list.java.lang.String[]executableExecutables to bundle at build time and extract at runtime on load, instead of a library.java.lang.String[]executablepathA list of paths from which to copy executables from theexecutable()value.java.lang.String[]extensionThe platform extensions to attempt to load for this library.java.lang.String[]frameworkA list of frameworks the native compiler should build against.java.lang.String[]frameworkpathA list of framework paths passed to the native compiler for use at link time.java.lang.String[]includeA list of C++ header files to include at the top of the generated code.java.lang.String[]includepathA list of include paths passed to the native compiler.java.lang.String[]includeresourceA list of include resources passed to the native compiler.java.lang.Stringlibraryjava.lang.String[]linkA list of libraries the native compiler should link with.java.lang.String[]linkpathA list of library paths passed to the native compiler for use at link time.java.lang.String[]linkresourceA list of library resources passed to the native compiler for use at link time.java.lang.String[]notThe properties, class, or method do NOT apply to the named platforms.java.lang.String[]patternThe properties, class, or method apply only to the named platforms.java.lang.String[]pragmaA list ofpragmadirectives to list at the top of the generated code, beforedefine()macros and any included header files.java.lang.String[]preloadA list of libraries, in addition tolink(), that should be extracted and preloaded, if possible.java.lang.String[]preloadpathjava.lang.String[]preloadresourcejava.lang.String[]resourceA list of resources, either files or directories, that can be copied and extracted.java.lang.String[]resourcepathA list of paths from which to copy resources from theresource()list.java.lang.String[]valueThe properties, class, or method apply only to the named platforms.
-
-
-
-
pragma
java.lang.String[] pragma
A list ofpragmadirectives to list at the top of the generated code, beforedefine()macros and any included header files.- Default:
- {}
-
-
-
define
java.lang.String[] define
A list of macros to#defineat the top of the generated code, beforeinclude()andcinclude()header files.- Default:
- {}
-
-
-
compiler
java.lang.String[] compiler
A list of options applied for the native compiler. The options here refer to property names. The actual command line options of the native compiler are the values of these properties, which need to be defined elsewhere. On an empty array, theBuilderuses the "platform.compiler.default" property.- Default:
- {}
-
-
-
preload
java.lang.String[] preload
A list of libraries, in addition tolink(), that should be extracted and preloaded, if possible. Accepts "@" + optional version tag and "#" + a second optional name used at extraction (or empty to prevent it).- Default:
- {}
-
-
-
resourcepath
java.lang.String[] resourcepath
A list of paths from which to copy resources from theresource()list.- Default:
- {}
-
-
-
executablepath
java.lang.String[] executablepath
A list of paths from which to copy executables from theexecutable()value.- Default:
- {}
-
-
-
library
java.lang.String library
The native JNI library associated with this class thatBuildershould try to build andLoadershould try to load. If left empty, this value defaults to "jni" + the name thatClass.getSimpleName()returns forProperties.target()orProperties.global()class, or this class, if not given.- Default:
- ""
-
-