* Update sbt-header to 5.11.0 * chore: fix imports --------- Co-authored-by: scala-steward-asf[bot] <147768647+scala-steward-asf[bot]@users.noreply.github.com> Co-authored-by: He-Pin <hepin1989@gmail.com>
36 lines
1 KiB
Scala
36 lines
1 KiB
Scala
/*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* license agreements; and to You under the Apache License, version 2.0:
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* This file is part of the Apache Pekko project, which was derived from Akka.
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2019-2022 Lightbend Inc. <https://www.lightbend.com>
|
|
*/
|
|
|
|
import sbtheader.HeaderPlugin.autoImport.headerSources
|
|
import sbt.{ Compile, Def, Test, _ }
|
|
|
|
object CopyrightHeaderForJdk9 extends AutoPlugin {
|
|
|
|
override lazy val requires = CopyrightHeader && Jdk9
|
|
override lazy val trigger = allRequirements
|
|
|
|
private lazy val additionalFiles = Def.setting {
|
|
import Jdk9._
|
|
for {
|
|
dir <- additionalSourceDirectories.value ++ additionalTestSourceDirectories.value
|
|
language <- List("java", "scala")
|
|
file <- (dir ** s"*.$language").get
|
|
} yield file
|
|
}
|
|
|
|
override lazy val projectSettings: Seq[Def.Setting[_]] = {
|
|
|
|
Seq(Compile / headerSources ++= additionalFiles.value,
|
|
Test / headerSources ++= additionalFiles.value)
|
|
}
|
|
}
|