Skip to content

Commit

Permalink
Merge pull request #300 from alexarchambault/full-cross-version
Browse files Browse the repository at this point in the history
Publish server and cli modules with full cross version suffix
  • Loading branch information
alexarchambault authored Oct 10, 2021
2 parents ea47432 + 287e20a commit f4902be
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@ on:
- main
pull_request:
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: olafurpg/setup-scala@v12
with:
java-version: "[email protected]"
- run: sbt +test:compile # ensuring metabrowse compiles for all Scala versions

unit:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
scala: [2.12.15]
scala: [2.12.15, 2.13.6]
os: [ubuntu-latest]
java: [11, 8]
steps:
Expand Down
14 changes: 12 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import scalajsbundler.util.JSON._
import sbtcrossproject.{crossProject, CrossType}

lazy val Version = new {
def scala213 = "2.13.6"
def scala212 = "2.12.15"
val scala213Versions = (0 to 6).map(p => s"2.13.$p")
val scala212Versions = (8 to 15).map(p => s"2.12.$p")
def scala213 = scala213Versions.last
def scala212 = scala212Versions.last
def scalameta = "4.4.28"
}

Expand Down Expand Up @@ -51,6 +53,11 @@ inThisBuild(
(publish / skip) := true
crossScalaVersions := Nil

lazy val fullCrossVersionSettings = Def.settings(
crossVersion := CrossVersion.full,
crossScalaVersions := Version.scala213Versions ++ Version.scala212Versions
)

def addPaigesLikeSourceDirs(config: Configuration, srcName: String) =
Def.settings(
config / unmanagedSourceDirectories ++= {
Expand Down Expand Up @@ -94,6 +101,7 @@ lazy val server = project
.in(file("metabrowse-server"))
.settings(
moduleName := "metabrowse-server",
fullCrossVersionSettings,
resolvers += Resolver.sonatypeRepo("releases"),
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies ++= List(
Expand Down Expand Up @@ -173,6 +181,7 @@ lazy val cli = project
.in(file("metabrowse-cli"))
.settings(
moduleName := "metabrowse-cli",
fullCrossVersionSettings,
(assembly / mainClass) := Some("metabrowse.cli.MetabrowseCli"),
(assembly / assemblyJarName) := "metabrowse.jar",
scalacOptions ++= {
Expand Down Expand Up @@ -317,6 +326,7 @@ lazy val tests = project
.in(file("metabrowse-tests"))
.configs(IntegrationTest)
.settings(
fullCrossVersionSettings,
(publish / skip) := true,
Defaults.itSettings,
run / baseDirectory := (ThisBuild / baseDirectory).value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ class MetabrowseCliSuite extends BaseMetabrowseCliSuite {
}
.sorted
.mkString("\n")
val extra =
val extraLazyListStuff =
if (is212)
"""org/typelevel/paiges/ScalaVersionCompat.LazyList#
|org/typelevel/paiges/ScalaVersionCompat.LazyList.
|""".stripMargin
else ""
val extraPi213Stuff =
if (is212) ""
else
"""org/typelevel/paiges/ColorTest#TwoPi.
|org/typelevel/paiges/ColorTest#TwoThirdsPi.
|""".stripMargin
val expected =
s"""|org/typelevel/paiges/Chunk.
|org/typelevel/paiges/Chunk.best().
Expand All @@ -66,7 +72,7 @@ class MetabrowseCliSuite extends BaseMetabrowseCliSuite {
|org/typelevel/paiges/Chunk.makeIndentStr().
|org/typelevel/paiges/ColorTest#
|org/typelevel/paiges/ColorTest#Quote.
|org/typelevel/paiges/ColorTest#`<init>`().
|${extraPi213Stuff}org/typelevel/paiges/ColorTest#`<init>`().
|org/typelevel/paiges/ColorTest#bg().
|org/typelevel/paiges/ColorTest#fg().
|org/typelevel/paiges/ColorTest#fromAngle().
Expand Down Expand Up @@ -317,7 +323,7 @@ class MetabrowseCliSuite extends BaseMetabrowseCliSuite {
|org/typelevel/paiges/PaigesTest.slowRenderTrim().
|org/typelevel/paiges/PaigesTest.twoRightAssociated().
|org/typelevel/paiges/ScalaVersionCompat.
|${extra}org/typelevel/paiges/ScalaVersionCompat.lazyListFromIterator().
|${extraLazyListStuff}org/typelevel/paiges/ScalaVersionCompat.lazyListFromIterator().
|org/typelevel/paiges/Style#
|org/typelevel/paiges/Style#`++`().
|org/typelevel/paiges/Style#`<init>`().
Expand Down

0 comments on commit f4902be

Please sign in to comment.