Skip to content

Commit d5b885d

Browse files
authored
Merge pull request #5282 from dotty-staging/fix/vscode-new-project
vscode-dotty: proper version for auto-configured projects
2 parents ae7af82 + 71ed0eb commit d5b885d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

project/Build.scala

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,23 @@ object ExposedValues extends AutoPlugin {
3434
}
3535

3636
object Build {
37+
val scalacVersion = "2.12.7"
3738

3839
val baseVersion = "0.11.0"
39-
val scalacVersion = "2.12.7"
40+
val baseSbtDottyVersion = "0.2.6"
41+
42+
// Versions used by the vscode extension to create a new project
43+
// This should be the latest published releases.
44+
// TODO: Have the vscode extension fetch these numbers from the Internet
45+
// instead of hardcoding them ?
46+
val publishedDottyVersion = "0.11.0-bin-20181017-3253921-NIGHTLY" // Using a nightly for now to get worksheet support
47+
val publishedSbtDottyVersion = "0.2.5"
48+
4049

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

53+
4454
val isRelease = sys.env.get("RELEASEBUILD") == Some("yes")
4555

4656
val dottyVersion = {
@@ -56,8 +66,7 @@ object Build {
5666

5767
val sbtDottyName = "sbt-dotty"
5868
val sbtDottyVersion = {
59-
val base = "0.2.6"
60-
if (isRelease) base else base + "-SNAPSHOT"
69+
if (isRelease) baseSbtDottyVersion else baseSbtDottyVersion + "-SNAPSHOT"
6170
}
6271

6372
val agentOptions = List(
@@ -992,9 +1001,11 @@ object Build {
9921001
resourceGenerators in Compile += Def.task {
9931002
// Resources that will be copied when bootstrapping a new project
9941003
val buildSbtFile = baseDirectory.value / "out" / "build.sbt"
995-
IO.write(buildSbtFile, s"""scalaVersion := "$dottyVersion"""")
1004+
IO.write(buildSbtFile,
1005+
s"""scalaVersion := "$publishedDottyVersion"""")
9961006
val dottyPluginSbtFile = baseDirectory.value / "out" / "dotty-plugin.sbt"
997-
IO.write(dottyPluginSbtFile, s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$sbtDottyVersion")""")
1007+
IO.write(dottyPluginSbtFile,
1008+
s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$publishedSbtDottyVersion")""")
9981009
Seq(buildSbtFile, dottyPluginSbtFile)
9991010
},
10001011
compile in Compile := Def.task {

0 commit comments

Comments
 (0)