Annotation Interface Platform
A class or method annotated with only value()
or not()
lets Generator
know for which platforms it should generate code
(or not). The strings are matched with String.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, but Builder
recognizes
more than one class with the same library()
name and produces only one
library in that case.
Further, with the Properties
annotation, properties can be inherited
from other classes, and different properties can be defined for each platform.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]
A list of C header files to include at the top of the generated code.String[]
A list of options applied for the native compiler.String[]
A list of macros to#define
at the top of the generated code, beforeinclude()
andcinclude()
header files.String[]
A list of C/C++ header files that should not be included in the generated code, even when they are inherited from an include list.String[]
Executables to bundle at build time and extract at runtime on load, instead of a library.String[]
A list of paths from which to copy executables from theexecutable()
value.String[]
The platform extensions to attempt to load for this library.String[]
A list of frameworks the native compiler should build against.String[]
A list of framework paths passed to the native compiler for use at link time.String[]
A list of C++ header files to include at the top of the generated code.String[]
A list of include paths passed to the native compiler.String[]
A list of include resources passed to the native compiler.String[]
A list of libraries the native compiler should link with.String[]
A list of library paths passed to the native compiler for use at link time.String[]
A list of library resources passed to the native compiler for use at link time.String[]
The properties, class, or method do NOT apply to the named platforms.String[]
The properties, class, or method apply only to the named platforms.String[]
A list ofpragma
directives to list at the top of the generated code, beforedefine()
macros and any included header files.String[]
A list of libraries, in addition tolink()
, that should be extracted and preloaded, if possible.String[]
String[]
String[]
A list of resources, either files or directories, that can be copied and extracted.String[]
A list of paths from which to copy resources from theresource()
list.String[]
The properties, class, or method apply only to the named platforms.
-
Element Details
-
value
String[] valueThe properties, class, or method apply only to the named platforms. The strings are matched withString.startsWith(String)
- Default:
{}
-
not
String[] notThe properties, class, or method do NOT apply to the named platforms. The strings are matched withString.startsWith(String)
- Default:
{}
-
pattern
String[] patternThe properties, class, or method apply only to the named platforms. The strings are matched as regular expressions withString.matches(String)
.- Default:
{}
-
pragma
String[] pragmaA list ofpragma
directives to list at the top of the generated code, beforedefine()
macros and any included header files.- Default:
{}
-
define
String[] defineA list of macros to#define
at the top of the generated code, beforeinclude()
andcinclude()
header files.- Default:
{}
-
exclude
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.- Default:
{}
-
include
String[] includeA list of C++ header files to include at the top of the generated code.- Default:
{}
-
cinclude
String[] cincludeA list of C header files to include at the top of the generated code. The#include
directives will be generated in aextern "C" { }
block.- Default:
{}
-
includepath
String[] includepathA list of include paths passed to the native compiler.- Default:
{}
-
includeresource
String[] includeresourceA list of include resources passed to the native compiler.- Default:
{}
-
compiler
String[] compilerA 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, theBuilder
uses the "platform.compiler.default" property.- Default:
{}
-
linkpath
String[] linkpathA list of library paths passed to the native compiler for use at link time.- Default:
{}
-
linkresource
String[] linkresourceA list of library resources passed to the native compiler for use at link time.- Default:
{}
-
link
String[] linkA list of libraries the native compiler should link with. Accepts "@" + optional version tag and "#" + a second optional name used at extraction (or empty to prevent it).- Default:
{}
-
frameworkpath
String[] frameworkpathA list of framework paths passed to the native compiler for use at link time.- Default:
{}
-
framework
String[] frameworkA list of frameworks the native compiler should build against.- Default:
{}
-
preloadpath
String[] preloadpath- Default:
{}
-
preloadresource
String[] preloadresource- Default:
{}
-
preload
String[] preloadA 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
String[] resourcepathA list of paths from which to copy resources from theresource()
list.- Default:
{}
-
resource
String[] resourceA list of resources, either files or directories, that can be copied and extracted.- Default:
{}
-
extension
String[] extensionThe platform extensions to attempt to load for this library. The names here are appended to the platform name and looked up in the class path.- Default:
{}
-
executablepath
String[] executablepathA list of paths from which to copy executables from theexecutable()
value.- Default:
{}
-
executable
String[] executableExecutables to bundle at build time and extract at runtime on load, instead of a library.- Default:
{}
-
library
String libraryThe native JNI library associated with this class thatBuilder
should try to build andLoader
should 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:
""
-