Giter Club home page Giter Club logo

Comments (9)

saudet avatar saudet commented on July 3, 2024

Please try to use the Maven plugin as per the JavaCPP Presets or Gradle JavaCPP:
https://github.com/bytedeco/gradle-javacpp

from javacpp-presets.

iexavl avatar iexavl commented on July 3, 2024

Please try to use the Maven plugin as per the JavaCPP Presets or Gradle JavaCPP: https://github.com/bytedeco/gradle-javacpp

I looked through it and some other stuff but to be honest I am still quite confused about how I'm supposed to use it.. I'd like to ask is the plugin able to parse native header files or does that have to be done with the javacpp.jar ?

from javacpp-presets.

saudet avatar saudet commented on July 3, 2024

Sure, please start here: https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets

from javacpp-presets.

iexavl avatar iexavl commented on July 3, 2024

Sure, please start here: https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets

yeah I also gave that a read before making a post. Still couldn't quite get it but after giving it another look I decided to take a peek in the pom.xml that's in the base javacpp-presets and I think I found what I needed, but it still doesn't work. More specifically this part seems to not be working:

                    <execution>
                        <id>javacpp-parser</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>parse</goal>
                        </goals>
                        <configuration>

                            <outputDirectory>${project.basedir}/src/gen/java</outputDirectory>
                            <classOrPackageName>org.example.*</classOrPackageName>
                        </configuration>
                    </execution>

In org.example there is a class called Mapper that has a Properties and Platform annotation with an included .hpp header and a target and global. For some reason when I run mvn clean install though, I get this:
[WARNING] No classes found in package org.example

from javacpp-presets.

saudet avatar saudet commented on July 3, 2024

You'll need to compile those classes with a call to maven-compiler-plugin before that.

from javacpp-presets.

iexavl avatar iexavl commented on July 3, 2024

You'll need to compile those classes with a call to maven-compiler-plugin before that.
Here are all the plugins in my pom.xml, which also includes the maven-compiler-plugin (still doesn't work)

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                    </execution>
                    <execution>
                        <id>javacpp-parser</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>${project.build.sourceDirectory}/org/example/*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.bytedeco</groupId>
                <artifactId>javacpp</artifactId>
                <version>1.5.9</version>
                <configuration>
                    <classPath>${project.build.outputDirectory}</classPath>
                    <includePaths>
                        <includePath>${project.build.sourceDirectory}/org/example/nat/</includePath>
                    </includePaths>
                    <copyLibs>true</copyLibs>
                </configuration>
                <executions>
                    <execution>
                        <id>javacpp-validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <targetDirectories>
                                <targetDirectory>${project.basedir}/src/gen/java</targetDirectory>

                            </targetDirectories>
                        </configuration>
                    </execution>
                    <execution>
                        <id>javacpp-parser</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>parse</goal>
                        </goals>
                        <configuration>

                            <outputDirectory>${project.basedir}/src/gen/java</outputDirectory>
                            <classOrPackageName>org.example.*</classOrPackageName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>javacpp-compiler</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/native/${javacpp.platform.nativeOutputPath}</outputDirectory>

                            <classOrPackageName>org.example.**</classOrPackageName>
                            <copyLibs>true</copyLibs>
                            <copyResources>true</copyResources>
                            <configDirectory>${project.build.directory}/native/META-INF/native-image/nativeImage/</configDirectory>
                        </configuration>
                    </execution>
                </executions>

            </plugin>

from javacpp-presets.

saudet avatar saudet commented on July 3, 2024

So, everything works? We can close this?

from javacpp-presets.

saudet avatar saudet commented on July 3, 2024

No, I guess not. Like I said, try to do like with the presets.

from javacpp-presets.

iexavl avatar iexavl commented on July 3, 2024

No, I guess not. Like I said, try to do like with the presets.

I think I may have accidentally deleted the rest of my comment aside from the maven stuff. Yeah it still doesn't work (I actually did have the compiler-plugin before that as well) and also that is pretty much exactly like how the presets do it. I suppose I will take a look again a bit later but at the moment I have ran into another issue.

from javacpp-presets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.