mirror of https://github.com/sbt/sbt.git
fix caching of xsbt.version.properties
This commit is contained in:
parent
d8f5c39465
commit
79bab4727a
|
|
@ -66,14 +66,17 @@ object Util
|
|||
val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
|
||||
formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
|
||||
val timestamp = formatter.format(new Date)
|
||||
val content = "version=" + version + "\ntimestamp=" + timestamp
|
||||
val content = versionLine(version) + "\ntimestamp=" + timestamp
|
||||
val f = dir / "xsbt.version.properties"
|
||||
if(!f.exists || f.lastModified < lastCompilationTime(analysis)) {
|
||||
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))
|
||||
|
||||
def binID = "compiler-interface-bin"
|
||||
def srcID = "compiler-interface-src"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue