package beyond

import java.io.File
import java.net.URLClassLoader
import play.api.Mode

object BeyondRuntime {
  lazy val classPath: String = {
    import play.api.Play.current
    val currentClassLoaderURLs = current.classloader.asInstanceOf[URLClassLoader].getURLs
    val urls = current.mode match {
      case Mode.Dev =>
        val parentURLs = current.classloader.getParent.asInstanceOf[URLClassLoader].getURLs
        currentClassLoaderURLs ++ parentURLs
      case _ =>
        currentClassLoaderURLs
    }
    urls.mkString(File.pathSeparator)
  }
}

Add a method to get the current classpath.
Add a method to get the current classpath.

Play framework uses a custom class loader for auto-reloading in development
mode. So in development mode, we must join the class loader with the parent
class loader to get the complete classpath.
