summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2011-12-05 14:55:16 -0500
committerJosh Suereth <joshua.suereth@gmail.com>2011-12-05 14:55:16 -0500
commitc86928f1dc736605a182e20528192eaed91bea62 (patch)
tree2d616dad235c6d4567885c3b02e96aba1bb6047d /project
parent9f1c8965afda7db5dccac0918ead47d446577617 (diff)
downloadscala-c86928f1dc736605a182e20528192eaed91bea62.tar.gz
scala-c86928f1dc736605a182e20528192eaed91bea62.tar.bz2
scala-c86928f1dc736605a182e20528192eaed91bea62.zip
*.properties files are now generated more often
(on git SHA change *and* clean instead of just clean)
Diffstat (limited to 'project')
-rw-r--r--project/Release.scala14
1 files changed, 11 insertions, 3 deletions
diff --git a/project/Release.scala b/project/Release.scala
index 38111c18a3..12461bee77 100644
--- a/project/Release.scala
+++ b/project/Release.scala
@@ -67,10 +67,18 @@ object Release {
/** This generates a properties file, if it does not already exist, with the maximum lastmodified timestamp
* of any source file. */
def generatePropertiesFile(name: String)(baseDirectory: File, version: String, dir: File, git: GitRunner): Seq[File] = {
- val target = dir / name
+ // TODO - We can probably clean this up by moving caching bits elsewhere perhaps....
+ val target = dir / name
// TODO - Regenerate on triggers, like recompilation or something...
- if (!target.exists) {
- val fullVersion = makeFullVersionString(baseDirectory, version, git)
+ val fullVersion = makeFullVersionString(baseDirectory, version, git)
+ def hasSameVersion: Boolean = {
+ val props = new java.util.Properties
+ val in = new java.io.FileInputStream(target)
+ try props.load(in) finally in.close()
+ def withoutDate(s: String): String = s.reverse.dropWhile (_ != '.').reverse
+ withoutDate(fullVersion) == withoutDate(props getProperty "version.number")
+ }
+ if (!target.exists || !hasSameVersion) {
makePropertiesFile(target, fullVersion)
}
target :: Nil