diff options
Diffstat (limited to 'src/main/scala-sbt-1.0/Compat.scala')
-rw-r--r-- | src/main/scala-sbt-1.0/Compat.scala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/scala-sbt-1.0/Compat.scala b/src/main/scala-sbt-1.0/Compat.scala new file mode 100644 index 0000000..f1a9d47 --- /dev/null +++ b/src/main/scala-sbt-1.0/Compat.scala @@ -0,0 +1,30 @@ +/* + * sbt-boilerplate is distributed under the 2-Clause BSD license. See the LICENSE file in the root + * of the repository. + * + * Copyright (c) 2012-2016 Johannes Rudolph + */ +package spray.boilerplate + +import sbt._ +import Keys._ +import sbt.internal.io.Source + +object Compat { + private val boilerplateSource = settingKey[File]("Default directory containing boilerplate template sources.") + private val inputFilter = """.*\.template""".r + + def allPaths(f: File) = f.allPaths + + def watchSourceSettings = Def.settings { + Seq( + watchSources in Defaults.ConfigGlobal += + new Source( + boilerplateSource.value, + new NameFilter { + override def accept(name: String): Boolean = inputFilter.pattern.matcher(name).matches() + }, + NothingFilter) + ) + } +} |