temporary directory for use by tasks that will be cleaned up after task execution

This commit is contained in:
Mark Harrah 2011-08-05 21:56:32 -04:00
parent 7ea35daec2
commit 93801cd946
2 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,8 @@ object Defaults extends BuildCommon
managedDirectory <<= baseDirectory(_ / "lib_managed")
))
def globalCore: Seq[Setting[_]] = inScope(GlobalScope)(Seq(
taskTemporaryDirectory := IO.createTemporaryDirectory,
onComplete <<= taskTemporaryDirectory { dir => () => IO.delete(dir); IO.createDirectory(dir) },
parallelExecution :== true,
sbtVersion in GlobalScope <<= appConfiguration { _.provider.id.version },
sbtResolver in GlobalScope <<= sbtVersion { sbtV => if(sbtV endsWith "-SNAPSHOT") Classpaths.typesafeSnapshots else Classpaths.typesafeResolver },

View File

@ -99,6 +99,7 @@ object Keys
val cleanFiles = SettingKey[Seq[File]]("clean-files", "The files to recursively delete during a clean.")
val cleanKeepFiles = SettingKey[Seq[File]]("clean-keep-files", "Files to keep during a clean.")
val crossPaths = SettingKey[Boolean]("cross-paths", "If true, enables cross paths, which distinguish output directories for cross-building.")
val taskTemporaryDirectory = SettingKey[File]("task-temporary-directory", "Directory used for temporary files for tasks that is deleted after each task execution.")
// Generators
val sourceGenerators = SettingKey[Seq[Task[Seq[File]]]]("source-generators", "List of tasks that generate sources.")