Use ComponentManager.version when printing the sbt version

This commit is contained in:
Mark Harrah 2010-03-07 19:03:27 -05:00
parent 229ecaba5e
commit f9dd30144e
2 changed files with 7 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class xMain extends xsbti.AppMain
private def startProject(project: Project, configuration: xsbti.AppConfiguration, remainingArguments: List[String], startTime: Long): xsbti.MainResult =
{
project.log.info("Building project " + project.name + " " + project.version.toString + " against Scala " + project.buildScalaVersion)
project.log.info(" using " + project.getClass.getName + " with sbt " + project.sbtVersion.value + " and Scala " + project.defScalaVersion.value)
project.log.info(" using " + project.getClass.getName + " with sbt " + ComponentManager.version + " and Scala " + project.defScalaVersion.value)
processArguments(project, initialize(remainingArguments), configuration, startTime) match
{
case e: xsbti.Exit =>

View File

@ -215,6 +215,9 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
* from the version of Scala used to build the project (current version used is buildScalaVersion, available are in buildScalaVersions).
* This property is only read by `sbt` on startup and reload.*/
final val defScalaVersion = propertyOptional[String](info.definitionScalaVersion)
/** The property to specify the sbt revision to use.
* Note that this can by a dynamic revision (see Ivy documentation for details on dynamic revisions).
*Therefore, use `sbt.ComponentManager.version` and `timestamp` for actual version information. */
final val sbtVersion = property[String]
final val projectInitialize = propertyOptional[Boolean](false)
final val projectScratch = propertyOptional[Boolean](false, true)
@ -223,9 +226,10 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
* This property is only read by `sbt` on startup and reload. The definitive source for the version of Scala currently
* being used is buildScalaVersion.*/
final val buildScalaVersions = propertyOptional[String](defScalaVersion.value, true)
/** The definitive source for the version of Scala being used to *build* the project.*/
/** The definitive source for the version of Scala being requested to *build* the project.
* For the full version information, see buildScalaInstance.actualVersion.*/
def buildScalaVersion = info.buildScalaVersion.getOrElse(crossScalaVersions.first)
private[sbt] def isScala27 = buildScalaVersion.startsWith("2.7.")
private[sbt] def isScala27 = buildScalaInstance.actualVersion.startsWith("2.7.")
def componentManager = new ComponentManager(info.launcher.globalLock, info.app.components, log)