From 79bab4727aae3f3bda62be8667d27dcbb7535c41 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 1 Jul 2012 15:16:41 -0400 Subject: [PATCH] fix caching of xsbt.version.properties --- project/Util.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project/Util.scala b/project/Util.scala index 4059ed695..0c3c9a454 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -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"