Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable cross-building for scala 3 #1616

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
java: [17, 21]
scala: [2.13.11]
scala: [2.13.13, 3.4.0]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
PGP_PASSPHRASE: ${{ secrets.ORG_SIGNING_PASSWORD }}
run: |
git fetch --unshallow --tags
cat /dev/null | project/sbt ++2.13.11 clean test +publishSigned
cat /dev/null | project/sbt ++2.13.13 clean test +publishSigned
cat /dev/null | project/sbt ++3.4.0 clean test +publishSigned
cat /dev/null | project/sbt sonatypeBundleRelease
3 changes: 2 additions & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ jobs:
PGP_PASSPHRASE: ${{ secrets.ORG_SIGNING_PASSWORD }}
run: |
git fetch --unshallow --tags
cat /dev/null | project/sbt ++2.13.11 clean test +publishSigned
cat /dev/null | project/sbt ++2.13.13 clean test +publishSigned
cat /dev/null | project/sbt ++3.4.0 clean test +publishSigned
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package com.netflix.atlas.eval.model
import com.fasterxml.jackson.core.JsonGenerator
import com.netflix.atlas.chart.model.LineStyle
import com.netflix.atlas.chart.model.Palette
import com.netflix.atlas.chart.model.PlotDef
import com.netflix.atlas.core.model.*
import com.netflix.atlas.core.util.Strings
import com.netflix.atlas.json.JsonSupport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ class FinalExprEvalSuite extends FunSuite {
}

private def getValue(ts: TimeSeriesMessage): Double = {
// https://github.com/lampepfl/dotty/issues/15661 ?
// On 3.4.0 there is an error if using `v` instead of `null` for the case
// where it is not ArrayData.
ts.data match {
case ArrayData(vs) =>
assertEquals(vs.length, 1)
vs(0)
case v =>
fail(s"unexpected data value: $v")
case null =>
fail(s"unexpected data value: null")
}
}

Expand Down
12 changes: 11 additions & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ object BuildSettings {
scalacOptions := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => compilerFlags ++ Seq("-Xsource:3")
case _ => compilerFlags
case _ => compilerFlags ++ Seq("-source", "3.3")
}
},
javacOptions ++= Seq("--release", "17"),
Compile / doc / sources := (Compile / doc / sources).value.filterNot(skipForDocs),
crossPaths := true,
crossScalaVersions := Dependencies.Versions.crossScala,
sourcesInBase := false,
Expand Down Expand Up @@ -67,4 +68,13 @@ object BuildSettings {
.settings(buildSettings: _*)
.settings(libraryDependencies ++= commonDeps)
}

/** Ignoring all scala files will cause it to use javadoc instead. This is done to workaround
* an issue with scaladoc on 3.x:
*
* https://github.com/Netflix/atlas/issues/1568
*/
def skipForDocs(f: File): Boolean = {
f.getName.endsWith(".scala") || f.getName == "Evaluator.java"
}
}
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ object Dependencies {
val iep = "5.0.17"
val jackson = "2.16.1"
val log4j = "2.22.1"
val scala = "2.13.12"
val scala = "2.13.13"
val slf4j = "1.7.36"
val spectator = "1.7.7"
val spring = "6.1.3"

val crossScala = Seq(scala)
val crossScala = Seq(scala, "3.4.0")
}

import Versions._
Expand Down
Loading