You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by md...@apache.org on 2023/03/01 11:43:24 UTC

[incubator-pekko-grpc] branch main updated: Remove duplicate META-INF license entry

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

mdedetrich 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 19daebf6 Remove duplicate META-INF license entry
19daebf6 is described below

commit 19daebf6c1cead57f6bae993e4777dd6697fff56
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Wed Mar 1 12:23:33 2023 +0100

    Remove duplicate META-INF license entry
---
 build.sbt                              |  8 --------
 project/Common.scala                   |  4 +---
 project/MetaInfLicenseNoticeCopy.scala | 20 ++++++++------------
 3 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/build.sbt b/build.sbt
index 271541bc..76b061d1 100644
--- a/build.sbt
+++ b/build.sbt
@@ -60,7 +60,6 @@ lazy val runtime = Project(id = "runtime", base = file("runtime"))
     mimaFailOnNoPrevious := true,
     mimaPreviousArtifacts := Set.empty, // temporarily disable mima checks
     AutomaticModuleName.settings("pekko.grpc.runtime"),
-    MetaInfLicenseNoticeCopy.settings,
     ReflectiveCodeGen.generatedLanguages := Seq("Scala"),
     ReflectiveCodeGen.extraGenerators := Seq("ScalaMarshallersCodeGenerator"),
     PB.protocVersion := Dependencies.Versions.googleProtobuf)
@@ -89,7 +88,6 @@ lazy val scalapbProtocPlugin = Project(id = "scalapb-protoc-plugin", base = file
   .settings(
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(addArtifact(Compile / assembly / artifact, assembly))
   .settings(addArtifact(Artifact(pekkoGrpcProtocPluginId, "bat", "bat", "bat"), mkBatAssemblyTask))
   .enablePlugins(ReproducibleBuildsPlugin)
@@ -104,7 +102,6 @@ lazy val mavenPlugin = Project(id = "maven-plugin", base = file("maven-plugin"))
     crossPaths := false,
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(codegen)
 
 lazy val sbtPlugin = Project(id = "sbt-plugin", base = file("sbt-plugin"))
@@ -127,7 +124,6 @@ lazy val sbtPlugin = Project(id = "sbt-plugin", base = file("sbt-plugin"))
   .settings(
     crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
     scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(codegen)
 
 lazy val interopTests = Project(id = "interop-tests", base = file("interop-tests"))
@@ -167,7 +163,6 @@ lazy val interopTests = Project(id = "interop-tests", base = file("interop-tests
         .dependsOn(Compile / products)
         .evaluated
     })))
-  .settings(MetaInfLicenseNoticeCopy.settings)
 
 lazy val benchmarks = Project(id = "benchmarks", base = file("benchmarks"))
   .dependsOn(runtime)
@@ -178,7 +173,6 @@ 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 = "docs", base = file("docs"))
 // Make sure code generation is run:
@@ -235,7 +229,6 @@ lazy val pluginTesterScala = Project(id = "plugin-tester-scala", base = file("pl
     crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
     scalaVersion := scala212,
     ReflectiveCodeGen.codeGeneratorSettings ++= Seq("flat_package", "server_power_apis"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .pluginTestingSettings
 
 lazy val pluginTesterJava = Project(id = "plugin-tester-java", base = file("plugin-tester-java"))
@@ -249,7 +242,6 @@ lazy val pluginTesterJava = Project(id = "plugin-tester-java", base = file("plug
     crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
     scalaVersion := scala212,
     ReflectiveCodeGen.codeGeneratorSettings ++= Seq("server_power_apis"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .pluginTestingSettings
 
 lazy val root = Project(id = "pekko-grpc", base = file("."))
diff --git a/project/Common.scala b/project/Common.scala
index 776e0d76..abb83a29 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -8,7 +8,6 @@ import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys.projectInf
 import com.typesafe.tools.mima.plugin.MimaKeys._
 import sbtprotoc.ProtocPlugin.autoImport.PB
 import org.mdedetrich.apache.sonatype.SonatypeApachePlugin
-import SonatypeApachePlugin.autoImport.apacheSonatypeDisclaimerFile
 
 object Common extends AutoPlugin {
   override def trigger = allRequirements
@@ -29,8 +28,7 @@ object Common extends AutoPlugin {
         "Contributors",
         "dev@pekko.apache.org",
         url("https://github.com/apache/incubator-pekko-grpc/graphs/contributors")),
-      description := "Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams.",
-      apacheSonatypeDisclaimerFile := Some((LocalRootProject / baseDirectory).value / "DISCLAIMER"))
+      description := "Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams.")
 
   override lazy val projectSettings = Seq(
     projectInfoVersion := (if (isSnapshot.value) "snapshot" else version.value),
diff --git a/project/MetaInfLicenseNoticeCopy.scala b/project/MetaInfLicenseNoticeCopy.scala
index 1f185755..4bc8b9ca 100644
--- a/project/MetaInfLicenseNoticeCopy.scala
+++ b/project/MetaInfLicenseNoticeCopy.scala
@@ -9,23 +9,19 @@
 
 import sbt.Keys._
 import sbt._
+import org.mdedetrich.apache.sonatype.SonatypeApachePlugin
+import SonatypeApachePlugin.autoImport.apacheSonatypeDisclaimerFile
 
 /**
  * Copies LICENSE and NOTICE files into jar META-INF dir
  */
-object MetaInfLicenseNoticeCopy {
+object MetaInfLicenseNoticeCopy extends AutoPlugin {
 
-  val settings: Seq[Setting[_]] = inConfig(Compile)(
-    Seq(
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "LICENSE"),
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "NOTICE"),
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "DISCLAIMER")))
+  override def trigger = allRequirements
 
-  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)
-  }
+  override def requires = SonatypeApachePlugin
+
+  override lazy val projectSettings = Seq(
+    apacheSonatypeDisclaimerFile := Some((LocalRootProject / baseDirectory).value / "DISCLAIMER"))
 
 }


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