Skip to content

Commit 9eb7c99

Browse files
authored
Merge pull request #4119 from armanbilge/fix/is-dotty-community-build
Rename `isDotty` -> `isScala3`
2 parents 9ab4a6e + f84c393 commit 9eb7c99

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

build.sbt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsites._
33
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
44
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
55

6-
val isDotty = Def.setting(
6+
val isScala3 = Def.setting(
77
CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 3)
88
)
99

@@ -146,7 +146,7 @@ def doctestGenTestsDottyCompat(isDotty: Boolean, genTests: Seq[File]): Seq[File]
146146
if (isDotty) Nil else genTests
147147

148148
lazy val commonSettings = Seq(
149-
scalacOptions ++= commonScalacOptions(scalaVersion.value, isDotty.value),
149+
scalacOptions ++= commonScalacOptions(scalaVersion.value, isScala3.value),
150150
Compile / unmanagedSourceDirectories ++= scalaVersionSpecificFolders("main", baseDirectory.value, scalaVersion.value),
151151
Test / unmanagedSourceDirectories ++= scalaVersionSpecificFolders("test", baseDirectory.value, scalaVersion.value),
152152
resolvers ++= Seq(Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots")),
@@ -161,7 +161,7 @@ def macroDependencies(scalaVersion: String) =
161161
lazy val catsSettings = Seq(
162162
incOptions := incOptions.value.withLogRecompileOnMacro(false),
163163
libraryDependencies ++= (
164-
if (isDotty.value) Nil
164+
if (isScala3.value) Nil
165165
else
166166
Seq(
167167
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
@@ -170,9 +170,10 @@ lazy val catsSettings = Seq(
170170
) ++ commonSettings ++ publishSettings ++ simulacrumSettings
171171

172172
lazy val simulacrumSettings = Seq(
173-
libraryDependencies ++= (if (isDotty.value) Nil else Seq(compilerPlugin(scalafixSemanticdb))),
173+
libraryDependencies ++= (if (isScala3.value) Nil else Seq(compilerPlugin(scalafixSemanticdb))),
174174
scalacOptions ++= (
175-
if (isDotty.value) Nil else Seq(s"-P:semanticdb:targetroot:${baseDirectory.value}/target/.semanticdb", "-Yrangepos")
175+
if (isScala3.value) Nil
176+
else Seq(s"-P:semanticdb:targetroot:${baseDirectory.value}/target/.semanticdb", "-Yrangepos")
176177
),
177178
libraryDependencies += "org.typelevel" %% "simulacrum-scalafix-annotations" % "0.5.4"
178179
)
@@ -190,7 +191,7 @@ lazy val commonJsSettings = Seq(
190191
else tv
191192
val a = (LocalRootProject / baseDirectory).value.toURI.toString
192193
val g = "https://github.com/raw/typelevel/cats/" + tagOrHash
193-
val opt = if (isDotty.value) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI"
194+
val opt = if (isScala3.value) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI"
194195
s"$opt:$a->$g/"
195196
},
196197
Global / scalaJSStage := FullOptStage,
@@ -711,7 +712,7 @@ lazy val algebra = crossProject(JSPlatform, JVMPlatform, NativePlatform)
711712
.settings(testingDependencies)
712713
.settings(
713714
scalacOptions := {
714-
if (isDotty.value)
715+
if (isScala3.value)
715716
scalacOptions.value.filterNot(Set("-Xfatal-warnings"))
716717
else scalacOptions.value
717718
},
@@ -727,7 +728,7 @@ lazy val algebraLaws = crossProject(JSPlatform, JVMPlatform, NativePlatform)
727728
.settings(testingDependencies)
728729
.settings(
729730
scalacOptions := {
730-
if (isDotty.value)
731+
if (isScala3.value)
731732
scalacOptions.value.filterNot(Set("-Xfatal-warnings"))
732733
else scalacOptions.value
733734
},
@@ -751,13 +752,13 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
751752
.settings(includeGeneratedSrc)
752753
.settings(
753754
libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test,
754-
doctestGenTests := doctestGenTestsDottyCompat(isDotty.value, doctestGenTests.value)
755+
doctestGenTests := doctestGenTestsDottyCompat(isScala3.value, doctestGenTests.value)
755756
)
756757
.settings(
757758
Compile / scalacOptions :=
758759
(Compile / scalacOptions).value.filter {
759-
case "-Xfatal-warnings" if isDotty.value => false
760-
case _ => true
760+
case "-Xfatal-warnings" if isScala3.value => false
761+
case _ => true
761762
}
762763
)
763764
.jsSettings(commonJsSettings)
@@ -1120,7 +1121,7 @@ lazy val sharedReleaseProcess = Seq(
11201121
)
11211122

11221123
lazy val warnUnusedImport = Seq(
1123-
scalacOptions ++= (if (isDotty.value) Nil else Seq("-Ywarn-unused:imports")),
1124+
scalacOptions ++= (if (isScala3.value) Nil else Seq("-Ywarn-unused:imports")),
11241125
Compile / console / scalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports"))),
11251126
Test / console / scalacOptions := (Compile / console / scalacOptions).value
11261127
)

0 commit comments

Comments
 (0)