Skip to content

Commit

Permalink
shim out sbt-header
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Jan 22, 2019
1 parent 6e224ab commit 32658b5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
34 changes: 34 additions & 0 deletions project/headershim.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.heikoseeberger.sbtheader

import sbt._
import sbt.Keys._
import sbt.plugins.JvmPlugin

object HeaderPlugin extends AutoPlugin {

final object autoImport {
class License
object HeaderLicense {
case class Custom(s: String) extends License
}
val headerLicense: SettingKey[Option[License]] = settingKey[Option[License]]("header License")

val headerSources = taskKey[scala.collection.Seq[File]]("Sources which need headers checked or created.")

val headerResources = taskKey[scala.collection.Seq[File]]("Resources which need headers checked or created.")

def headerSettings(configurations: Configuration*): Seq[Setting[_]] =
configurations.foldLeft(List.empty[Setting[_]]) { _ ++ inConfig(_)(toBeScopedSettings) }
}

import autoImport._

override def trigger = allRequirements

override def requires = JvmPlugin

override def projectSettings = headerSettings(Compile, Test)

private def toBeScopedSettings = Vector(headerSources := Nil, headerResources := Nil)

}
2 changes: 0 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ libraryDependencies ++= Seq(
concurrentRestrictions in Global := Seq(
Tags.limitAll(1) // workaround for https://github.com/sbt/sbt/issues/2970
)

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.0.0")

0 comments on commit 32658b5

Please sign in to comment.