[SOLVED] Jme SDK and gradle

I did download GitHub - Simsilica/Examples: Example applications for various Simsilica libraries, singly or in combination. and build successful the sim-eth-es sample with gradle. So fare so good. But actually I would like to use the jme SDK to edit my source, but I have no clue how this could be done. I tried with import ending just see the asset folder but not the source folder. Further more all the libs I normally have put manually or by Netbeans download into the lib folder are now somewhere in ~/.gradle cache.

Honestly I’m a little lost and I’m not sure if it is possible to mix gradle build and have jme SDK as the IDE.

I currently try now other editors, but would love to use my beloved jme SDK :wink:

Any help or hint would be appreciated. Btw. I’m pretty proud that I got that gradle stuff up and running :wink: This is a new land for me…

Just install the gradle plugin. You won’t get many of the jME-specific features of the SDK with a gradle project though.

1 Like

I anyway do not use much features of it. And hey! That works! Many Thanks.

@Darkchaos: Are there any plans for a better gradle integration into the jme SDK? Why exactly do for example the Scene Viewer not work?

I try to find out what is needed to have both gradle and SDK features (yes I only use little of them like that blender to j3o thing).

Or are there other ways to have that? I read a lot of xbuf in this forum, but have so fare no clue how that works…

Well being exact this should be the responsibility of the gradle plugin maintainers (it is directly from netbeans, not us), however that wouldn’t mean we can’t contribute to that, of course, but I guess this is above my skill level and time frame, currently, since to me it just works (and does nothing apart from launching the gradle task).

[quote=“ia97lies, post:4, topic:37514”]
Why exactly do for example the Scene Viewer not work?[/quote]
This is new to me and “does not work” is no good description, actually.
Wildly guessing this is because the SDK only opens j3o files if they are inside the asset\ folder, which is missing on your project.
(I atleast think that it only opens them inside the assets folder, I know that it’s the case for filters (j3f), but I don’t know if this is also true for j3os)

Well for my game I switched to gradle as well, the reason was simply easier dependency management and some easy packaging tasks. The first could be achieved by using some maven plugin in nb directly, though.

What I did roughly was: Only using the SDK to code and then launch gradlew.bat run in a console. There are still ways to debug and profile then.
The only problem here is that SDK will complain about the missing dependencies. That’s why you have to search in C:\Users\<>\AppData\Local\.m2 or C:\Users\<>\.m2 I think, there are the jars you can use to feed the sdk with.

I would love to have such gradle integration but I guess gradle is too complex to easily get the dependencies and even then you could only have it working for simple dependency setups.
Let’s think about what would we need? If we’d have the dependencies we would need to resolve them manually, or even better: Execute the gradlew task which fetches them into the local cache. And then we could simply add them into the build file or setup as libraries.

I see two problems here: Simply executing some task without the user knowing. This could be solved by a message (will only work after the first run) but the second thing: While this works, it not only fills the build files/libraries but it also will only work on that specific machine. So we would need some special folder gradle_libs and pull them there.

That being said, it seems possible, if the gradle plugin supports extracting dependencies but it has to be well thought.

See xbuf.org (I think) or look around on github. You basically need the xbuf exporter to export from blender to xbuf (Note: xbuf does not contain Textures, so you should convert it to .j3o on the same machine).
When you have that xbuf and a recent SDK you can already view and convert them to j3o. If you want to load xbufs in your game (Which I can’t recommend yet, due to the tangent generation which consumes some time) you need to download some dependencies and register a XbufLoader.class but that’s all documented somewhere.

1 Like

Well, he quite literally means that. Unless you are using the special JME provided project, all of those features don’t exist. You can’t open the scene editor in a gradle project because it is not the special JME project and doesn’t have all of that stuff.

I don’t know enough about netbeans to know how the JME project has that special stuff and if it’s possible to build that special project template off of a gradle-based project or not.

…but that’s what he’s asking for. The special JME-ization stuff on top of a gradle project instead of an ANT project.

1 Like

I had a discussion with David regarding this, thanks to him in v9.1he added support for exporting them directly from blender in this commit so loading is relatively very fast now.

@ia97lies for using SDKs tools on your gradle project one solution is :

And if you ran to this problem which i had previously :

then the cheap solution is to remove
runtime project(':assets') from your dependencies in build.gradle file and instead add runtime file('./assets') during developing.
(Note when you want to deploy the project you should return it back to runtime project(':assets'))

and the decent solution (only if your assets are really big in size and also if you want to be able to add new models or update them even after you shipped your game to users and more important if you want your assets to be modular :wink:) is to let go of one gigantic assets.jar and deploy each model in separate jar. Gradle makes it easy to separate assets as sub projects.

1 Like

Hey @Darkchaos, @pspeed and @Ali_RS
Thanks a lot for all these details and hints. Yes @pspeed is right, it just do not work I mean nothing happens when I double click the j3o files no error no nothing.

But I guess I have now a lot of pointers, I will try to go from here. Let’s see maybe I come up with something I can share. For me all this java stuff is still pretty new and amazing :wink: