jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Mojo
  • Mojo
  • MOJO-1373

jnilib example

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Wish Wish
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: osxappbundle
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

I have found no example of how to include a jnilib in the bundle. The problem is that if the artifact is of type jnilib it is placed deep down in the repo directory structure with a name that includes a version number. What you want is the possibility to place the jnilib directly in the Java directory and change the name to not include the version number.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    mojo-1373.diff
    12/Nov/12 1:43 PM
    8 kB
    Andrew Buza

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Eirik Bjørsnøs added a comment - 27/May/09 4:06 AM

Hi Eric,

Support for jnilib deps is definitely something we should support.

It would be really helpful if you could provide a small sample project with a native lib that I could use for testing.

I'll let you know once I have a snapshot ready for testing.

Thanks,
Eirik.

Show
Eirik Bjørsnøs added a comment - 27/May/09 4:06 AM Hi Eric, Support for jnilib deps is definitely something we should support. It would be really helpful if you could provide a small sample project with a native lib that I could use for testing. I'll let you know once I have a snapshot ready for testing. Thanks, Eirik.
Hide
Permalink
Joe Mays added a comment - 08/Nov/11 9:57 PM

Hi Erik,

I just found your osxappbundle plugin, and it's almost everything I need! Just need to be able to include jnilib/dylib native libs. Basically we just need to copy them to Contents/Resources/Java and then System.loadLibrary works with the default java.library.path (i.e., "."). So, if we had something like:

<nativeLibraries>
<fileSet>
<directory>$

{basedir}

/src/main/app-resources</directory>
<includes>
<include>libHelloWorld.dylib</include>
</includes>
</fileSet>
</nativeLibraries>

...where the fileSet would be copied to Contents/Resources/Java, I think that would suffice. Then, System.loadLibrary("HelloWorld") would work.

I can put together an example - just let me know that you're still willing to add this feature!

Thanks,
Joe

Show
Joe Mays added a comment - 08/Nov/11 9:57 PM Hi Erik, I just found your osxappbundle plugin, and it's almost everything I need! Just need to be able to include jnilib/dylib native libs. Basically we just need to copy them to Contents/Resources/Java and then System.loadLibrary works with the default java.library.path (i.e., "."). So, if we had something like: <nativeLibraries> <fileSet> <directory>$ {basedir} /src/main/app-resources</directory> <includes> <include>libHelloWorld.dylib</include> </includes> </fileSet> </nativeLibraries> ...where the fileSet would be copied to Contents/Resources/Java, I think that would suffice. Then, System.loadLibrary("HelloWorld") would work. I can put together an example - just let me know that you're still willing to add this feature! Thanks, Joe
Hide
Permalink
Philipp Haußleiter added a comment - 14/Sep/12 7:47 AM

i created a small example project with the plugin and some jnilibs (basically JNA and ROCOCOA) you can find it here: https://github.com/phaus/rococoa-tests/tree/master/helloworld

Show
Philipp Haußleiter added a comment - 14/Sep/12 7:47 AM i created a small example project with the plugin and some jnilibs (basically JNA and ROCOCOA) you can find it here: https://github.com/phaus/rococoa-tests/tree/master/helloworld
Hide
Permalink
Andrew Buza added a comment - 12/Nov/12 1:42 PM

I've also needed to include native libraries in my application bundle. The attached patch against r17726 adds the nativeLibraries configuration option described above and adds an example to the project site. It basically just copies files from the specified fileSet to the Contents/Java/Resources folder in the app bundle.

I'm not especially familiar with Maven or the Java & OS X ecosystem so I can't say that it works for all cases but it's been working well enough for mine.

Show
Andrew Buza added a comment - 12/Nov/12 1:42 PM I've also needed to include native libraries in my application bundle. The attached patch against r17726 adds the nativeLibraries configuration option described above and adds an example to the project site. It basically just copies files from the specified fileSet to the Contents/Java/Resources folder in the app bundle. I'm not especially familiar with Maven or the Java & OS X ecosystem so I can't say that it works for all cases but it's been working well enough for mine.
Hide
Permalink
Andrew Buza added a comment - 12/Nov/12 1:43 PM

Patch to add nativeLibraries configuration option.

Show
Andrew Buza added a comment - 12/Nov/12 1:43 PM Patch to add nativeLibraries configuration option.
Hide
Permalink
Fred Cooke added a comment - 02/Jan/13 8:47 AM

Nothing on his blog for 2+ years. No action here either. Better to clearly show that it's not being handled.

Show
Fred Cooke added a comment - 02/Jan/13 8:47 AM Nothing on his blog for 2+ years. No action here either. Better to clearly show that it's not being handled.
Hide
Permalink
Suneet Kamath added a comment - 02/May/13 7:35 AM - edited

Just got this working. Obviously it only supports jnilib's for now, but it could be quite easily extended to support other libraries - dylib, so etc.

***line 496 of CreateApplicationBundleMojo******

CreateApplicationBundleMojo.java

            File dest;
            if(artifact.getType().equals("jnilib")) {
                dest = new File(javaDirectory, artifact.getArtifactId() + "." + artifact.getType());
            } else {
            	dest = new File(repoDirectory, layout.pathOf(artifact));
            }

***end******

Would be great if you could commit this to the repo.

Show
Suneet Kamath added a comment - 02/May/13 7:35 AM - edited Just got this working. Obviously it only supports jnilib's for now, but it could be quite easily extended to support other libraries - dylib, so etc. *** line 496 of CreateApplicationBundleMojo ****** CreateApplicationBundleMojo.java File dest; if (artifact.getType().equals( "jnilib" )) { dest = new File(javaDirectory, artifact.getArtifactId() + "." + artifact.getType()); } else { dest = new File(repoDirectory, layout.pathOf(artifact)); } *** end ****** Would be great if you could commit this to the repo.

People

  • Assignee:
    Unassigned
    Reporter:
    Erik Martino Hansen
Vote (2)
Watch (8)

Dates

  • Created:
    27/May/09 2:44 AM
    Updated:
    02/May/13 7:47 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.