try to add license and notice to jars (#77)

I'm going to merge this - thanks for the reviews
This commit is contained in:
PJ Fanning 2023-01-06 10:34:14 +01:00 committed by GitHub
parent bb5558035e
commit 0208a4a3bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

11
NOTICE Normal file
View file

@ -0,0 +1,11 @@
Apache Pekko
Copyright 2022, 2023 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
This product contains significant parts that were originally based on software from Lightbend (Akka <https://akka.io/>).
Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
Apache Pekko is a derived from Akka 2.6.x, the last version that was distributed under the
Apache License, Version 2.0 License.

View file

@ -113,6 +113,7 @@ lazy val actor = pekkoModule("actor")
(Compile / scalaSource).value.getParentFile / s"scala-$ver"
})
.settings(VersionGenerator.settings)
.settings(MetaInfLicenseNoticeCopy.settings)
.settings(serialversionRemoverPluginSettings)
.enablePlugins(BoilerplatePlugin)

View file

@ -0,0 +1,30 @@
/*
* 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.
*/
import sbt.Keys._
import sbt._
/**
* Copies LICENSE and NOTICE files into jar META-INF dir
*/
object MetaInfLicenseNoticeCopy {
val settings: Seq[Setting[_]] = inConfig(Compile)(
Seq(
resourceGenerators += copyFileToMetaInf(resourceManaged, "LICENSE"),
resourceGenerators += copyFileToMetaInf(resourceManaged, "NOTICE")))
def copyFileToMetaInf(dir: SettingKey[File], fileName: String) = Def.task[Seq[File]] {
val fromFile = (LocalRootProject / baseDirectory).value / fileName
val toFile = resourceManaged.value / "META-INF" / fileName
IO.copyFile(fromFile, toFile)
Seq(toFile)
}
}