changes to make latest preview easier

This commit is contained in:
Mark Harrah 2010-09-23 09:21:39 -04:00
parent 1567de67b2
commit 28f1eecbef
6 changed files with 17 additions and 10 deletions

View File

@ -18,6 +18,7 @@ object IncrementalCompile
}
def doCompile(compile: (Set[File], xsbti.AnalysisCallback) => Unit, internalMap: File => Option[File], externalAPI: (File, String) => Option[Source], current: ReadStamps, outputPath: File) = (srcs: Set[File]) => {
val callback = new AnalysisCallback(internalMap, externalAPI, current, outputPath)
println("Compiling:\n\t" + srcs.mkString("\n\t"))
compile(srcs, callback)
callback.get
}

View File

@ -98,7 +98,7 @@ trait DefaultClasspathProject extends BasicClasspathProject with Project
def retrievePattern = "[type]/[organisation]/[module]/[artifact](-[revision])(-[classifier]).[ext]"
override lazy val updateConfig: Task[UpdateConfiguration] = retrieveConfig map { rConf =>
new UpdateConfiguration(rConf, UpdateLogging.Full)
new UpdateConfiguration(rConf, UpdateLogging.Quiet)
}
lazy val retrieveConfig: Task[Option[RetrieveConfiguration]] = task {
None//Some(new RetrieveConfiguration(managedDependencyPath asFile, retrievePattern, true))
@ -219,7 +219,6 @@ object ClasspathProject
for( (dep, confMapping) <- ClasspathProject.resolvedDependencies(p))
{
val depConf = mapped(c, confMapping, defaultConfiguration(dep).toString) { missingMapping(p.name, dep.name, c) }
println("Dep: " + dep.name + " mapping: " + confMapping + " depConf: " + depConf)
val unvisited = visited.add( (dep, depConf) )
if(unvisited) visit(dep, depConf)
}

View File

@ -6,7 +6,7 @@ package sbt
import java.io.File
import compile.AnalyzingCompiler
final class Console(compiler: AnalyzingCompiler) extends NotNull
final class Console(compiler: AnalyzingCompiler)
{
/** Starts an interactive scala interpreter session with the given classpath.*/
def apply(classpath: Seq[File], log: Logger): Option[String] =

View File

@ -14,6 +14,10 @@ package sbt
abstract class DefaultProject extends TestProject with MultiClasspathProject with ReflectiveClasspathProject
{
// easier to demo for now
override def organization = "org.example"
override def version = "1.0"
override def watchPaths: PathFinder = descendents("src","*")
def javacOptions: Seq[String] = Nil
@ -38,6 +42,8 @@ abstract class DefaultProject extends TestProject with MultiClasspathProject wit
}
def sourceFilter: FileFilter = "*.java" | "*.scala"
// temporary default for simpler demo
override def configurations = super.configurations ++ Configurations.defaultMavenConfigurations
def compileTask(inputs: Task[Compile.Inputs]): Task[Analysis] = inputs map Compile.apply
@ -51,9 +57,8 @@ abstract class DefaultProject extends TestProject with MultiClasspathProject wit
val javaSrc = base / "java"
val scalaSrc = base / "scala"
val out = "target" / compilers.scalac.scalaInstance.actualVersion
val sources = descendents((javaSrc +++ scalaSrc), sourceFilter) +++ (if(configuration == Compile) (".": Path) * (sourceFilter -- defaultExcludes) else Path.emptyPathFinder)
println("Sources: " + sources)
import Path._
val sources = descendents((javaSrc +++ scalaSrc), sourceFilter) +++ (if(configuration == CompileConfig) info.projectDirectory * (sourceFilter -- defaultExcludes) else Path.emptyPathFinder)
val classes = classesDirectory(configuration)
val classpath = (classes +: data(prodcp)) ++ data(cp)
val analysis = analysisMap(prodcp ++ cp)

View File

@ -1,7 +1,7 @@
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package object sbt extends sbt.std.TaskExtra with sbt.Types with sbt.ProcessExtra with sbt.impl.DependencyBuilders
package object sbt extends sbt.std.TaskExtra with sbt.Types with sbt.ProcessExtra with sbt.impl.DependencyBuilders with sbt.PathExtra
{
type File = java.io.File
}

View File

@ -123,10 +123,10 @@ private[sbt] final class RelativePath(val parentPath: Path, val component: Strin
parentRelative + separator + component
}
}
object Path extends Alternatives with Mapper
{
import java.io.File
import File.pathSeparator
trait PathExtra extends Alternatives with Mapper
{
implicit def fileToPath(file: File): Path = Path.fromFile(file)
implicit def pathToFile(path: Path): File = path.asFile
implicit def pathsToFiles[CC[X] <: TraversableLike[X,CC[X]]](cc: CC[Path])(implicit cb: generic.CanBuildFrom[CC[Path], File, CC[File]]): CC[File] =
@ -135,7 +135,9 @@ object Path extends Alternatives with Mapper
cc.map(fileToPath)
implicit def filesToFinder(cc: Traversable[File]): PathFinder = finder(cc)
implicit def pathsToFinder(cc: Traversable[Path]): PathFinder = lazyPathFinder(cc)
}
object Path extends PathExtra
{
def fileProperty(name: String) = Path.fromFile(System.getProperty(name))
def userHome = fileProperty("user.home")