mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 11:01:08 +02:00
Port dependency-management/url
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user