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 cc23ee0a Create NoPublish sbt plugin
cc23ee0a is described below
commit cc23ee0a05e6aba419e159f67e0b763fb02f6c8d
Author: Matthew de Detrich <[email protected]>
AuthorDate: Sun May 28 12:16:11 2023 +0200
Create NoPublish sbt plugin
---
build.sbt | 18 ++++++++----------
project/NoPublish.scala | 23 +++++++++++++++++++++++
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/build.sbt b/build.sbt
index 104244d0..ae863d13 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,7 @@
import org.apache.pekko.grpc.Dependencies
import org.apache.pekko.grpc.Dependencies.Versions.{ scala212, scala213 }
import org.apache.pekko.grpc.ProjectExtensions._
+import org.apache.pekko.grpc.NoPublish
import org.apache.pekko.grpc.build.ReflectiveCodeGen
import com.typesafe.tools.mima.core._
import sbt.Keys.scalaVersion
@@ -146,7 +147,6 @@ lazy val interopTests = Project(id = "interop-tests", base
= file("interop-tests
PB.protocVersion := Dependencies.Versions.googleProtobuf,
// We need to be able to publish locally in order for sbt interopt tests
to work
// however this sbt project should not be published to an actual repository
- publish / skip := true,
publishLocal / skip := false,
Compile / doc := (Compile / doc / target).value)
.settings(inConfig(Test)(Seq(
@@ -166,7 +166,7 @@ lazy val interopTests = Project(id = "interop-tests", base
= file("interop-tests
}
.dependsOn(Compile / products)
.evaluated
- })))
+ }))).enablePlugins(NoPublish)
lazy val benchmarks = Project(id = "benchmarks", base = file("benchmarks"))
.dependsOn(runtime)
@@ -175,8 +175,8 @@ lazy val benchmarks = Project(id = "benchmarks", base =
file("benchmarks"))
.settings(
name := s"$pekkoPrefix-benchmarks",
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
- scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
- (publish / skip) := true)
+ scalaVersion := Dependencies.Versions.CrossScalaForLib.head)
+ .enablePlugins(NoPublish)
lazy val docs = Project(id = "docs", base = file("docs"))
// Make sure code generation is run:
@@ -186,7 +186,6 @@ lazy val docs = Project(id = "docs", base = file("docs"))
.disablePlugins(MimaPlugin)
.settings(
name := s"$pekkoPrefix-docs",
- publish / skip := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
pekkoParadoxGithub :=
Some("https://github.com/apache/incubator-pekko-grpc"),
previewPath := (Paradox / siteSubdirName).value,
@@ -219,33 +218,32 @@ lazy val docs = Project(id = "docs", base = file("docs"))
.settings(
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := Dependencies.Versions.CrossScalaForLib.head)
+ .enablePlugins(NoPublish)
lazy val pluginTesterScala = Project(id = "plugin-tester-scala", base =
file("plugin-tester-scala"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.pluginTester)
.settings(
name := s"$pekkoPrefix-plugin-tester-scala",
- (publish / skip) := true,
- Compile / doc / sources := Seq(),
fork := true,
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := scala212,
ReflectiveCodeGen.codeGeneratorSettings ++= Seq("flat_package",
"server_power_apis"))
.pluginTestingSettings
+ .enablePlugins(NoPublish)
lazy val pluginTesterJava = Project(id = "plugin-tester-java", base =
file("plugin-tester-java"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.pluginTester)
.settings(
name := s"$pekkoPrefix-plugin-tester-java",
- (publish / skip) := true,
- Compile / doc / sources := Seq(),
fork := true,
ReflectiveCodeGen.generatedLanguages := Seq("Java"),
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := scala212,
ReflectiveCodeGen.codeGeneratorSettings ++= Seq("server_power_apis"))
.pluginTestingSettings
+ .enablePlugins(NoPublish)
lazy val root = Project(id = "pekko-grpc", base = file("."))
.enablePlugins(ScalaUnidocPlugin)
@@ -263,7 +261,6 @@ lazy val root = Project(id = "pekko-grpc", base = file("."))
docs)
.settings(
name := s"$pekkoPrefix-root",
- (publish / skip) := true,
(Compile / headerCreate / unmanagedSources) := (baseDirectory.value /
"project").**("*.scala").get,
// unidoc combines sources and jars from all subprojects and that
// might include some incompatible ones. Depending on the
@@ -278,3 +275,4 @@ lazy val root = Project(id = "pekko-grpc", base = file("."))
// can then decide which scalaVersion and crossCalaVersions they use.
crossScalaVersions := Nil,
scalaVersion := scala212)
+ .enablePlugins(NoPublish)
diff --git a/project/NoPublish.scala b/project/NoPublish.scala
new file mode 100644
index 00000000..db3a554d
--- /dev/null
+++ b/project/NoPublish.scala
@@ -0,0 +1,23 @@
+/*
+ * 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, derived from Akka.
+ */
+
+package org.apache.pekko.grpc
+
+import sbt._
+import sbt.Keys._
+
+/**
+ * For projects that are not to be published.
+ */
+object NoPublish extends AutoPlugin {
+ override def requires = plugins.JvmPlugin
+
+ override def projectSettings =
+ Seq(publish / skip := true, Compile / doc / sources := Seq.empty)
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]