From dfdb9456f7bde880f3694fea8312ade8f5fdeb58 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 7 Dec 2009 19:04:37 -0500 Subject: [PATCH] * fix naming clash between xsbt/sbt test libraries * correct classpath for plugin projects --- project/build/SbtProject.scala | 3 +++ project/plugins/Plugins.scala | 2 +- scripted/project/build.properties | 2 +- scripted/src/main/scala/Scripted.scala | 2 +- src/main/scala/sbt/BuilderProject.scala | 6 +++--- src/test/scala/sbt/ReflectSpecification.scala | 3 ++- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/project/build/SbtProject.scala b/project/build/SbtProject.scala index 3b9b79f04..cecba01f9 100644 --- a/project/build/SbtProject.scala +++ b/project/build/SbtProject.scala @@ -50,6 +50,9 @@ class SbtProject(info: ProjectInfo) extends DefaultProject(info) with test.SbtSc override def crossScalaVersions = Set(Version2_7_5) + //testing + val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "1.6" + val ivy = "org.apache.ivy" % "ivy" % "2.0.0" intransitive() val jsch = "com.jcraft" % "jsch" % "0.1.31" intransitive() val jetty = "org.mortbay.jetty" % "jetty" % "6.1.14" % "optional" diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index caa313044..d3cdcc43b 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -4,6 +4,6 @@ import java.net.URL class Plugins(info: ProjectInfo) extends PluginDefinition(info) { - val scripted = "org.scala-tools.sbt" % "test" % "0.6.6" + val scripted = "org.scala-tools.sbt" % "scripted" % "0.6.6" val technically = Resolver.url("technically.us", new URL("http://databinder.net/repo/"))(Resolver.ivyStylePatterns) } diff --git a/scripted/project/build.properties b/scripted/project/build.properties index 8cda32990..fb0ede1fa 100644 --- a/scripted/project/build.properties +++ b/scripted/project/build.properties @@ -1,7 +1,7 @@ #Project properties #Sat Aug 01 10:32:20 EDT 2009 project.organization=org.scala-tools.sbt -project.name=test +project.name=scripted sbt.version=0.5.6 project.version=0.6.6 scala.version=2.7.7 diff --git a/scripted/src/main/scala/Scripted.scala b/scripted/src/main/scala/Scripted.scala index 9344bc2ee..f46ee4d42 100644 --- a/scripted/src/main/scala/Scripted.scala +++ b/scripted/src/main/scala/Scripted.scala @@ -4,7 +4,7 @@ package sbt.test import Scripted._ -import FileUtilities.{sbtJar, scalaCompilerJar, scalaLibraryJar, wrapNull} +import FileUtilities.wrapNull import java.io.File import java.net.URLClassLoader diff --git a/src/main/scala/sbt/BuilderProject.scala b/src/main/scala/sbt/BuilderProject.scala index 7152ac2c0..4483c7117 100644 --- a/src/main/scala/sbt/BuilderProject.scala +++ b/src/main/scala/sbt/BuilderProject.scala @@ -32,8 +32,8 @@ private sealed abstract class BasicBuilderProject extends InternalProject with S log.setLevel(oldLevel) } - def projectClasspath = compilePath +++ libraries +++ sbtJarPath - def sbtJarPath = Path.lazyPathFinder { Path.fromFile(FileUtilities.sbtJar) :: Nil } + def projectClasspath = compilePath +++ libraries +++ sbtJars + def sbtJars = Path.lazyPathFinder { info.app.mainClasspath.map(Path.fromFile) } abstract class BuilderCompileConfiguration extends AbstractCompileConfiguration { @@ -195,7 +195,7 @@ private final class BuilderProject(val info: ProjectInfo, val pluginPath: Path, def sourceRoots = managedSourcePath def sources = descendents(sourceRoots, sourceFilter) def outputDirectory = outputPath / "plugin-classes" - def classpath: PathFinder = pluginClasspath +++ sbtJarPath + def classpath: PathFinder = pluginClasspath +++ sbtJars def analysisPath = outputPath / "plugin-analysis" } } diff --git a/src/test/scala/sbt/ReflectSpecification.scala b/src/test/scala/sbt/ReflectSpecification.scala index 082359a78..515c220a5 100644 --- a/src/test/scala/sbt/ReflectSpecification.scala +++ b/src/test/scala/sbt/ReflectSpecification.scala @@ -105,9 +105,10 @@ object ReflectiveCreate val sourceFile = source.asFile val outputDirectory = basePath / "target" for(writeOK <- FileUtilities.write(sourceFile, codeString, log).toLeft("").right; - compileOK <- (new Compile(100))("reflect", source :: Nil, "", outputDirectory, Nil, log).toLeft("").right) + compileOK <- Left("").right)//(new RawCompile(100))("reflect", source :: Nil, "", outputDirectory, Nil, log).toLeft("").right) yield { + error("Reintegrate") val loader = new java.net.URLClassLoader(Array(outputDirectory.asURL), getClass.getClassLoader) val c = Class.forName(instantiate.name, true, loader) c.newInstance.asInstanceOf[AnyRef]