Help - How to: Build an executable JAR with SBT+JOGL+Scala

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help - How to: Build an executable JAR with SBT+JOGL+Scala

GiGurra
This post was updated on .
I hope there is someone out there who knows how to solve this problem.

I use SBT to build my scala applications.
Now I want to build a Scala application with JOGL - But I'm unable to create any executable jar of my test application :/.

Here's what currently works and what does not work:
sbt compile: ok
sbt publish: ok
sbt package: ok
sbt run: ok

Creating eclipse projects using sbt-eclipse also works good (https://github.com/typesafehub/sbteclipse/)
sbt eclipse: ok - I can code and run my JOGL application from within eclipse, yay! :)

BUT, I have not been able to create any form of executable JAR or other releasable application form using SBT (which I need for distribution):
sbt assembly: fail to build - dll file name conflicts (https://github.com/sbt/sbt-assembly)
sbt pack: fail to run - native dlls are not found (https://github.com/xerial/sbt-pack)
sbt one-jar: fail to run - native dlls are not found (https://github.com/sbt/sbt-onejar)
the three above work fine for my non-jogl projects :S.

Because I'm new to maven/sbt/gradle-ish build systems I'm not really sure where to look for the solution
I Looked at https://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling but didnt really understand much unfortunately

My managed dependencies are:
libraryDependencies += "org.jogamp.gluegen" % "gluegen-rt-main" % "2.2.4"
libraryDependencies += "org.jogamp.jogl" % "jogl-all-main" % "2.2.4"

win7 64bit
64bit oracle java8 u20 jre
sbt 0.13.5

https://github.com/GiGurra/gat - here is my test application if you want to try it (You'll need sbt to build it)


Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

gouessej
Administrator
Hi

I'm sorry, I know Maven but I mainly use Ant as a build tool. I use PackR or preferably JNDT to build my self-contained native application bundle. Contact Mark on our IRC channel if you need help on Maven. I don't know how I can help you. I see that your project is under GPL, feel free to look at my source code (under GPL too) to make your fat JARs.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

GiGurra
One way would be if we could modify how jogl/gluegen natives are named at the moment, giving them all unique names,
(Such as -x64.dll and so on). I managed to get sbt assembly temporarily working for a single platform by telling it to only package x64 windows dlls, but thats not really a solution, since I want my jar must run on any platform

If there's anything I can do to help out in this I'll do it :).

This could make it a lot easier for any scala users out there who want to use jogamp (as sbt assembly is the preferred scala/sbt way to package executables).

I will see if I can find you on irc.
Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

gouessej
Administrator
I have nothing against Scala users but we can't respect contradictory guidelines to make all build tools work, we can't satisfy them all. Some build tools aren't flexible enough, it's not our fault. Please try to understand this paragraph:
https://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling#Usage
There is already a convention that allows to make a distinction between the native libraries and if we change it, it will break all tools that respect it. In my humble opinion, this "limitation" should be managed by sbt, not by JOGL. The tool should allow to move or rename files to go from another set of conventions to its own set of conventions instead of expecting all libraries to respect its conventions.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

GiGurra
This post was updated on .
Thanks for your time earlier on IRC.

I have made a post over at the sbt assembly github issues here: https://github.com/sbt/sbt-assembly/issues/141 .
I also wrote that feature request on your bugzilla tracker here: https://jogamp.org/bugzilla/show_bug.cgi?id=1118

Hopefully there will be some way to solve this.
Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

gouessej
Administrator
I think that it would be better if your feature request (1118) was implemented so that there is no duplicate files when you merge and it would be useful in some other use cases.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help - How to: Build an executable JAR with SBT+JOGL+Scala

GiGurra
This post was updated on .
That would be perfect, yes.

In the meantime I've added a manual build step which extracts dll/so/jnilib files from maven jar-dependencies into the correct resource folders. It's not pretty, but it works. So if more people have the same problem, you can try this until we get a better solution:
https://github.com/GiGurra/dcs-remote/blob/master/dcs-remote-renderer/build.sbt