Use this setting in the project containing the temp
directory:
cleanFiles <+= baseDirectory { base => base / "temp" }
This adds the "temp" directory to the list of files to recursively delete when clean
runs.
The <
means "configure in terms of other tasks/settings", the +
means append to the current list of files, and baseDirectory
is the setting providing the base directory of the project.
You can see how clean
is configured using the inspect
command, documented in more detail on the Inspecting Settings page. An edited sbt session shows usage in this case:
> inspect clean
Task: Unit
Description:
Deletes files produced by the build, such as generated sources, compiled classes, and task caches.
Dependencies:
clean-files
clean-keep-files
> inspect clean-files
Setting: scala.collection.Seq[java.io.File] = List(<project>/lib_managed, <project>/target, <project>/temp)
Description:
The files to recursively delete during a clean.
Dependencies:
managed-directory
target
base-directory
You can see this shows you if it is a task or setting, the type, a description, and the tasks/settings used as inputs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…