Skip to content

Commit

Permalink
Merge pull request #3527 from scala-steward-org/topic/scala-3
Browse files Browse the repository at this point in the history
Cross-build with Scala 3
  • Loading branch information
fthomas authored Jan 7, 2025
2 parents a35f3dc + 4bf0b66 commit eb87eff
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 12 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
scala: [2.13]
scala: [2.13, 3]
java: [temurin@21, temurin@17, temurin@11]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand Down Expand Up @@ -177,6 +177,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (3)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3

- name: Inflate target directories (3)
run: |
tar xf targets.tar
rm targets.tar
- name: Publish JARs
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
3 changes: 3 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pull_request_rules:
- status-success=Test (ubuntu-22.04, 2.13, temurin@21)
- status-success=Test (ubuntu-22.04, 2.13, temurin@17)
- status-success=Test (ubuntu-22.04, 2.13, temurin@11)
- status-success=Test (ubuntu-22.04, 3, temurin@21)
- status-success=Test (ubuntu-22.04, 3, temurin@17)
- status-success=Test (ubuntu-22.04, 3, temurin@11)
actions:
merge:
method: merge
13 changes: 10 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ val moduleCrossPlatformMatrix: Map[String, List[Platform]] = Map(
)

val Scala213 = "2.13.15"
val Scala3 = "3.3.4"

/// sbt-typelevel configuration

ThisBuild / crossScalaVersions := Seq(Scala213)
ThisBuild / crossScalaVersions := Seq(Scala213, Scala3)
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch(mainBranch)),
Expand Down Expand Up @@ -109,6 +110,7 @@ lazy val benchmark = myCrossProject("benchmark")
.enablePlugins(JmhPlugin)
.settings(noPublishSettings)
.settings(
crossScalaVersions := Seq(Scala213, Scala3),
scalacOptions -= "-Wnonunit-statement",
coverageEnabled := false,
unusedCompileDependencies := Set.empty
Expand All @@ -118,6 +120,7 @@ lazy val core = myCrossProject("core")
.enablePlugins(BuildInfoPlugin, JavaAppPackaging, DockerPlugin)
.settings(dockerSettings)
.settings(
crossScalaVersions := Seq(Scala213, Scala3),
libraryDependencies ++= Seq(
Dependencies.bcprovJdk15to18,
Dependencies.betterFiles,
Expand All @@ -129,8 +132,8 @@ lazy val core = myCrossProject("core")
Dependencies.circeParser,
Dependencies.circeRefined,
Dependencies.commonsIo,
Dependencies.coursierCore,
Dependencies.coursierSbtMaven,
Dependencies.coursierCore.cross(CrossVersion.for3Use2_13),
Dependencies.coursierSbtMaven.cross(CrossVersion.for3Use2_13),
Dependencies.cron4sCore,
Dependencies.decline,
Dependencies.fs2Core,
Expand Down Expand Up @@ -158,6 +161,9 @@ lazy val core = myCrossProject("core")
Dependencies.refinedScalacheck % Test,
Dependencies.scalacheck % Test
),
// Workaround for https://github.com/cb372/sbt-explicit-dependencies/issues/117
unusedCompileDependenciesFilter -=
moduleFilter(organization = Dependencies.coursierCore.organization),
assembly / test := {},
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "versions", "9", "module-info.class") =>
Expand Down Expand Up @@ -244,6 +250,7 @@ lazy val docs = myCrossProject("docs")
.enablePlugins(MdocPlugin)
.settings(noPublishSettings)
.settings(
scalacOptions += "-Ytasty-reader",
mdocIn := baseDirectory.value / ".." / "mdoc",
mdocOut := (LocalRootProject / baseDirectory).value / "docs",
mdocVariables := Map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ object ClientConfiguration {
val params = javax.net.ssl.SSLContext.getDefault().getDefaultSSLParameters()
params.setProtocols(params.getProtocols().filter(_ != "TLSv1.3"))
builder.sslParameters(params)
()
}

builder.executor(exec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ final class GitHubAuthAlg[F[_]](
val expMillis = nowMillis + ttlMillis
val exp = new Date(expMillis)
builder.expiration(exp)
()
}
builder.compact()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ object UpdateInfoUrlFinder {
fileNames.map(f => wrap(forgeRepo.fileUrlFor(f)))

gitHubReleaseNotesFor(forgeRepo, update.nextVersion) ++
customUrls(CustomReleaseNotes, possibleReleaseNotesFilenames) ++
customUrls(CustomChangelog, possibleChangelogFilenames) ++
customUrls(CustomReleaseNotes.apply, possibleReleaseNotesFilenames) ++
customUrls(CustomChangelog.apply, possibleChangelogFilenames) ++
possibleVersionDiffs(forgeRepo, update)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.scalasteward.core.repoconfig
import cats.Eq
import cats.syntax.all._
import cron4s.lib.javatime._
import cron4s.syntax.cron._
import io.circe.{Decoder, Encoder}
import org.scalasteward.core.repoconfig.PullRequestFrequency._
import org.scalasteward.core.util.Timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import org.scalasteward.core.buildtool.maven.pomXmlName
import org.scalasteward.core.buildtool.mill.MillAlg
import org.scalasteward.core.buildtool.sbt.buildPropertiesName
import org.scalasteward.core.data.{GroupId, Update}
import org.scalasteward.core.repoconfig.UpdatesConfig.defaultLimit
import org.scalasteward.core.scalafmt.scalafmtConfName
import org.scalasteward.core.update.FilterAlg.{
FilterResult,
Expand All @@ -42,7 +41,7 @@ final case class UpdatesConfig(
private val allowPreReleases: Option[List[UpdatePattern]] = None,
private val ignore: Option[List[UpdatePattern]] = None,
private val retracted: Option[List[RetractedArtifact]] = None,
limit: Option[NonNegInt] = defaultLimit,
limit: Option[NonNegInt] = UpdatesConfig.defaultLimit,
private val fileExtensions: Option[List[String]] = None
) {
private[repoconfig] def pinOrDefault: List[UpdatePattern] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.scalasteward.core.mock.MockContext.context.{
scalafixMigrationsLoader
}
import org.scalasteward.core.mock.MockContext.mockState
import org.scalasteward.core.mock.MockEffOps
import org.scalasteward.core.repoconfig.RepoConfigLoader
import org.scalasteward.core.update.artifact.ArtifactMigrationsLoader
import scala.util.{Failure, Success, Try}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package org.scalasteward.core.util
import munit.FunSuite
import org.http4s.Uri.UserInfo
import org.http4s.syntax.literals._
import org.scalasteward.core.util

class uriTest extends FunSuite {
test("withUserInfo") {
val url = uri"https://api.github.com/repos/"
assertEquals(
uri.withUserInfo.replace(UserInfo("user", Some("pass")))(url).toString,
"https://user:[email protected]/repos/"
)
val obtained = util.uri.withUserInfo.replace(UserInfo("user", Some("pass")))(url).toString
val expected = "https://user:[email protected]/repos/"
assertEquals(obtained, expected)
}
}

0 comments on commit eb87eff

Please sign in to comment.