Skip to content

Exit sbt when Dotty plugin is incompatible with sbt version #4327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ object Build {
settings(commonSettings).
settings(
version := {
val base = "0.2.0"
val base = "0.2.1"
if (isRelease) base else base + "-SNAPSHOT"
},

Expand Down
12 changes: 12 additions & 0 deletions sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ object DottyPlugin extends AutoPlugin {
incOptions.withExternalHooks(hooks)
}

override val globalSettings: Seq[Def.Setting[_]] = Seq(
onLoad in Global := onLoad.in(Global).value.andThen { state =>
val sbtV = sbtVersion.value
sbtFullVersion(sbtV) match {
case Some((1, sbtMinor, sbtPatch)) if sbtMinor > 1 || (sbtMinor == 1 && sbtPatch >= 4) =>
case _ =>
sys.error(s"The sbt-dotty plugin cannot work with this version of sbt ($sbtV), sbt >= 1.1.4 is required.")
}
state
}
)

override def projectSettings: Seq[Setting[_]] = {
Seq(
isDotty := scalaVersion.value.startsWith("0."),
Expand Down