summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2011-12-29 08:38:39 -0500
committerJosh Suereth <joshua.suereth@gmail.com>2011-12-29 08:38:39 -0500
commit716ef5b0a6b4da94f44234226782a3f3d473fa5e (patch)
tree9fdf3578a1a39a09987ed01b98cf3aab8915dfd1 /project
parent0947d08eef6397efe6dd97c41cf480ff13762591 (diff)
downloadscala-716ef5b0a6b4da94f44234226782a3f3d473fa5e.tar.gz
scala-716ef5b0a6b4da94f44234226782a3f3d473fa5e.tar.bz2
scala-716ef5b0a6b4da94f44234226782a3f3d473fa5e.zip
All projects can be locked now.
* Added 'lock' key to write 'compile.lock' file to target dir. * Added 'unlock' key to delete 'compile.lock' file to target dir.
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/project/Build.scala b/project/Build.scala
index 297f82e515..abab775666 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -11,6 +11,9 @@ object ScalaBuild extends Build with Layers {
"Unlocks the locker layer of the compiler so that it will be recompiled on changed source files.")
lazy val lockFile: SettingKey[File] = SettingKey("lock-file",
"Location of the lock file compiling this project.")
+ // New tasks/settings specific to the scala build.
+ lazy val lock: TaskKey[Unit] = TaskKey("lock", "Locks this project so it won't be recompiled.")
+ lazy val unlock: TaskKey[Unit] = TaskKey("unlock", "Unlocks this project so it will be recompiled.")
lazy val makeDist: TaskKey[File] = TaskKey("make-dist",
"Creates a mini-distribution (scala home directory) for this build in a zip file.")
lazy val makeExplodedDist: TaskKey[File] = TaskKey("make-exploded-dist",
@@ -164,7 +167,9 @@ object ScalaBuild extends Build with Layers {
// Most libs in the compiler use this order to build.
compileOrder in Compile := CompileOrder.JavaThenScala,
lockFile <<= target(_ / "compile.lock"),
- skip in Compile <<= lockFile.map(_ exists)
+ skip in Compile <<= lockFile.map(_ exists),
+ lock <<= lockFile map { f => IO.touch(f) },
+ unlock <<= lockFile map IO.delete
)
// --------------------------------------------------------------