Skip to content

Commit

Permalink
Merge pull request #248 from larsrh/topic/drop-scalajs-0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg authored Nov 9, 2020
2 parents 7ea3075 + 9c7367c commit 76dd69a
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 41 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ jobs:
js:
strategy:
fail-fast: false
matrix:
scalajs: ["1.3.0", "0.6.32"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v7
- run: sbt +testsJS/test
env:
SCALAJS_VERSION: ${{ matrix.scalajs }}
GOOGLE_APPLICATION_CREDENTIALS:
${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_APPLICATION_CREDENTIALS_JSON:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
- name: Publish ${{ github.ref }}
run: |
sbt ci-release
SCALAJS_VERSION=0.6.32 sbt clean sonatypeBundleClean ci-release
sbt docs/docusaurusPublishGhpages
env:
GIT_USER: munit@scalameta.org
Expand Down
24 changes: 9 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import com.typesafe.tools.mima.core.MissingTypesProblem
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import sbtcrossproject.CrossPlugin.autoImport.CrossType
import scala.collection.mutable
val customScalaJSVersion = Option(System.getenv("SCALAJS_VERSION"))
val scalaJSVersion = customScalaJSVersion.getOrElse("1.3.0")
val scalaJSVersion = "1.3.0"
val scalaNativeVersion = "0.4.0-M2"
def previousVersion = "0.7.0"
def scala213 = "2.13.2"
Expand Down Expand Up @@ -110,7 +109,7 @@ val sharedJVMSettings: List[Def.Setting[_]] = List(
) ++ mimaEnable
val sharedJSSettings: List[Def.Setting[_]] = List(
skipIdeaSettings,
crossScalaVersions := scala2Versions,
crossScalaVersions := allScalaVersions.filterNot(_.startsWith("0.")),
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
val sharedJSConfigure: Project => Project =
Expand Down Expand Up @@ -151,7 +150,6 @@ lazy val junit = project
mimaEnable,
moduleName := "junit-interface",
description := "A Java implementation of sbt's test interface for JUnit 4",
skip in publish := customScalaJSVersion.isDefined,
autoScalaLibrary := false,
crossPaths := false,
sbtPlugin := false,
Expand Down Expand Up @@ -202,7 +200,6 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.nativeConfigure(sharedNativeConfigure)
.nativeSettings(
sharedNativeSettings,
skip in publish := customScalaJSVersion.isDefined,
libraryDependencies ++= List(
"org.scala-native" %%% "test-interface" % scalaNativeVersion
)
Expand All @@ -211,13 +208,14 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.jsSettings(
sharedJSSettings,
libraryDependencies ++= List(
"org.scala-js" %% "scalajs-test-interface" % scalaJSVersion,
"org.scala-js" %% "scalajs-junit-test-runtime" % scalaJSVersion
("org.scala-js" %% "scalajs-test-interface" % scalaJSVersion)
.withDottyCompat(scalaVersion.value),
("org.scala-js" %% "scalajs-junit-test-runtime" % scalaJSVersion)
.withDottyCompat(scalaVersion.value)
)
)
.jvmSettings(
sharedJVMSettings,
skip in publish := customScalaJSVersion.isDefined,
libraryDependencies ++= List(
"junit" % "junit" % "4.13.1"
)
Expand All @@ -234,7 +232,6 @@ lazy val plugin = project
sharedSettings,
moduleName := "sbt-munit",
sbtPlugin := true,
skip in publish := customScalaJSVersion.isDefined,
scalaVersion := scala212,
crossScalaVersions := List(scala212),
buildInfoPackage := "munit.sbtmunit",
Expand All @@ -254,16 +251,14 @@ lazy val munitScalacheck = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(
moduleName := "munit-scalacheck",
sharedSettings,
libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.0"
libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.1"
)
.jvmSettings(
sharedJVMSettings,
skip in publish := customScalaJSVersion.isDefined
sharedJVMSettings
)
.nativeConfigure(sharedNativeConfigure)
.nativeSettings(
sharedNativeSettings,
skip in publish := customScalaJSVersion.isDefined
sharedNativeSettings
)
.jsConfigure(sharedJSConfigure)
.jsSettings(sharedJSSettings)
Expand Down Expand Up @@ -305,7 +300,6 @@ lazy val docs = project
.settings(
sharedSettings,
moduleName := "munit-docs",
skip in publish := customScalaJSVersion.isDefined,
crossScalaVersions := List(scala213, scala212),
unmanagedSources.in(Compile) += sourceDirectory
.in(plugin, Compile)
Expand Down
14 changes: 7 additions & 7 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ libraryDependencies += "org.scalameta" %% "munit" % "@VERSION@" % Test
testFrameworks += new TestFramework("munit.Framework")
```

| Scala Version | JVM | Scala.js (0.6.x, 1.x) | Native (0.4.x) |
| ------------------------- | :-: | :-------------------: | :------------: |
| 2.11.x || ||
| 2.12.x || | n/a |
| 2.13.x || | n/a |
| @SCALA3_PREVIOUS_VERSION@ || n/a | n/a |
| @SCALA3_STABLE_VERSION@ || n/a | n/a |
| Scala Version | JVM | Scala.js (0.6.x) | Scala.js (1.x) | Native (0.4.x) |
| ------------------------- | :-: | :--------------: | :------------: | :------------: |
| 2.11.x || ✅ until 0.7.16 | ||
| 2.12.x || ✅ until 0.7.16 | | n/a |
| 2.13.x || ✅ until 0.7.16 | | n/a |
| @SCALA3_PREVIOUS_VERSION@ || n/a | | n/a |
| @SCALA3_STABLE_VERSION@ || n/a | | n/a |

Next, write a test suite.

Expand Down
3 changes: 2 additions & 1 deletion munit/js/src/main/scala/munit/internal/JSIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ object JSPath extends js.Any {
object JSIO {
private[internal] val process: JSProcess =
js.Dynamic.global.process.asInstanceOf[JSProcess]
def isNode: Boolean = !js.isUndefined(process) && !js.isUndefined(process.cwd)
def isNode: Boolean =
!js.isUndefined(process) && !js.isUndefined(process.cwd())

def inNode[T](f: => T): T =
if (JSIO.isNode) f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class TagsFilter(
var isExcluded = false
description.getAnnotations.foreach {
case t: Tag =>
isIncluded ||= include.contains(t.value())
isExcluded ||= exclude.contains(t.value())
isIncluded ||= include.contains(t.value)
isExcluded ||= exclude.contains(t.value)
case _ =>
}
isIncluded && !isExcluded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class JUnitFramework extends Framework {
var logAssert = false
var notLogExceptionClass = false
var useSbtLoggers = false
var trimStackTraces = defaults.trimStackTraces()
var trimStackTraces = defaults.trimStackTraces
var includeTags = Set.empty[String]
var excludeTags = Set.empty[String]
for (str <- args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package munit.internal.junitinterface

trait Settings {
def trimStackTraces(): Boolean
def trimStackTraces: Boolean
}

object Settings {
def defaults(): Settings = new Settings {
def trimStackTraces(): Boolean = true
def trimStackTraces: Boolean = true
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package munit.internal.junitinterface

trait Tag {
def value(): String
def value: String
}
8 changes: 4 additions & 4 deletions munit/shared/src/main/scala/munit/MUnitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
)
}

override def getDescription: Description = {
override def getDescription(): Description = {
val description = Description.createSuiteDescription(cls)

try {
Expand All @@ -104,7 +104,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
Await.result(runAsync(notifier), Duration.Inf)
}
def runAsync(notifier: RunNotifier): Future[Unit] = {
val description = getDescription
val description = getDescription()
notifier.fireTestSuiteStarted(description)
try {
runAll(notifier)
Expand Down Expand Up @@ -139,7 +139,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)

private def runAll(notifier: RunNotifier): Future[Unit] = {
if (PlatformCompat.isIgnoreSuite(cls)) {
val description = getDescription
val description = getDescription()
notifier.fireTestIgnored(description)
return Future.successful(())
}
Expand Down Expand Up @@ -356,7 +356,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
notifier.fireTestFinished(description)
}
private def trimStackTrace(ex: Throwable): Unit = {
if (settings.trimStackTraces()) {
if (settings.trimStackTraces) {
StackTraces.trimStackTrace(ex)
}
}
Expand Down
5 changes: 1 addition & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.3.0")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.11")
Expand All @@ -10,7 +7,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.23")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")

libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "1.113.2"
Expand Down

0 comments on commit 76dd69a

Please sign in to comment.