You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2023/01/06 09:34:19 UTC

[incubator-pekko] branch main updated: try to add license and notice to jars (#77)

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git


The following commit(s) were added to refs/heads/main by this push:
     new 0208a4a3bd try to add license and notice to jars (#77)
0208a4a3bd is described below

commit 0208a4a3bd2079dac6516398e85ae65ef8fc29ac
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Fri Jan 6 10:34:14 2023 +0100

    try to add license and notice to jars (#77)
    
    I'm going to merge this - thanks for the reviews
---
 NOTICE                                 | 11 +++++++++++
 build.sbt                              |  1 +
 project/MetaInfLicenseNoticeCopy.scala | 30 ++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000000..f0b56127f0
--- /dev/null
+++ b/NOTICE
@@ -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.
diff --git a/build.sbt b/build.sbt
index 4270ae5fbb..46d27ebcd8 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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)
 
diff --git a/project/MetaInfLicenseNoticeCopy.scala b/project/MetaInfLicenseNoticeCopy.scala
new file mode 100644
index 0000000000..1965dc5408
--- /dev/null
+++ b/project/MetaInfLicenseNoticeCopy.scala
@@ -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)
+  }
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org