Skip to content

Instantly share code, notes, and snippets.

@smparkes
Created April 27, 2011 18:18
Show Gist options
  • Save smparkes/944830 to your computer and use it in GitHub Desktop.
Save smparkes/944830 to your computer and use it in GitHub Desktop.
import xsbt.ScalaInstance
import java.net.{URL, URLClassLoader}
var jniLoader: ClassLoader = null
override def getScalaInstance(version: String): ScalaInstance = {
localScalaInstances.find(_.version == version) getOrElse {
val si = ScalaInstance(version, info.launcher)
if (jniLoader == null) {
val list = List(
new File("javasqlite/sqlite.jar").toURL,
new File("ext/postgresql-9.0-801.jdbc4.jar").toURL
)
jniLoader = new URLClassLoader(list.toArray[URL], si.parentLoader)
}
si.jniLoader = jniLoader
si
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment