-
Notifications
You must be signed in to change notification settings - Fork 77
Build
[TOC]
BridJ is built as part of the NativeLibs4Java sub-projects.
This will build all of NativeLibs4Java's projects, including JNAerator. It will take some time, so you'll want to have a coffee during the build (if you've never used Maven before, this can take up to 15 minutes, so that might be enough for two coffees).
Subsequent builds will be much quicker (see next section), and can be launched from your Maven-aware IDE of choice.
- First, install Maven.
- Checkout nativelibs4java files :
svn checkout http://nativelibs4java.googlecode.com/svn/trunk/libraries nativelibs4java cd nativelibs4java
* Run the following Maven command :
```
mvn install -Dmaven.test.skip=true
BridJ's JARs are in Runtime/Bridj/target
(pick bridj-x.x-SNAPSHOT.jar
if you don't have specific size needs).
JAR File | C | C++ | COM | MFC | Objective-C | .NET | Windows | MacOS X | Linux | Solaris | FreeBSD |
---|---|---|---|---|---|---|---|---|---|---|---|
bridj-x.x-SNAPSHOT.jar |
x | x | x | x | x | x | x | x | x | x | |
bridj-x.x-SNAPSHOT-c-only.jar |
x | x | x | x | x | ||||||
bridj-x.x-SNAPSHOT-windows-only.jar |
x | x | x | x | x | x | |||||
bridj-x.x-SNAPSHOT-unix-only.jar |
x | x | x | x | x | x | |||||
bridj-x.x-SNAPSHOT-macosx-only.jar |
x | x | x | x |
cd Runtime/BridJ
mvn clean install
TODO(ochafik): update this section
See README.md at the root of the repo.
If it's not a platform already supported by BridJ, you must update Runtime/BridJ/src/main/velocity/org/bridj/JNI.java
and Platform.java so it can find your binary at runtime (search for getEmbeddedLibraryResource
in [http://code.google.com/p/nativelibs4java/source/browse/trunk/libraries/Runtime/BridJ/src/main/velocity/org/bridj/JNI.java]).
To run the tests on your new binary :
mvn test
BridJ contains Java and C code.
Some of its sources are autogenerated from Velocity templates. For instance, all the Pointer.getInt, .setInt, getFloat, .setFloat... are generated automatically from a template.
So if you look for Pointer.java and JNI.java, they're not directly in the source control : they're created during the Maven build from their template located in src/main/velocity
.
Likewise, some test classes are autogenerated, which helps cover more cases with less code (there's even autogenerated C functions in the test library, that is matched by the corresponding autogenerated test cases on the Java side).