Port dependency-management/url

This commit is contained in:
Eugene Yokota 2016-03-29 01:13:26 -04:00
parent fa5e087ba1
commit d7d3ae4f2b
2 changed files with 23 additions and 28 deletions

View File

@ -0,0 +1,23 @@
import classpath.ClasspathUtilities
lazy val root = (project in file(".")).
settings(
ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / "ivy-cache"))),
libraryDependencies += "slinky" % "slinky" % "2.1" % "test" from "http://slinky2.googlecode.com/svn/artifacts/2.1/slinky.jar",
TaskKey[Unit]("check-in-test") <<= checkClasspath(Test),
TaskKey[Unit]("check-in-compile") <<= checkClasspath(Compile)
)
def checkClasspath(conf: Configuration) =
fullClasspath in conf map { cp =>
try
{
val loader = ClasspathUtilities.toLoader(cp.files)
Class.forName("slinky.http.Application", false, loader)
()
}
catch
{
case _: ClassNotFoundException => sys.error("Dependency not downloaded.")
}
}

View File

@ -1,28 +0,0 @@
import sbt._
import Import._
import Keys._
import classpath.ClasspathUtilities
object TestProject extends Build
{
lazy val root = Project("root", file(".")) settings(
ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / "ivy-cache"))),
libraryDependencies += "slinky" % "slinky" % "2.1" % "test" from "http://slinky2.googlecode.com/svn/artifacts/2.1/slinky.jar",
TaskKey[Unit]("check-in-test") <<= checkClasspath(Test),
TaskKey[Unit]("check-in-compile") <<= checkClasspath(Compile)
)
private def checkClasspath(conf: Configuration) =
fullClasspath in conf map { cp =>
try
{
val loader = ClasspathUtilities.toLoader(cp.files)
Class.forName("slinky.http.Application", false, loader)
()
}
catch
{
case _: ClassNotFoundException => sys.error("Dependency not downloaded.")
}
}
}