mirror of https://github.com/sbt/sbt.git
Remove potentially buggy unused methods
This commit is contained in:
parent
51de067228
commit
784b56ccf7
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue