diff options
author | Paul Phillips <paulp@improving.org> | 2010-09-14 00:39:59 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-09-14 00:39:59 +0000 |
commit | 964cceed6db7b028d694521d251f236ca0c0ccb5 (patch) | |
tree | e45c3d8c5b8338371bb2e6022e68ec88375d73a1 /project/build/ScalaSBTBuilder.scala | |
parent | 6a21106690e10ddfb0572281d769863e0e45e049 (diff) | |
download | scala-964cceed6db7b028d694521d251f236ca0c0ccb5.tar.gz scala-964cceed6db7b028d694521d251f236ca0c0ccb5.tar.bz2 scala-964cceed6db7b028d694521d251f236ca0c0ccb5.zip |
Tweaking sbt so it will stop jabbering about sv...
Tweaking sbt so it will stop jabbering about svn info failing when
there's a perfectly fine git repo yet to be tried. No review.
Diffstat (limited to 'project/build/ScalaSBTBuilder.scala')
-rw-r--r-- | project/build/ScalaSBTBuilder.scala | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/project/build/ScalaSBTBuilder.scala b/project/build/ScalaSBTBuilder.scala index 530a1ca538..80b79f778d 100644 --- a/project/build/ScalaSBTBuilder.scala +++ b/project/build/ScalaSBTBuilder.scala @@ -37,25 +37,14 @@ class ScalaSBTBuilder(val info: ProjectInfo) extends Project with ReflectivePro * until sbt quit. */ lazy val versionNumber:String ={ - def getTimeString:String ={ + def getTimeString: String = { import java.util.Calendar; import java.text.SimpleDateFormat; val formatString = "yyyyMMddHHmmss" - new SimpleDateFormat(formatString) format(Calendar.getInstance.getTime) - } - - def getVersion:String ={ - val version:String = projectVersion.value.toString - val stopIndex = version.lastIndexOf('-') - stopIndex match{ - case -1 => version - case i => version substring(0,i) - } - } - - def getRevision:Int = { - new SVN(info.projectPath).getRevisionNumber + new SimpleDateFormat(formatString) format Calendar.getInstance.getTime } + def getVersion: String = projectVersion.value.toString takeWhile (_ != '-') mkString + def getRevision: Int = new SVN(info.projectPath) getRevisionNumber getVersion+".r"+getRevision+"-b"+getTimeString } |