From 69df48cebe37d19b26645df1d59659f381dfecbf Mon Sep 17 00:00:00 2001 From: David Barri Date: Thu, 12 Aug 2021 12:49:27 +1000 Subject: [PATCH] CI: Add temporary hack for Scala 2.10 --- .github/workflows/ci.yml | 4 ++++ build.sbt | 10 +++++----- prepareForScala210.sh | 6 ++++++ project/plugins.sbt | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100755 prepareForScala210.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7052246f..b81aac291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,10 @@ jobs: java-version: "adopt@1.8" - 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 diff --git a/build.sbt b/build.sbt index 20f9f303c..968d843df 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -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 + "> ") @@ -6,14 +6,14 @@ 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" @@ -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 diff --git a/prepareForScala210.sh b/prepareForScala210.sh new file mode 100755 index 000000000..fbbc215e6 --- /dev/null +++ b/prepareForScala210.sh @@ -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 diff --git a/project/plugins.sbt b/project/plugins.sbt index f2707b716..91c2adca3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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