Skip to content

Commit

Permalink
Remove dottySettings (zio#6825)
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffffect authored May 20, 2022
1 parent e8fa653 commit 4588d93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 60 deletions.
40 changes: 7 additions & 33 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.enablePlugins(BuildInfoPlugin)

lazy val coreJVM = core.jvm
.settings(dottySettings)
.settings(replSettings)
.settings(mimaSettings(failOnProblem = true))

lazy val coreJS = core.js
.settings(dottySettings)
.settings(libraryDependencies += "org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0")
.settings(
scalacOptions ++= {
Expand Down Expand Up @@ -182,12 +180,10 @@ lazy val coreTests = crossProject(JSPlatform, JVMPlatform)
.enablePlugins(BuildInfoPlugin)

lazy val coreTestsJVM = coreTests.jvm
.settings(dottySettings)
.configure(_.enablePlugins(JCStressPlugin))
.settings(replSettings)

lazy val coreTestsJS = coreTests.js
.settings(dottySettings)
.settings(
scalacOptions ++= {
if (scalaVersion.value == Scala3) {
Expand Down Expand Up @@ -235,12 +231,10 @@ lazy val streams = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.enablePlugins(BuildInfoPlugin)

lazy val streamsJVM = streams.jvm
.settings(dottySettings)
// No bincompat on streams yet
.settings(mimaSettings(failOnProblem = false))

lazy val streamsJS = streams.js
.settings(dottySettings)

lazy val streamsNative = streams.native
.settings(nativeSettings)
Expand All @@ -262,10 +256,8 @@ lazy val streamsTests = crossProject(JSPlatform, JVMPlatform)

lazy val streamsTestsJVM = streamsTests.jvm
.dependsOn(coreTestsJVM % "test->compile")
.settings(dottySettings)

lazy val streamsTestsJS = streamsTests.js
.settings(dottySettings)
.settings(
scalacOptions ++= {
if (scalaVersion.value == Scala3) {
Expand All @@ -291,11 +283,9 @@ lazy val test = crossProject(JSPlatform, JVMPlatform, NativePlatform)
)

lazy val testJVM = test.jvm
.settings(dottySettings)
// No bincompat on zio-test yet
.settings(mimaSettings(failOnProblem = false))
lazy val testJS = test.js
.settings(dottySettings)
.settings(
libraryDependencies ++= List(
"io.github.cquiroz" %%% "scala-java-time" % "2.4.0-M3",
Expand All @@ -318,9 +308,8 @@ lazy val testTests = crossProject(JSPlatform, JVMPlatform)
.settings(macroExpansionSettings)
.enablePlugins(BuildInfoPlugin)

lazy val testTestsJVM = testTests.jvm.settings(dottySettings)
lazy val testTestsJVM = testTests.jvm
lazy val testTestsJS = testTests.js
.settings(dottySettings)
.settings(
libraryDependencies ++= List(
("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13)
Expand Down Expand Up @@ -355,9 +344,7 @@ lazy val testMagnolia = crossProject(JVMPlatform, JSPlatform)
)

lazy val testMagnoliaJVM = testMagnolia.jvm
.settings(dottySettings)
lazy val testMagnoliaJS = testMagnolia.js
.settings(dottySettings)
lazy val testMagnoliaJS = testMagnolia.js

lazy val testMagnoliaTests = crossProject(JVMPlatform, JSPlatform)
.in(file("test-magnolia-tests"))
Expand All @@ -375,9 +362,7 @@ lazy val testMagnoliaTests = crossProject(JVMPlatform, JSPlatform)
.enablePlugins(BuildInfoPlugin)

lazy val testMagnoliaTestsJVM = testMagnoliaTests.jvm
.settings(dottySettings)
lazy val testMagnoliaTestsJS = testMagnoliaTests.js
.settings(dottySettings)
lazy val testMagnoliaTestsJS = testMagnoliaTests.js

lazy val testRefined = crossProject(JVMPlatform, JSPlatform)
.in(file("test-refined"))
Expand All @@ -394,9 +379,7 @@ lazy val testRefined = crossProject(JVMPlatform, JSPlatform)
)

lazy val testRefinedJVM = testRefined.jvm
.settings(dottySettings)
lazy val testRefinedJS = testRefined.js
.settings(dottySettings)
lazy val testRefinedJS = testRefined.js

lazy val testScalaCheck = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("test-scalacheck"))
Expand All @@ -410,8 +393,8 @@ lazy val testScalaCheck = crossProject(JSPlatform, JVMPlatform, NativePlatform)
)
)

lazy val testScalaCheckJVM = testScalaCheck.jvm.settings(dottySettings)
lazy val testScalaCheckJS = testScalaCheck.js.settings(dottySettings)
lazy val testScalaCheckJVM = testScalaCheck.jvm
lazy val testScalaCheckJS = testScalaCheck.js
lazy val testScalaCheckNative = testScalaCheck.native.settings(nativeSettings)

lazy val stacktracer = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand All @@ -422,9 +405,7 @@ lazy val stacktracer = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.enablePlugins(BuildInfoPlugin)

lazy val stacktracerJS = stacktracer.js
.settings(dottySettings)
lazy val stacktracerJVM = stacktracer.jvm
.settings(dottySettings)
.settings(replSettings)

lazy val stacktracerNative = stacktracer.native
Expand All @@ -440,10 +421,8 @@ lazy val testRunner = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.dependsOn(test)

lazy val testRunnerJVM = testRunner.jvm
.settings(dottySettings)
.settings(libraryDependencies ++= Seq("org.scala-sbt" % "test-interface" % "1.0"))
lazy val testRunnerJS = testRunner.js
.settings(dottySettings)
.settings(
libraryDependencies ++= Seq(
("org.scala-js" %% "scalajs-test-interface" % scalaJSVersion).cross(CrossVersion.for3Use2_13)
Expand All @@ -460,7 +439,7 @@ lazy val testJunitRunner = crossProject(JVMPlatform)
.settings(libraryDependencies ++= Seq("junit" % "junit" % "4.13.2"))
.dependsOn(test)

lazy val testJunitRunnerJVM = testJunitRunner.jvm.settings(dottySettings)
lazy val testJunitRunnerJVM = testJunitRunner.jvm

lazy val testJunitRunnerTests = crossProject(JVMPlatform)
.in(file("test-junit-tests"))
Expand Down Expand Up @@ -495,7 +474,6 @@ lazy val testJunitRunnerTests = crossProject(JVMPlatform)
.dependsOn(testRunner)

lazy val testJunitRunnerTestsJVM = testJunitRunnerTests.jvm
.settings(dottySettings)
// publish locally so embedded maven runs against locally compiled zio
.settings(
Test / Keys.test :=
Expand All @@ -519,11 +497,9 @@ lazy val concurrent = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))

lazy val concurrentJVM = concurrent.jvm
.settings(dottySettings)
.settings(mimaSettings(failOnProblem = false))

lazy val concurrentJS = concurrent.js
.settings(dottySettings)

lazy val concurrentNative = concurrent.native
.settings(nativeSettings)
Expand All @@ -544,10 +520,8 @@ lazy val examples = crossProject(JVMPlatform, JSPlatform)
.dependsOn(macros, testRunner)

lazy val examplesJS = examples.js
.settings(dottySettings)

lazy val examplesJVM = examples.jvm
.settings(dottySettings)
.dependsOn(testJunitRunnerJVM)

lazy val benchmarks = project.module
Expand Down
37 changes: 10 additions & 27 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,6 @@ object BuildHelper {
buildInfoPackage := packageName
)

val dottySettings = Seq(
crossScalaVersions += Scala3,
scalacOptions ++= {
if (scalaVersion.value == Scala3)
Seq("-noindent")
else
Seq()
},
scalacOptions --= {
if (scalaVersion.value == Scala3)
Seq("-Xfatal-warnings")
else
Seq()
},
Test / parallelExecution := {
val old = (Test / parallelExecution).value
if (scalaVersion.value == Scala3) {
false
} else {
old
}
}
)

// Keep this consistent with the version in .core-tests/shared/src/test/scala/REPLSpec.scala
val replSettings = makeReplSettings {
"""|import zio._
Expand Down Expand Up @@ -129,10 +105,11 @@ object BuildHelper {

def extraOptions(scalaVersion: String, optimize: Boolean) =
CrossVersion.partialVersion(scalaVersion) match {
case Some((3, 0)) =>
case Some((3, _)) =>
Seq(
"-language:implicitConversions",
"-Xignore-scala2-macros"
"-Xignore-scala2-macros",
"-noindent"
)
case Some((2, 13)) =>
Seq(
Expand Down Expand Up @@ -221,6 +198,12 @@ object BuildHelper {
crossScalaVersions := Seq(Scala211, Scala212, Scala213, Scala3),
ThisBuild / scalaVersion := Scala213,
scalacOptions ++= stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
scalacOptions --= {
if (scalaVersion.value == Scala3)
List("-Xfatal-warnings")
else
List()
},
libraryDependencies ++= {
if (scalaVersion.value == Scala3)
Seq(
Expand All @@ -232,7 +215,7 @@ object BuildHelper {
compilerPlugin("com.github.ghik" % "silencer-plugin" % SilencerVersion cross CrossVersion.full)
)
},
Test / parallelExecution := true,
Test / parallelExecution := { scalaVersion.value != Scala3 },
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library"),
Expand Down

0 comments on commit 4588d93

Please sign in to comment.