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/02/15 19:02:14 UTC

[incubator-pekko-http] branch main updated: Use sbt-apache-sonatype META-INF functionality

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


The following commit(s) were added to refs/heads/main by this push:
     new 6624fa98f Use sbt-apache-sonatype META-INF functionality
6624fa98f is described below

commit 6624fa98f43849f791bccd14c1ec3d80d091a994
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Wed Feb 15 18:26:30 2023 +0100

    Use sbt-apache-sonatype META-INF functionality
---
 build.sbt                              |  8 --------
 project/AddMetaInfLicenseFiles.scala   | 27 +++++++++++++++++++++++++++
 project/MetaInfLicenseNoticeCopy.scala | 31 -------------------------------
 project/plugins.sbt                    |  2 +-
 4 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/build.sbt b/build.sbt
index 2d701dc9f..2762da6f7 100644
--- a/build.sbt
+++ b/build.sbt
@@ -121,7 +121,6 @@ val scalaMacroSupport = Seq(
 lazy val parsing = project("parsing")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.parsing"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .addPekkoModuleDependency("pekko-actor", "provided")
   .settings(Dependencies.parsing)
   .settings(
@@ -135,7 +134,6 @@ lazy val parsing = project("parsing")
 lazy val httpCore = project("http-core")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.core"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(parsing, httpScalafixRules % ScalafixConfig)
   .addPekkoModuleDependency("pekko-stream", "provided")
   .addPekkoModuleDependency(
@@ -153,7 +151,6 @@ lazy val httpCore = project("http-core")
 lazy val http = project("http")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(httpCore)
   .addPekkoModuleDependency("pekko-stream", "provided")
   .settings(Dependencies.http)
@@ -212,7 +209,6 @@ lazy val http2Tests = project("http2-tests")
 lazy val httpTestkit = project("http-testkit")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.testkit"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .dependsOn(http)
   .addPekkoModuleDependency("pekko-stream-testkit", "provided")
   .addPekkoModuleDependency("pekko-testkit", "provided")
@@ -272,14 +268,12 @@ lazy val httpMarshallersScala = project("http-marshallers-scala")
 lazy val httpXml =
   httpMarshallersScalaSubproject("xml")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.scalaxml"))
-    .settings(MetaInfLicenseNoticeCopy.settings)
     .addPekkoModuleDependency("pekko-stream", "provided")
     .settings(Dependencies.httpXml)
 
 lazy val httpSprayJson =
   httpMarshallersScalaSubproject("spray-json")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.sprayjson"))
-    .settings(MetaInfLicenseNoticeCopy.settings)
     .addPekkoModuleDependency("pekko-stream", "provided")
     .settings(Dependencies.httpSprayJson)
 
@@ -292,7 +286,6 @@ lazy val httpMarshallersJava = project("http-marshallers-java")
 lazy val httpJackson =
   httpMarshallersJavaSubproject("jackson")
     .settings(AutomaticModuleName.settings("pekko.http.marshallers.jackson"))
-    .settings(MetaInfLicenseNoticeCopy.settings)
     .addPekkoModuleDependency("pekko-stream", "provided")
     .addPekkoModuleDependency("pekko-stream-testkit", "test")
     .dependsOn(httpTestkit % "test")
@@ -304,7 +297,6 @@ lazy val httpCaching = project("http-caching")
     name := "pekko-http-caching")
   .settings(commonSettings)
   .settings(AutomaticModuleName.settings("pekko.http.caching"))
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .addPekkoModuleDependency("pekko-stream", "provided")
   .addPekkoModuleDependency("pekko-stream-testkit", "provided")
   .settings(Dependencies.httpCaching)
diff --git a/project/AddMetaInfLicenseFiles.scala b/project/AddMetaInfLicenseFiles.scala
new file mode 100644
index 000000000..9b82e7fbd
--- /dev/null
+++ b/project/AddMetaInfLicenseFiles.scala
@@ -0,0 +1,27 @@
+/*
+ * 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._
+import org.mdedetrich.apache.sonatype.SonatypeApachePlugin
+import org.mdedetrich.apache.sonatype.SonatypeApachePlugin.autoImport._
+
+/**
+ * Copies LICENSE and NOTICE files into jar META-INF dir
+ */
+object AddMetaInfLicenseFiles extends AutoPlugin {
+
+  override lazy val projectSettings = Seq(
+    apacheSonatypeDisclaimerFile := Some((LocalRootProject / baseDirectory).value / "DISCLAIMER"))
+
+  override def trigger = allRequirements
+
+  override def requires = SonatypeApachePlugin
+
+}
diff --git a/project/MetaInfLicenseNoticeCopy.scala b/project/MetaInfLicenseNoticeCopy.scala
deleted file mode 100644
index 1f185755a..000000000
--- a/project/MetaInfLicenseNoticeCopy.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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"),
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "DISCLAIMER")))
-
-  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)
-  }
-
-}
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 5642ef3db..c47039930 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -26,7 +26,7 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
 addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.30")
 addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0")
 addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
-addSbtPlugin("org.mdedetrich" % "sbt-apache-sonatype" % "0.1.0")
+addSbtPlugin("org.mdedetrich" % "sbt-apache-sonatype" % "0.1.1")
 
 // used in ValidatePullRequest to check github PR comments whether to build all subprojects
 libraryDependencies += "org.kohsuke" % "github-api" % "1.306"


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