mirror of https://github.com/sbt/sbt.git
Port dependency-management/url
This commit is contained in:
parent
fa5e087ba1
commit
d7d3ae4f2b
|
|
@ -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.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue