SBT / LWJGL plugin

Started by philcali, March 22, 2011, 17:27:14

Previous topic - Next topic

philcali

Hello everyone,

I'd just like to inform any Scala / Java developers out there who use sbt for their build process, about a plugin that aids in rapid development of LWJGL projects (https://github.com/philcali/sbt-lwjgl-plugin#readme). It is being actively developed on github between scan (https://github.com/scan) and I. The plugin is being hosted at scala-tools under a MIT license.

The plugin comes with Slick2D and jMonkey support, as well.

Some detailed information about the plugin can be found here: https://github.com/philcali/sbt-lwjgl-plugin/wiki/sbt-lwjgl-plugin

Any contribution / feedback is welcomed. ;D

Krux

Hi thanks for the tool, but it would be nice if you explain how to use it. Please do not reference to any other tutorial, and please explain why i need those other tools.

My experience:

Quick start: use giter8 template
followed the link:
Usage: These instructions assume you have heard, and correctly installed n8han's conscript and giter8 tools
??? no i have not, i haven't even heard of them so please explain.

philcali

Sorry. I just read this...

This is good feedback. I clearly haven't documented the process well enough, so I'll try to elaborate a little more here. Also on the the github wiki pages.

First off, this is a build tool plugin. Specifically sbt build tool for Scala projects. All the plugin does, is download the lwjgl.jar, and linked libs, and load up the linked libs for runtime. Just create a /project/plugins/Plugins.scala with the source located on the README, and you can use it.

The other two tools mentioned on my giter8 template, is conscript and giter8. Conscript is a scala software installer, and giter8 is a commandline tool that pulls down project template from github.

I made a lwjgl template so all you would need to do is run a single command to build a new lwjgl scala project. To install g8, you need to install conscript. All of these installations are single, one-time commands.

install conscript (https://github.com/n8han/conscript):

    curl https://github.com/n8han/conscript/raw/master/setup.sh | sh

install giter8 (https://github.com/n8han/giter8):

    cs n8than/giter8

make the quick start project:

    g8 philcali/lwjgl

Sorry for any confusion or frustration I may have caused.

philcali

(I just realize I may have only answered the second half of your concerns)

Once you have the plugin integrated with your scala project, you can use the standard sbt actions (run, to run the project; update, to pull down the correct dependencies typically this only need to be once). The plugin more or less hijacks the standard sbt actions to make it work for lwjgl (specifically loading the linked libs at runtime).

Now I think I answered everything :D

Krux

meanwhile I found out what g8 and conscript is, but thanks for the answer, it might help others as well.  Now I use your template for all of my projects, it is really helpful and you solved the problem of manually moving the native libs to all of my lwjgl projects. But one addition might also be very usefull: publish as executable. This means that all game classes and all dependent jars are moved into a single folder with a starter script for all platforms. This would make it much easier for everybody to publish a game.

philcali

Ironically, I had the same idea a couple of days ago! I added this feature to the "Ideas" section to remind me.

Thanks for your feedback.. This is most helpful

thetrav

Fantastic work :)

One more feature request: java web start support

ahh unfortunate, looks like there's a problem in build.sbt  :'(

[info] Set current project to default-6d2179 (in build file:/Users/thetrav/.sbt/plugins/)
/Users/thetrav/IdeaProjects/build/project/plugins/build.sbt:1: error: type mismatch;
 found   : sbt.Project.Initialize[java.lang.String]
 required: sbt.ModuleID
libraryDependencies += (sbtVersion) { (sv) => 
                                    ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, or (i)gnore?