mirror of https://github.com/sbt/sbt.git
Default sbt.version in loader is now automatically defined by build
git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@1044 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
parent
52708b88b7
commit
f167c3a9b0
|
|
@ -48,9 +48,9 @@ private object ProjectProperties
|
||||||
/** The default version of the new user project when the user doesn't explicitly specify a version when prompted.*/
|
/** The default version of the new user project when the user doesn't explicitly specify a version when prompted.*/
|
||||||
val DefaultVersion = "1.0"
|
val DefaultVersion = "1.0"
|
||||||
/** The default version of sbt when the user doesn't explicitly specify a version when prompted.*/
|
/** The default version of sbt when the user doesn't explicitly specify a version when prompted.*/
|
||||||
val DefaultSbtVersion = "0.5.4"
|
val DefaultSbtVersion = DefaultVersions.Sbt //"0.5.4"
|
||||||
/** The default version of Scala when the user doesn't explicitly specify a version when prompted.*/
|
/** The default version of Scala when the user doesn't explicitly specify a version when prompted.*/
|
||||||
val DefaultScalaVersion = "2.7.5"
|
val DefaultScalaVersion = DefaultVersions.Scala//"2.7.5"
|
||||||
|
|
||||||
// sets up the project properties for a throwaway project (flattens src and lib to the root project directory)
|
// sets up the project properties for a throwaway project (flattens src and lib to the root project directory)
|
||||||
def scratch(file: File)
|
def scratch(file: File)
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,25 @@ protected/* removes the ambiguity as to which project is the entry point by maki
|
||||||
| public protected *;
|
| public protected *;
|
||||||
|}
|
|}
|
||||||
""".stripMargin
|
""".stripMargin
|
||||||
|
|
||||||
|
def managedSrc = path("src_managed")
|
||||||
|
def defaultVersionPath = managedSrc / "DefaultVersions.scala"
|
||||||
|
override def mainSourceRoots = super.mainSourceRoots +++ managedSrc
|
||||||
|
override def compileAction = super.compileAction dependsOn(versionProperties)
|
||||||
|
override def cleanAction = cleanTask(outputPath +++ managedSrc, cleanOptions)
|
||||||
|
lazy val versionProperties = task { writeVersionProperties(projectVersion.value.toString, scalaVersion.value.toString) }
|
||||||
|
def writeVersionProperties(sbtVersion: String, scalaVersion: String) =
|
||||||
|
FileUtilities.write(defaultVersionPath.asFile, defaultVersions(sbtVersion, scalaVersion), log)
|
||||||
|
|
||||||
|
def defaultVersions(sbtVersion: String, scalaVersion: String) =
|
||||||
|
"""
|
||||||
|
package sbt.boot
|
||||||
|
object DefaultVersions
|
||||||
|
{
|
||||||
|
val Sbt = "%s"
|
||||||
|
val Scala = "%s"
|
||||||
|
}
|
||||||
|
""".format(sbtVersion, scalaVersion)
|
||||||
}
|
}
|
||||||
object LoaderProject
|
object LoaderProject
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue