2019-01-02 18:55:26 +08:00
|
|
|
/*
|
2021-01-08 17:55:38 +01:00
|
|
|
* Copyright (C) 2019-2021 Lightbend Inc. <https://www.lightbend.com>
|
2019-01-02 18:55:26 +08:00
|
|
|
*/
|
|
|
|
|
|
2019-01-15 20:35:53 +08:00
|
|
|
package akka
|
|
|
|
|
|
2021-02-01 15:38:29 +00:00
|
|
|
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.{ headerMappings, headerSources, HeaderFileType }
|
2019-01-02 18:55:26 +08:00
|
|
|
import sbt.Keys.sourceDirectory
|
2021-02-01 15:38:29 +00:00
|
|
|
import sbt.{ Compile, Def, Test, inConfig, _ }
|
2019-01-02 18:55:26 +08:00
|
|
|
|
|
|
|
|
object CopyrightHeaderForProtobuf extends CopyrightHeader {
|
|
|
|
|
override protected def headerMappingSettings: Seq[Def.Setting[_]] = {
|
|
|
|
|
super.headerMappingSettings
|
|
|
|
|
Seq(Compile, Test).flatMap { config =>
|
|
|
|
|
inConfig(config) {
|
|
|
|
|
Seq(
|
|
|
|
|
headerSources in config ++=
|
|
|
|
|
(((sourceDirectory in config).value / "protobuf") ** "*.proto").get,
|
2021-02-01 15:38:29 +00:00
|
|
|
headerMappings := headerMappings.value ++ Map(HeaderFileType("proto") -> cStyleComment))
|
2019-01-02 18:55:26 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|