I haven’t been able to find a decent tutorial on the new Create Bindings features so I just messed around with it for hours and found a way that works. I made an MOE Project called “TestMOE” because LibGDX projects can be a little goofy for generating bindings. I use it as a workhorse to generate all my bindings. For some reason the MOE context menu is always grayed on on this project so I had to make a basic .nbc file (in my LibGDX project) and copy it over to this project.
Then you put your framework in the project (there’s only one level in this project so everything is at the same level). Rename the .nbc file with a new name like “google-ads.nbc”. Then open the file and you’ll see below how I configured it to make it work.
Click the green plus and name it whatever you want. I couldn’t figure out how to do the Framework option so I just selected the Header option. The inline function output and the conf input and output can be left blank.
For Header path just point it to the Headers folder in your framework. For base package name I use com.moe.bindings. It will append the framework name to that package name if you use a framework. Explicit library I don’t think has to be set but I set it to the framework’s library (file in the framework with same name as framework but with no file extension).
For Header search paths and User header search paths I set it to the same Header folder in the framework. For framework search path you’ll want to set that to the root framework directory. If any of the headers use a sub framework it will start the search for it there.
For import headers this is just a list of which headers you want bindings for. You’ll really only need the headers that you interact with via Java. Or you can list all of them, doesn’t hurt except for more space taken up by the bindings. The imports need to be in the form #import "headerName.h"
I tried several formats and that’s the only way I could get it to work. I’m sure there’s a way to do it with angle brackets for certain headers but that’s beyond me.
Then click the Settings button (gear) and Generate Bindings.
One last thing I had to do was change the formatting of some of the import statements in the .h files. MOE didn’t seem to like the angle bracket notation that some of the Google Ads import statements were using. So if you have any errors about not being able to find certain header files, be sure to go to the designated .h file and change the import statements to just use the header file name in quotes.
You’ll find the generated bindings in your src/main/java folder under the appropriate package name. Hope that helps! It took me a lot of toil to figure out how to make this process work but it’s magic once everything is setup right.
Image of my finished .nbc file:
