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/25 10:32:44 UTC

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

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-grpc.git


The following commit(s) were added to refs/heads/main by this push:
     new 99ef1593 add license and notice to jars (#11)
99ef1593 is described below

commit 99ef1593d49a7b20a04cbbb61649e9ef7c1461e2
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Wed Jan 25 10:32:39 2023 +0000

    add license and notice to jars (#11)
---
 NOTICE                                 | 11 +++++++++++
 build.sbt                              |  8 ++++++++
 project/MetaInfLicenseNoticeCopy.scala | 30 ++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/NOTICE b/NOTICE
new file mode 100644
index 00000000..f8cc85e6
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,11 @@
+Apache Pekko gRPC
+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 gRPC is derived from Akka gRPC 2.1.x, the last version that was distributed under the
+Apache License, Version 2.0 License.
diff --git a/build.sbt b/build.sbt
index 1858066e..7de02d7a 100644
--- a/build.sbt
+++ b/build.sbt
@@ -53,6 +53,7 @@ lazy val runtime = Project(id = akkaGrpcRuntimeName, base = file("runtime"))
     mimaFailOnNoPrevious := true,
     mimaPreviousArtifacts := Set.empty, // temporarily disable mima checks
     AutomaticModuleName.settings("akka.grpc.runtime"),
+    MetaInfLicenseNoticeCopy.settings,
     ReflectiveCodeGen.generatedLanguages := Seq("Scala"),
     ReflectiveCodeGen.extraGenerators := Seq("ScalaMarshallersCodeGenerator"),
     PB.protocVersion := Dependencies.Versions.googleProtobuf)
@@ -80,6 +81,7 @@ lazy val scalapbProtocPlugin = Project(id = akkaGrpcProtocPluginId, base = file(
   .settings(
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
+  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(addArtifact(Compile / assembly / artifact, assembly))
   .settings(addArtifact(Artifact(akkaGrpcProtocPluginId, "bat", "bat", "bat"), mkBatAssemblyTask))
   .enablePlugins(ReproducibleBuildsPlugin)
@@ -94,6 +96,7 @@ lazy val mavenPlugin = Project(id = "akka-grpc-maven-plugin", base = file("maven
     crossPaths := false,
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
+  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(codegen)
 
 lazy val sbtPlugin = Project(id = "sbt-akka-grpc", base = file("sbt-plugin"))
@@ -115,6 +118,7 @@ lazy val sbtPlugin = Project(id = "sbt-akka-grpc", base = file("sbt-plugin"))
   .settings(
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
+  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(codegen)
 
 lazy val interopTests = Project(id = "akka-grpc-interop-tests", base = file("interop-tests"))
@@ -153,6 +157,7 @@ lazy val interopTests = Project(id = "akka-grpc-interop-tests", base = file("int
         .dependsOn(Compile / products)
         .evaluated
     })))
+  .settings(MetaInfLicenseNoticeCopy.settings)
 
 lazy val benchmarks = Project(id = "benchmarks", base = file("benchmarks"))
   .dependsOn(runtime)
@@ -162,6 +167,7 @@ lazy val benchmarks = Project(id = "benchmarks", base = file("benchmarks"))
     crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
     scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
     (publish / skip) := true)
+  .settings(MetaInfLicenseNoticeCopy.settings)
 
 lazy val docs = Project(id = "akka-grpc-docs", base = file("docs"))
 // Make sure code generation is ran:
@@ -216,6 +222,7 @@ lazy val pluginTesterScala = Project(id = "akka-grpc-plugin-tester-scala", base
     crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
     scalaVersion := scala212,
     ReflectiveCodeGen.codeGeneratorSettings ++= Seq("flat_package", "server_power_apis"))
+  .settings(MetaInfLicenseNoticeCopy.settings)
   .pluginTestingSettings
 
 lazy val pluginTesterJava = Project(id = "akka-grpc-plugin-tester-java", base = file("plugin-tester-java"))
@@ -228,6 +235,7 @@ lazy val pluginTesterJava = Project(id = "akka-grpc-plugin-tester-java", base =
     crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
     scalaVersion := scala212,
     ReflectiveCodeGen.codeGeneratorSettings ++= Seq("server_power_apis"))
+  .settings(MetaInfLicenseNoticeCopy.settings)
   .pluginTestingSettings
 
 lazy val root = Project(id = "akka-grpc", base = file("."))
diff --git a/project/MetaInfLicenseNoticeCopy.scala b/project/MetaInfLicenseNoticeCopy.scala
new file mode 100644
index 00000000..1965dc54
--- /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