Skip to content

Commit a5869ce

Browse files
committed
Replace sbt-header with a shim
1 parent bb1ce48 commit a5869ce

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

project/headershim.scala

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package de.heikoseeberger.sbtheader
2+
3+
import sbt._
4+
import sbt.Keys._
5+
import sbt.plugins.JvmPlugin
6+
7+
object HeaderPlugin extends AutoPlugin {
8+
9+
final object autoImport {
10+
class License
11+
object HeaderLicense {
12+
case class Custom(s: String) extends License
13+
}
14+
val headerLicense: SettingKey[Option[License]] = settingKey[Option[License]]("header License")
15+
16+
val headerSources = taskKey[scala.collection.Seq[File]]("Sources which need headers checked or created.")
17+
18+
val headerResources = taskKey[scala.collection.Seq[File]]("Resources which need headers checked or created.")
19+
20+
def headerSettings(configurations: Configuration*): Seq[Setting[_]] =
21+
configurations.foldLeft(List.empty[Setting[_]]) { _ ++ inConfig(_)(toBeScopedSettings) }
22+
}
23+
24+
import autoImport._
25+
26+
override def trigger = allRequirements
27+
28+
override def requires = JvmPlugin
29+
30+
override def projectSettings = headerSettings(Compile, Test)
31+
32+
private def toBeScopedSettings = Vector(headerSources := Nil, headerResources := Nil)
33+
34+
}

project/plugins.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,3 @@ libraryDependencies ++= Seq(
2929
concurrentRestrictions in Global := Seq(
3030
Tags.limitAll(1) // workaround for https://github.com/sbt/sbt/issues/2970
3131
)
32-
33-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.0.0")

0 commit comments

Comments
 (0)