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 6d7fa0e0f build: cleanup PekkoDependency and also build nightly 
against latest snapshot
6d7fa0e0f is described below

commit 6d7fa0e0f85fa49f2fc2b6bbdd1480c992492cf7
Author: Johannes Rudolph <[email protected]>
AuthorDate: Mon Mar 27 10:50:46 2023 +0200

    build: cleanup PekkoDependency and also build nightly against latest 
snapshot
---
 .github/workflows/nightly.yml |  2 +-
 project/PekkoDependency.scala | 29 +++++++++++++----------------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 0c0e0cb81..705907536 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -15,7 +15,7 @@ jobs:
       matrix:
         SCALA_VERSION: [2.12, 2.13]
         JDK: [8, 11, 17]
-        PEKKO_VERSION: [default]
+        PEKKO_VERSION: [default, main]
     steps:
       - name: Checkout
         uses: actions/checkout@v2
diff --git a/project/PekkoDependency.scala b/project/PekkoDependency.scala
index 7cb930a83..01c2eb623 100644
--- a/project/PekkoDependency.scala
+++ b/project/PekkoDependency.scala
@@ -26,9 +26,15 @@ object PekkoDependency {
     // so 'x.y', 'x.y.z', 'current' or 'snapshot'
     def link: String
   }
-  case class Artifact(version: String, isSnapshot: Boolean = false) extends 
Pekko {
+  case class Artifact(version: String, isSnapshot: Boolean) extends Pekko {
     override def link = VersionNumber(version) match { case 
VersionNumber(Seq(x, y, _*), _, _) => s"$x.$y" }
   }
+  object Artifact {
+    def apply(version: String): Artifact = {
+      val isSnap = version.endsWith("-SNAPSHOT")
+      new Artifact(version, isSnap)
+    }
+  }
   case class Sources(uri: String, link: String = "current") extends Pekko {
     def version = link
   }
@@ -39,28 +45,19 @@ object PekkoDependency {
         Sources(pekkoSources)
       case None =>
         Option(System.getProperty("pekko.http.build.pekko.version")) match {
-          case Some("main")        => mainSnapshot
-          case Some("release-1.0") =>
-            // Don't 'downgrade' building even if pekko.sources asks for it
-            // (typically for the docs that require 2.6)
-            if (defaultVersion.startsWith("1.0")) 
Artifact(determineLatestSnapshot("0.0.0"), true)
-            else Artifact(defaultVersion)
-          case Some("default") | None =>
-            // TODO: Revert to Artifact(defaultVersion) when release of Pekko 
is made
-            mainSnapshot
-          case Some(other) => Artifact(other, true)
+          case Some("main")           => mainSnapshot
+          case Some("default") | None => Artifact(defaultVersion)
+          case Some(other)            => Artifact(other, true)
         }
     }
   }
 
   // Default version updated only when needed, 
https://pekko.apache.org/docs/pekko/current/project/downstream-upgrade-strategy.html
-  val minimumExpectedPekkoVersion = "1.0.0"
+  val minimumExpectedPekkoVersion = "0.0.0+26623-85c2a469-SNAPSHOT"
   val default = pekkoDependency(defaultVersion = minimumExpectedPekkoVersion)
-  val minimumExpectedPekko26Version = "1.0.0"
-  val docs = pekkoDependency(defaultVersion = minimumExpectedPekko26Version)
+  def docs = default
 
-  // TODO: Revert to Artifact(determineLatestSnapshot(...), true) when Pekko 
has its first release
-  lazy val mainSnapshot = Artifact("0.0.0+26623-85c2a469-SNAPSHOT", true)
+  lazy val mainSnapshot = Artifact(determineLatestSnapshot("0.0.0"), true)
 
   val pekkoVersion: String = default match {
     case Artifact(version, _) => version


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to