2023-01-08 17:13:31 +08:00
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
*
|
2023-06-22 14:19:26 +01:00
|
|
|
* This file is part of the Apache Pekko project, which was derived from Akka.
|
2023-01-08 17:13:31 +08:00
|
|
|
*/
|
|
|
|
|
|
2019-01-15 20:35:53 +08:00
|
|
|
/*
|
2022-02-04 12:36:44 +01:00
|
|
|
* Copyright (C) 2019-2022 Lightbend Inc. <https://www.lightbend.com>
|
2019-01-15 20:35:53 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.headerSources
|
2021-02-01 15:38:29 +00:00
|
|
|
import sbt.{ Compile, Def, Test, _ }
|
2019-01-15 20:35:53 +08:00
|
|
|
|
2024-01-21 11:27:34 +11:00
|
|
|
object CopyrightHeaderForJdk9 extends AutoPlugin {
|
2019-01-15 20:35:53 +08:00
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
override lazy val requires = CopyrightHeader && Jdk9
|
|
|
|
|
override lazy val trigger = allRequirements
|
2024-01-21 11:27:34 +11:00
|
|
|
|
2024-01-28 17:46:03 +08:00
|
|
|
private lazy val additionalFiles = Def.setting {
|
2019-01-15 20:35:53 +08:00
|
|
|
import Jdk9._
|
2024-01-28 17:46:03 +08:00
|
|
|
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)
|
2019-01-15 20:35:53 +08:00
|
|
|
}
|
|
|
|
|
}
|