hzzc1987 / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

maven plugin: allow specifying in-pom cmd-line arguments #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
what:
in addition to the ${project.basedir}/src/main/jnaerator/config.jnaerator file, 
allow specifying arguemtns like this:
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.jnaerator</groupId>
        <artifactId>maven-jnaerator-plugin</artifactId>
        <configuration>
          <arguments>
            <argument>-noCpp</argument>
            <argument>${project.basedir}/src/main/native/myHeader.h</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

why:
when specifying my header file, i found no solution to reliably, specify a 
relative path to the myHeader.h file. when the plugin executes JNAerator, we 
can not rely on PWD == ${project.basedir}.

alternatives:
* if possible, switch the PWD to ${project.basedir} during the execution of 
JNAErator.
* allow usage of external vars in config.jnaerator
bot not so nice (and also harder to implement) in my eyes.

useful reference:
http://www.sonatype.com/books/maven-book/reference/writing-plugins-sect-multival
-params.html

misc:
Thanks a lot for that plugin. It is really very nice to wrapp a library with 
this!
Also for JNAerator itsself of course :-)

Original issue reported on code.google.com by robin.vobruba@gmail.com on 13 Sep 2010 at 10:03

GoogleCodeExporter commented 8 years ago
...found this solution:
$(DIR)/../../../src/main/native/myHeader.h
or:
$(DIR)/../native/myHeader.h

(sorry ;-) )

do not know if the proposal still makes sense now. feel free to close it.

Original comment by robin.vobruba@gmail.com on 13 Sep 2010 at 10:10

GoogleCodeExporter commented 8 years ago
Hello Robin,

Thanks for your proposal and kind feedback :-)

While the workaround you found should be technically enough (I'm using it in 
JavaCL and Mono4Java, for instance), I guess it won't hurt if I also expose 
some Maven-specific variables as JNAerator file variables to avoid having to 
resort to ../.. sequences (the $(VAR) syntax already gives access to 
environment variables and Java properties, but not the maven properties yet).

If you see other variables than project.basedir, feel free to list them here so 
I take them into account when I find some time for this enhancement.

Cheers
--
Olivier

Original comment by olivier.chafik@gmail.com on 13 Sep 2010 at 1:04

GoogleCodeExporter commented 8 years ago
:-)
yeah, found it in the docu and your examples just after posting. ;-)

had a look at the other default maven properties, and none really seemed useful 
here, except maybe:
* ${project.build.directory} results in the path to your "target" dir
in case someone is generating the headers to parse... though that would be 
strange.

Original comment by robin.vobruba@gmail.com on 13 Sep 2010 at 8:54

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/177

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:28