Skip to content

Commit

Permalink
add module options
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei.winitzki committed Nov 20, 2023
1 parent 38fc746 commit 19a233d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ jobs:
- run: sbt scalafmtCheckAll scalafmtSbtCheck
name: scall - build and test
on:
pull_request: {}
push: {}
9 changes: 6 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ val cbor3 = "io.bullet" %% "borer-core" % "1.8.0"
val curryhoward = "io.chymyst" %% "curryhoward" % "0.3.8"

lazy val jdkModuleOptions: Seq[String] = {
val options = if (scala.sys.props.get("JDK_VERSION") exists (_ startsWith "8.")) Seq() else Seq("--add-opens", "java.base/java.util=ALL-UNNAMED")
println(s"Additional JDK options: ${options.mkString(" ")}")
val jdkVersion = scala.sys.props.get("JDK_VERSION")
val options = if (jdkVersion exists (_ startsWith "8.")) Seq() else Seq("--add-opens", "java.base/java.util=ALL-UNNAMED")
println(s"Additional JDK ${jdkVersion.getOrElse("")} options: ${options.mkString(" ")}")
options
}

Expand All @@ -33,6 +34,8 @@ lazy val scall_core = (project in file("scall-core"))
crossScalaVersions := Seq(scala2V, scala3V),
testFrameworks += munitFramework,
Test / parallelExecution := true,
Test / fork := true,
Test / javaOptions ++= jdkModuleOptions,
scalafmtFailOnErrors := false, // Cannot disable the unicode surrogate pair error in Parser.scala?
libraryDependencies ++= Seq(
fastparse,
Expand All @@ -52,7 +55,7 @@ lazy val scall_testutils = (project in file("scall-testutils")).settings(
scalaVersion := scalaV,
crossScalaVersions := Seq(scala2V, scala3V),
testFrameworks += munitFramework,
Test / parallelExecution := false,
Test / parallelExecution := true,
Test / fork := true,
Test / javaOptions ++= jdkModuleOptions,
libraryDependencies ++= Seq(munitTest, assertVerboseTest),
Expand Down
2 changes: 1 addition & 1 deletion github-scala.dhall → github-scala-build-and-test.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ in GithubActions.Workflow::{
, name = "scall - build and test"
, on = GithubActions.On::{
, push = Some GithubActions.Push::{=}
, pull_request = Some GithubActions.PullRequest::{=}
--, pull_request = Some GithubActions.PullRequest::{=}
}
, jobs = toMap
{ checks = GithubActions.Job::{
Expand Down
2 changes: 1 addition & 1 deletion update_github_actions.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dhall-to-yaml --file github-scala.dhall > .github/workflows/build-and-test.yml
dhall-to-yaml --file github-scala-build-and-test.dhall > .github/workflows/build-and-test.yml

0 comments on commit 19a233d

Please sign in to comment.