Note that this is for building Bindgen itself–to use Bindgen, you can just use a binary distribution from the Joist maven repo, as described in setup.
The source for Bindgen is available in the Bindgen project on GitHub.
Bindgen currently consists of two projects:
bindgen which has the annotation processor implementation andexamples which provides an integration-level test suite.Building bindgen is supported via ant or Eclipse.
Building examples is supported via ant, Eclipse, or maven. Having examples also built via maven ensures bindgen works correctly in its environment.
bindgen in AntIn the processor/ directory, run ant jar. This will create a new bin/jars/bindgen.jar with Bindgen and its dependencies jarjar-ed together.
That’s it–this one is fairly simple.
bindgen in EclipseThe bindgen Eclipse project leverages Eclipse RCP to run and debug a separate, child instance of Eclipse for the examples project.
This means you can debug the annotation processor as it is running over the examples project. This is very useful for development purposes and we extend huge thanks to Walter Harley, an Eclipse APT engineer, for introducing us to this method.
This does mean that you’ll need the Eclipse for RCP/Plug-in Developers distribution of Eclipse instead of just the Java or Java EE distribution.
After you import processor/.project into an Eclipse RCP workspace, the combination of the plugin.xml, META-INF/MANIFEST.MF, the PluginNature in .project, and the examples/lib/annotations.jar (updated by running ant annotations when you change any Bindgen public API), means you should be able to launch the BindgenExamples.launch target.
This will create a new instance of Eclipse. Initially the workspace will be empty, so you will need to import the examples/.project file.
Now you should be set. Setting debug points in the Bindgen implementation and then either saving files or running clean in the examples Eclipse should hit your debug points.
examples in AntRun ant tests.
Note that this will use the latest processor/bin/jars/bindgen.jar, so you will need to run ant jar in the bindgen project first (and each time you want to see your Bindgen changes in the examples project).
examples in EclipseSee the previous section on building bindgen in Eclipse–the RCP child Eclipse instance that runs against examples is the best way of working with the examples project in Eclipse.
examples in MavenTo test the snapshot version of Bindgen, first in bindgen run ant ivy.publish-maven-user to get bindgen-SNAPSHOT into your ~/.m2/repository.
Now in examples run mvn clean test.