aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala-sbt-1.0/Compat.scala
diff options
context:
space:
mode:
authorEugene Yokota <eed3si9n@gmail.com>2017-08-05 05:08:37 -0400
committerEugene Yokota <eed3si9n@gmail.com>2017-08-05 05:08:37 -0400
commit392cb3aea7a26adacfcdb65c7cc47764711c871a (patch)
tree11aa3af5d12f035d4d9ab9dd60c579cf6b2ec51b /src/main/scala-sbt-1.0/Compat.scala
parent5a55990edd587fa7c86c776f7f1871597444ee0d (diff)
downloadsbt-boilerplate-392cb3aea7a26adacfcdb65c7cc47764711c871a.tar.gz
sbt-boilerplate-392cb3aea7a26adacfcdb65c7cc47764711c871a.tar.bz2
sbt-boilerplate-392cb3aea7a26adacfcdb65c7cc47764711c871a.zip
cross build to sbt 1.x
Diffstat (limited to 'src/main/scala-sbt-1.0/Compat.scala')
-rw-r--r--src/main/scala-sbt-1.0/Compat.scala30
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)
+ )
+ }
+}