Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created September 8, 2019 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/82291d4e23b4671b7ceeb38324c8edf8 to your computer and use it in GitHub Desktop.
Save pandanote-info/82291d4e23b4671b7ceeb38324c8edf8 to your computer and use it in GitHub Desktop.
EmacsでScalaのプロジェクトを編集して保存すると発生するバックアップファイルをsbtのcleanタスクで削除するためのbuild.sbtの設定例。
# Add the following line at the first line of build.sbt
import java.io.File
# The following lines may be added at anywhere in build.sbt
def ls(dir:String) : Seq[File] = {
new File(dir).listFiles.flatMap {
case f if f.isDirectory => ls(f.getPath)
case x => List(x)
}
}
cleanFiles ++= ls(".").filter(_.getPath.endsWith("~"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment