Skip to content

Commit

Permalink
CI: Add temporary hack for Scala 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
japgolly committed Aug 12, 2021
1 parent 3744649 commit 69df48c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
java-version: "[email protected]"
- uses: coursier/cache-action@v6

- name: Hacks for Scala 2.10
if: matrix.scalaversion == '2.10.7'
run: ./prepareForScala210.sh

- name: Build
run: sbt "++${{ matrix.scalaversion }}" package

Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import _root_.scalafix.sbt.BuildInfo.scalafixVersion
import _root_.scalafix.sbt.BuildInfo.scalafixVersion // delete if Scala 2.10
import scalatex.ScalatexReadme

ThisBuild / shellPrompt := ((s: State) => Project.extract(s).currentRef.project + "> ")

lazy val scalafixRules = project
.in(file("scalafix"))
.settings(
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % scalafixVersion,
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % scalafixVersion, // delete if Scala 2.10
)

lazy val root = project
.in(file("."))
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalafixPlugin)
.dependsOn(scalafixRules % ScalafixConfig)
.enablePlugins(ScalafixPlugin) // delete if Scala 2.10
.dependsOn(scalafixRules % ScalafixConfig) // delete if Scala 2.10

name := "Scala.js DOM"

Expand Down Expand Up @@ -131,6 +131,6 @@ ThisBuild / prePR_nonCross := Def.sequential(
root / clean,
root / Compile / scalafmt,
root / Compile / compile,
(root / Compile / scalafix).toTask(""),
(root / Compile / scalafix).toTask(""), // delete if Scala 2.10
example / Compile / compile,
).value
6 changes: 6 additions & 0 deletions prepareForScala210.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"

sed -i -e '/delete if Scala 2.10/d' *.sbt project/*.sbt
rm scalafix.sbt
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") // delete if Scala 2.10

0 comments on commit 69df48c

Please sign in to comment.