Skip to content

Replace sbt-header with a shim #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")