From 56339c34a68f4ed4c25bc6a9631cfa0b5fb05a18 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 3 Mar 2010 21:59:29 -0500 Subject: [PATCH] * Prepend !shell to the commands to run when shell is the last command specified by the user. * def.scala.version no longer required to be in build.properties --- src/main/scala/sbt/Main.scala | 6 +++++- src/main/scala/sbt/Project.scala | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/scala/sbt/Main.scala b/src/main/scala/sbt/Main.scala index 5cbf0fe21..913c2010e 100755 --- a/src/main/scala/sbt/Main.scala +++ b/src/main/scala/sbt/Main.scala @@ -87,11 +87,15 @@ class xMain extends xsbti.AppMain } } } + /** If no arguments are provided, drop to interactive prompt. + * If the user wants to run commands before dropping to the interactive prompt, + * make dropping to the interactive prompt the action to perform on failure */ private def initialize(args: List[String]): List[String] = args.lastOption match { case None => InteractiveCommand :: Nil - case Some(InteractiveCommand | ExitCommand | QuitCommand) => args + case Some(InteractiveCommand) => (FailureHandlerPrefix + InteractiveCommand) :: args + case Some(ExitCommand | QuitCommand) => args case _ => args ::: ExitCommand :: Nil } private def startProject(project: Project, configuration: xsbti.AppConfiguration, remainingArguments: List[String], startTime: Long): xsbti.MainResult = diff --git a/src/main/scala/sbt/Project.scala b/src/main/scala/sbt/Project.scala index c14978333..bfb1d284e 100644 --- a/src/main/scala/sbt/Project.scala +++ b/src/main/scala/sbt/Project.scala @@ -213,9 +213,8 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment final val projectOrganization = propertyOptional[String](normalizedName, true) /** The property that defines the version of Scala to use with the project definition. This can be different * 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. It is the definitive source for the version of Scala - * that sbt and the project definition are using.*/ - final val defScalaVersion = property[String] + * This property is only read by `sbt` on startup and reload.*/ + final val defScalaVersion = propertyOptional[String](info.definitionScalaVersion) final val sbtVersion = property[String] final val projectInitialize = propertyOptional[Boolean](false) final val projectScratch = propertyOptional[Boolean](false, true)