bytedeco / sample-projects

Sample project files for JavaCPP, JavaCPP Presets, and JavaCV
219 stars 174 forks source link

How to generate java class with function adapters by maven? #65

Closed ValentinaBaranova closed 2 years ago

ValentinaBaranova commented 2 years ago

Hello. I looked into javacpp-mvn-simple-demo, and it already contains native function in java for cpp function. But javacpp also provides ability to generate class with such function for class which implemets InfoMapper. I have to run such commands manually now:

mvn clean compile && cd target/classes \
&& java -jar ../../javacpp.jar test.GreeterConfig \
&& cp test/Greeter.java ../../src/main/java/test;

And only after it I can package project with javacpp plugin. Is there a way to not run such commands manually and do it by maven?

saudet commented 2 years ago

The starting point for that is the JavaCPP Presets and there's a guide here: https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets Instead of inheriting from the parent pom.xml though, you can safely copy anything from it.

ValentinaBaranova commented 2 years ago

Thanks a lot, I will try.