|
CommandLineOptionsAndEnvironmentVariables
JNAerator's command-line options & environment variables
JNAerator FilesAs the number of arguments needed for a project might quickly grow and produce insane command lines, you might consider putting some or all of your arguments in a *.jnaerator file (preferably, config.jnaerator). Please read JNAeratorFiles for more details about these files, and JNAeratorFAQ for more general questions. Syntaxjava -jar jnaerator.jar options headerFiles dynamicLibrariesFiles Options
Any header (or directory containing headers at any level of hierarchy), shared library, *.bridgesupport file or *.jnaerator file (deprecated) Do not compile JNAerated headers (deprecated) Do not create an output JAR Do not bundle libraries in output JAR Show command line arguments help Define a macro symbol Add a directory to the frameworks path. See doc of JNAERATOR_FRAMEWORKS_PATH Add a directory to the include path or include a file. See doc of JNAERATOR_INCLUDE_PATH Undefine a preprocessor symbol after the autoconfiguration phase. Remove this directory from the path of descendant source files in the generated documentation. Colon-separated list of file extensions used to restrict files used when recursing on directories, or "*" to parse all files (by default = h:hpp:hxx) Define the current architecture for libraries (state variable) Generate getters and setters for struct fields Transform C names to Java-looking names : some_func() => someFunc() Write the definitions extracted from bridgesupport files in a file (automatically set when ${Verbose} is used). Name of the invocation method of callbacks ('apply' by default) Read the function alternative choices from a file in the format used by -choicesOut. Write the function alternative choices made (automatically set when ${Verbose} is used). Generate Microsoft COM (C++) bindings. Experimental conversion of function bodies to equivalent Java code (BridJ only). Name of output library for elements declared in files not covered by a ${CurrentLibrary} switch JNAerate libraries that use JNA's faster direct call convention Don't cast generated constants Treat empty structs as forward declarations Generate a class entryclassName.EntryClassName that will contain all of the jnaerated libraries instances. User code will just need to static import or derive from this class to access to the instances. Write the symbols extracted from libraries in a file (automatically set when ${Verbose} is used). Force the overwrite of existing files Consider source files as being already preprocessed (preprocessor won't be run) JNAerate a framework using its headers and its *.bridgesupport files if available See doc of JNAERATOR_FRAMEWORKS_PATH Use GCC convention for size of 'long' (4 bytes on 32 bits platforms, 8 bytes on 64 bits platforms). [Experimental, Not working at all] Generate C++ classes. Generate wrappers for private fields and methods (will be protected and deprecated). Show minimalist progression GUI Conditional evaluation of an argument if a java system property matches a regular expression Jar file where all generated sources and the compiled classes go Bundle the provided file with the JNAerated JAR so that it is extracted with the library when it is first used. Define the name of the output library. This is a state parameter, it will affect all files listed after it, until another -library switch is provided. It does not affect sources included from a project file (Visual Studio...). C functions exported in library "test" will end up in class "TestLibrary", for instance. The name of the library is the one fed to JNA to find the shared library, so library "test" must be in "test.dll" on Windows, "libtest.dylib" on Mac OS X and "libtest.so" on other Unices. Note that a special hack is done for library "c" on Windows systems : the output name is set to "msvcrt" instead of "c".
Define prefixes commonly used in the library so that reification of functions is optimal (See -reification) Avoid useless comments (source file + line, skipped items...) Write the preprocessor macros in a file (automatically set when ${Verbose} is used). Set artifact id of the generated Maven project Set group id of the generated Maven project Set version of the generated Maven project Maximum number of fields allowed for structure fields constructors. If a struct has more fields, it will only get a default constructor. Choose the output mode of JNAerator No auto-configuration of preprocessor symbols and paths Don't add import statements automatically to output java source files Don't output any member comment. Don't output any C++ name mangling information (may cause C++-decorated symbols not to be found at execution time). Never output primitive arrays for function arguments (use NIO buffers instead) Prevent const char* and const wchar_t* return types from being converted to String and WString. Do not define the cplusplus symbol Output directory for all artifacts Define a format for online documentation URLs (uses MessageFormat syntax, with arg 0 being the name of the function / structure). Set the Java package in which all the output will reside (by default, set to the library name). Splits the pre-processor output into multiple smaller parts and parse them separately (in theory everything should be parsed in one chunk, but in practice this means errors are not isolated from the rest of the parsing) Use Sun's Javac compiler instead of Eclipse's ecj, if possible Write the preprocessor output in a file (automatically set when ${Verbose} is used). Read Visual Studio 2008 project or solution file and use the configuration specified (e.g. "Release|Win32"). Automatically create OO shortcuts for functions that look like methods (typedPtr.someFunc() for someFunc(typedPtr)) Remove inline asm from preprocessed source, useful when its unsupported syntax makes parsing to fail. Define the root package for all output classes Choose target runtime library between JNA, JNAerator (based on JNA), BridJ (faster runtime that supports C++) (default: BridJ (faster runtime that supports C++)). Experimental Output Scala wrappers (callbacks implicits...) Generate Scala-style setters for BridJ structs (with a name like fieldName$eq) Extract, unmangle and parse the symbols all listed shared libraries Treat size_t and ptrdiff_t values as 'long' values. ONLY HERE FOR COMPATIBILITY WITH PREVIOUS VERSIONS, WILL EVENTUALLY BE REMOVED. Skip Included Frameworks Skip library instance declarations Force structs to be JNAerated as inner classes of their declaring libraries (otherwise, each top-level structure is defined as a top-level class in its library's package) Launch JNAeratorStudio Generate synchronized native methods Verbose output (both console and files) Force treatment of wchar_t as short (char by default) Output a wiki-friendly help Read command-line arguments from a file. File may contain multiple lines (those beginning with "//" will be skipped), file wildcards will be resolved within the file content, as well as variables substitutions : $(someEnvOrJavaVarName), with $(DIR) being the parent directory of the current arguments file. Environment VariablesAll of these variables may be overridden by setting the environment variable ( set VAR=value on Windows, export VAR=value on most unices) or through Java properties ( java -DVAR=value -jar jnaerator.jar ... ).
C:\Program Files\Microsoft Visual Studio 9.0 C:\Program Files\Microsoft SDKs\Windows\v6.0A
/System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks:\ /System/Library/Frameworks/ApplicationServices.framework/Versions/Current/Frameworks:\ /System/Library/Frameworks:\ /Library/Frameworks:\ ~/Library/Frameworks | |
► Sign in to add a comment
what exactly means the syntax "(?i)-noJar"? trying -noJar seems to be ignored.
Hi Kai,
The -noJar switch is currently buggy, it only works when combined to -noComp Cheers -- Olivier
(and the (?i) stuff is a regular expression : means "switch case-insensitive mode on", see http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html)
hello, i am getting the below error in the generated native declaration "Conversion Error : WINAPI"
...etc
command line entry: java -jar jnaerator-0.9.4.jar -preferJavac -package com.crossmatch.lscan -library LScanEssentials D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\ImageData?.h D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi_defs.h D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi_err.h D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\WinDef?.h D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi.h
any idea why ? thanks
i added the "WinDef?.h" to recognize WINAPI but still didnt work.
I got the following error message from jnaerator "winnt.h:18:2034: error: #error Must define a target architecture"
I try to use the -arch option with value i386 but i got the same error
Any solutions? thanks
Is there a way to disable output of methods with "?ByReference?" parameters? These are deprecated anyway, so it would be nice not to generate them.
Can't I decide what java class name I want to use (while using -direct flag)? What I would like is to be able to have one class per header file from instead of one class representing all header files.
I tried this program on an SDK like: java -jar ~/Downloads/jnaerator-0.9.10-SNAPSHOT-20120306.jar -I include -I /usr/include/linux include/pmdsdk2.h and it looked like it worked. Yet the jar file generated has java files with lots of messages like:
Are these important?