Skip to content
philcali edited this page Oct 31, 2011 · 9 revisions

jMonkey does not have a public maven repo for its dependencies. Making sbt go fetch the latest is about the best we can get here.

The default behavior is that update will pull the latest nightly build for jMonkey version 3.

To enable jMonkey support, puts the following contents in your build.sbt

seq(jmonkeySettings: _*)

Using a Specific Version of jMonkey

// Target a different version with overrides
jmonkey.targetVersion := "2011-10-27"

This kind of configuration will only pull once, as expected.

JMonkey Settings

The jMonkey plugin offers several settings and task so you can completely customize your build process

Settings

  • baseRepo: the nightly repo url
  • baseVersion: the nightly's can be found as jME2 or jME3... you can change that is you wish.
  • targetDate: an actual date (defaults to now)
// Say you wanted the Friday builds
jmonkey.targetDate := {
  import com.github.philcali.scalendar._
  val now = Scalendar.now
      
  val attempt = if (now.inWeek < Day.Friday.id) {
    (now - 1.week)
  } else now
  attempt.inWeek(Day.Friday)
}
  • targetVersion: is the timestamp formatted as a string to match their builds.
  • jmonkey.version: is baseVersion and targetVersion concatenated together.
  • downloadDir: is the temporary directory to hold the downloaded zip from their nightly.

Tasks

  • download: downloads zip from their nightly repo into jmonkeyDownloadDir, and extracts contents there.
  • install: constructs a valid ivy xml into your ivy local cache.
  • listInstalled: displays all the versions of jMonkey installed in your cache.
  • cleanLib: clears out jmonkeyDownloadDir.
  • cleanCache: clears out your ivy local of all jMonkey installs.

For a JMonkey project, update depends on install, which depend on download. This means you can simply run update in sbt and jMonkey dependencies are taken care of for you.