Permalink
Browse files

Don't regenerate properties file if skip is true (i.e. locker/quick i…

…s locked)
  • Loading branch information...
jsuereth committed May 10, 2012
1 parent b84cbda commit bc137ff53e95b29016a51e271e2a2371e7150946
Showing with 4 additions and 4 deletions.
  1. +2 −2 project/Layers.scala
  2. +2 −2 project/Versions.scala
View
@@ -59,7 +59,7 @@ trait Layers extends Build {
// TODO - Allow other scalac option settings.
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)),
classpathOptions := ClasspathOptions.manual,
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, streams) map Versions.generateVersionPropertiesFile("library.properties"),
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, skip in Compile, streams) map Versions.generateVersionPropertiesFile("library.properties"),
referenceScala
)
@@ -71,7 +71,7 @@ trait Layers extends Build {
unmanagedSourceDirectories in Compile <+= (baseDirectory) apply (_ / "src" / "msil"),
defaultExcludes := ("tests"),
defaultExcludes in unmanagedResources := "*.scala",
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, streams) map Versions.generateVersionPropertiesFile("compiler.properties"),
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, skip in Compile, streams) map Versions.generateVersionPropertiesFile("compiler.properties"),
// Note, we might be able to use the default task, but for some reason ant was filtering files out. Not sure what's up, but we'll
// stick with that for now.
unmanagedResources in Compile <<= (baseDirectory) map {
View
@@ -46,7 +46,7 @@ object Versions {
/** This generates a properties file, if it does not already exist, with the maximum lastmodified timestamp
* of any source file. */
def generateVersionPropertiesFile(name: String)(dir: File, versions: VersionInfo, s: TaskStreams): Seq[File] = {
def generateVersionPropertiesFile(name: String)(dir: File, versions: VersionInfo, skip: Boolean, s: TaskStreams): Seq[File] = {
// 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...
@@ -56,7 +56,7 @@ object Versions {
try props.load(in) finally in.close()
versions.canonical == (props getProperty "version.number")
}
if (!target.exists || !hasSameVersion) {
if (!target.exists || !(skip || hasSameVersion)) {
makeVersionPropertiesFile(target, versions)
}
target :: Nil

0 comments on commit bc137ff

Please sign in to comment.