diff --git a/build.sbt b/build.sbt index 6ecc031df9e..c5a7901d86a 100644 --- a/build.sbt +++ b/build.sbt @@ -26,6 +26,11 @@ commands := commands.value.filterNot { command => ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo +ThisBuild / pekkoCoreProject := true + +// pekkoInlineEnabled must be set to false when this is backported to 1.0.x branch +ThisBuild / pekkoInlineEnabled := true + enablePlugins( UnidocRoot, UnidocWithPrValidation, diff --git a/project/MiMa.scala b/project/MiMa.scala deleted file mode 100644 index 4bdbb9f573d..00000000000 --- a/project/MiMa.scala +++ /dev/null @@ -1,63 +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. - */ - -/* - * Copyright (C) 2009-2022 Lightbend Inc. - */ - -import scala.collection.immutable -import sbt._ -import sbt.Keys._ -import com.typesafe.tools.mima.plugin.MimaPlugin -import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._ - -object MiMa extends AutoPlugin { - - private val latestPatchOf10 = 0 - - override def requires = MimaPlugin - override def trigger = allRequirements - - val checkMimaFilterDirectories = - taskKey[Unit]("Check that the mima directories are correct compared to latest version") - - override val projectSettings = Seq( - mimaReportSignatureProblems := true, - mimaPreviousArtifacts := pekkoPreviousArtifacts(name.value, organization.value), - checkMimaFilterDirectories := checkFilterDirectories(baseDirectory.value)) - - def checkFilterDirectories(moduleRoot: File): Unit = { - val nextVersionFilterDir = - moduleRoot / "src" / "main" / "mima-filters" / s"1.0.${latestPatchOf10 + 1}.backwards.excludes" - if (nextVersionFilterDir.exists()) { - throw new IllegalArgumentException(s"Incorrect mima filter directory exists: '$nextVersionFilterDir' " + - s"should be with number from current release '${moduleRoot / "src" / "main" / "mima-filters" / s"1.0.$latestPatchOf10.backwards.excludes"}") - } - } - - def pekkoPreviousArtifacts( - projectName: String, - organization: String): Set[sbt.ModuleID] = { - val versions: Seq[String] = { - val firstPatchOf10 = 0 - - val pekko10Previous = expandVersions(1, 0, 0 to latestPatchOf10) - - pekko10Previous - } - - // check against all binary compatible artifacts - versions.map { v => - organization %% projectName % v - }.toSet - } - - private def expandVersions(major: Int, minor: Int, patches: immutable.Seq[Int]): immutable.Seq[String] = - patches.map(patch => s"$major.$minor.$patch") -} diff --git a/project/PekkoInlinePlugin.scala b/project/PekkoInlinePlugin.scala deleted file mode 100644 index 6f99703abcb..00000000000 --- a/project/PekkoInlinePlugin.scala +++ /dev/null @@ -1,47 +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, derived from Akka. - */ - -import sbt.Keys._ -import sbt._ -import sbt.plugins.JvmPlugin - -object PekkoInlinePlugin extends AutoPlugin { - override def trigger: PluginTrigger = allRequirements - - override def requires: Plugins = JvmPlugin - - val enabled = !sys.props.contains("pekko.no.inline") - - private val flagsFor212 = Seq( - "-opt-inline-from:org.apache.pekko.**", - "-opt-inline-from:", - "-opt:l:inline") - - private val flagsFor213 = Seq( - "-opt-inline-from:org.apache.pekko.**", - "-opt-inline-from:", - "-opt:l:inline") - - // Optimizer not yet available for Scala3, see https://docs.scala-lang.org/overviews/compiler-options/optimizer.html - private val flagsFor3 = Seq() - - override lazy val projectSettings = Seq( - Compile / scalacOptions ++= { - if (enabled) { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, n)) if n == 13 => - flagsFor213 - case Some((2, n)) if n == 12 => - flagsFor212 - case Some((3, _)) => - flagsFor3 - } - } else Seq.empty - }) -} diff --git a/project/plugins.sbt b/project/plugins.sbt index bccf9630ad7..13bae25fe60 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -27,6 +27,7 @@ addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.31") addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.11") addSbtPlugin("org.mdedetrich" % "sbt-apache-sonatype" % "0.1.10") +addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.3.0") addSbtPlugin("com.github.reibitto" % "sbt-welcome" % "0.4.0") addSbtPlugin("com.github.sbt" % "sbt-license-report" % "1.6.1")