diff --git a/project/Util.scala b/project/Util.scala index cf8b75cc8..df8b3a06a 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -2,8 +2,6 @@ import scala.util.control.NonFatal import sbt._ import Keys._ -import sbt.internal.inc.Analysis - object Util { val version2_13 = settingKey[String]("version number") val ExclusiveTest: Tags.Tag = Tags.Tag("exclusive-test") @@ -75,30 +73,6 @@ object Util { run.run(mainClass, cp.files, args, s.log).failed foreach (e => sys error e.getMessage) (out ** "*.java").get } - def lastCompilationTime(analysis: Analysis): Long = { - val lastCompilation = analysis.compilations.allCompilations.lastOption - lastCompilation.map(_.getStartTime) getOrElse 0L - } - def generateVersionFile( - version: String, - dir: File, - s: TaskStreams, - analysis: Analysis - ): Seq[File] = { - import java.util.{ Date, TimeZone } - val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss") - formatter.setTimeZone(TimeZone.getTimeZone("GMT")) - val timestamp = formatter.format(new Date) - val content = versionLine(version) + "\ntimestamp=" + timestamp - val f = dir / "xsbt.version.properties" - // TODO: replace lastModified() with sbt.io.IO.getModifiedTimeOrZero(), once the build - // has been upgraded to a version of sbt that includes that call. - if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) { - s.log.info("Writing version information to " + f + " :\n" + content) - IO.write(f, content) - } - f :: Nil - } def versionLine(version: String): String = "version=" + version def containsVersion(propFile: File, version: String): Boolean = IO.read(propFile).contains(versionLine(version))