Fix logging levels for subprojects

This commit is contained in:
Mark Harrah 2010-03-23 20:36:16 -04:00
parent 0e6ccf2eb9
commit bc80136bb1
6 changed files with 10 additions and 15 deletions

View File

@ -6,7 +6,7 @@ import sbt._
import java.io.File
import java.net.URL
class SbtProject(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with posterous.Publish
abstract class SbtProject(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with posterous.Publish
{
/* Additional resources to include in the produced jar.*/
def extraResources = descendents(info.projectPath / "licenses", "*") +++ "LICENSE" +++ "NOTICE"
@ -46,9 +46,8 @@ class SbtProject(info: ProjectInfo) extends DefaultProject(info) with test.SbtSc
val testInterface = "org.scala-tools.testing" % "test-interface" % "0.4"
// xsbt components
val xsbti = "org.scala-tools.sbt" % "launcher-interface" % projectVersion.value.toString % "provided"
val compiler = "org.scala-tools.sbt" %% "compile" % projectVersion.value.toString
def deepSources = Path.finder { topologicalSort.flatMap { case p: ScalaPaths => p.mainSources.getFiles } }
lazy val sbtDoc = scaladocTask("sbt", deepSources, docPath, docClasspath, documentOptions)
/* For generating JettyRun for Jetty 6 and 7. The only difference is the imports, but the file has to be compiled against each set of imports. */
override def compileAction = super.compileAction dependsOn (generateJettyRun6, generateJettyRun7)

View File

@ -34,6 +34,8 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths
val altCompilerSub = baseProject("main", "Alternate Compiler Test", stdTaskSub, logSub)
val sbtSub = project("sbt", "Simple Build Tool", new SbtProject(_) {}, compilerSub, launchInterfaceSub)
def baseProject(path: Path, name: String, deps: Project*) = project(path, name, new Base(_), deps : _*)
/* Multi-subproject paths */
@ -158,7 +160,7 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths
/** compiles the generated sources */
override def compileAction = super.compileAction dependsOn(generateSource)
}
class LaunchInterfaceProject(info: ProjectInfo) extends BaseInterfaceProject(info)
class LaunchInterfaceProject(info: ProjectInfo) extends BaseInterfaceProject(info)
{
override def componentID = None
}

View File

@ -1,6 +0,0 @@
project.name=Simple Build Tool
project.organization=org.scala-tools.sbt
project.version=0.7.2-SNAPSHOT
sbt.version=0.7.1
def.scala.version=2.7.7
build.scala.versions=2.7.7

View File

@ -17,7 +17,7 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
final val log: Logger = logImpl
protected def logImpl: Logger =
{
val lg = new BufferedLogger(info.logger)
val lg = new FilterLogger(new BufferedLogger(info.logger))
lg.setLevel(defaultLoggingLevel)
lg
}
@ -147,7 +147,7 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
/** Loads the project at the given path and declares the project to have the given
* dependencies. This method will configure the project according to the
* project/ directory in the directory denoted by path.*/
def project(path: Path, deps: Project*): Project = getProject(Project.loadProject(path, deps, Some(this), log, info.app, info.buildScalaVersion), path)
def project(path: Path, deps: Project*): Project = getProject(Project.loadProject(path, deps, Some(this), info.logger, info.app, info.buildScalaVersion), path)
/** Loads the project at the given path using the given name and inheriting this project's version.
* The builder class is the default builder class, sbt.DefaultProject. The loaded project is declared
@ -166,7 +166,7 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
* The construct function is used to obtain the Project instance. Any project/build/ directory for the project
* is ignored. The project is declared to have the dependencies given by deps.*/
def project[P <: Project](path: Path, name: String, construct: ProjectInfo => P, deps: Project*): P =
initialize(construct(ProjectInfo(path.asFile, deps, Some(this))(log, info.app, info.buildScalaVersion)), Some(new SetupInfo(name, None, None, false)), log)
initialize(construct(ProjectInfo(path.asFile, deps, Some(this))(info.logger, info.app, info.buildScalaVersion)), Some(new SetupInfo(name, None, None, false)), log)
/** Initializes the project directories when a user has requested that sbt create a new project.*/
def initializeDirectories() {}

View File

@ -23,7 +23,7 @@ final case class ProjectInfo(projectDirectory: File, dependencies: Iterable[Proj
/** The launcher instance that booted sbt.*/
def launcher = app.scalaProvider.launcher
val logger = new FilterLogger(log)
val logger = log
/** The base path for the project, preserving information to the root project directory.*/
val projectPath: Path =
{