Skip to content

vscode-dotty: proper version for auto-configured projects #5282

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
Oct 18, 2018
Merged
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
21 changes: 16 additions & 5 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ object ExposedValues extends AutoPlugin {
}

object Build {
val scalacVersion = "2.12.7"

val baseVersion = "0.11.0"
val scalacVersion = "2.12.7"
val baseSbtDottyVersion = "0.2.6"

// Versions used by the vscode extension to create a new project
// This should be the latest published releases.
// TODO: Have the vscode extension fetch these numbers from the Internet
// instead of hardcoding them ?
val publishedDottyVersion = "0.11.0-bin-20181017-3253921-NIGHTLY" // Using a nightly for now to get worksheet support
val publishedSbtDottyVersion = "0.2.5"


val dottyOrganization = "ch.epfl.lamp"
val dottyGithubUrl = "https://github.com/lampepfl/dotty"


val isRelease = sys.env.get("RELEASEBUILD") == Some("yes")

val dottyVersion = {
Expand All @@ -56,8 +66,7 @@ object Build {

val sbtDottyName = "sbt-dotty"
val sbtDottyVersion = {
val base = "0.2.6"
if (isRelease) base else base + "-SNAPSHOT"
if (isRelease) baseSbtDottyVersion else baseSbtDottyVersion + "-SNAPSHOT"
}

val agentOptions = List(
Expand Down Expand Up @@ -992,9 +1001,11 @@ object Build {
resourceGenerators in Compile += Def.task {
// Resources that will be copied when bootstrapping a new project
val buildSbtFile = baseDirectory.value / "out" / "build.sbt"
IO.write(buildSbtFile, s"""scalaVersion := "$dottyVersion"""")
IO.write(buildSbtFile,
s"""scalaVersion := "$publishedDottyVersion"""")
val dottyPluginSbtFile = baseDirectory.value / "out" / "dotty-plugin.sbt"
IO.write(dottyPluginSbtFile, s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$sbtDottyVersion")""")
IO.write(dottyPluginSbtFile,
s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$publishedSbtDottyVersion")""")
Seq(buildSbtFile, dottyPluginSbtFile)
},
compile in Compile := Def.task {
Expand Down