From 48b20eb57e91a2675c2c181e5afe45cdc321a9bd Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 21 Mar 2019 14:07:46 +0100 Subject: [PATCH 1/2] community-build: Update stdLib213 The standard library can now be compiled with Dotty without any code change, just by starting sbt with `-Dscala.build.compileWithDotty=true`. --- community-build/community-projects/stdLib213 | 2 +- .../communitybuild/CommunityBuildTest.scala | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/community-build/community-projects/stdLib213 b/community-build/community-projects/stdLib213 index 98710d2160b4..4cd834f7e4bc 160000 --- a/community-build/community-projects/stdLib213 +++ b/community-build/community-projects/stdLib213 @@ -1 +1 @@ -Subproject commit 98710d2160b40c8302b7b5df1344c1e77bfd9cc6 +Subproject commit 4cd834f7e4bc48482c2d98c0d9dca3d022650237 diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 9342262fc5e4..eef7623d2dfa 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -24,8 +24,9 @@ class CommunityBuildTest { * @param project The project name, should be a git submodule in community-build/ * @param command The sbt command used to test the project * @param updateCommand The sbt command used to update the project + * @param extraSbtArgs Extra arguments to pass to sbt */ - def test(project: String, testCommand: String, updateCommand: String): Unit = { + def test(project: String, testCommand: String, updateCommand: String, extraSbtArgs: Seq[String] = Nil): Unit = { def log(msg: String) = println(Console.GREEN + msg + Console.RESET) log(s"Building $project with dotty-bootstrapped $compilerVersion...") @@ -57,7 +58,7 @@ class CommunityBuildTest { val pluginFilePath = communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString() // Run the sbt command with the compiler version and sbt plugin set in the build - val arguments = Seq( + val arguments = extraSbtArgs ++ Seq( "-sbt-version", "1.2.7", s"--addPluginSbtFile=$pluginFilePath", s";clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! $testCommand" @@ -74,8 +75,8 @@ class CommunityBuildTest { | cd community-build/community-projects/$project | sbt ${arguments.init.mkString(" ")} "${arguments.last}" | - |For a faster feedback loop, one can try to extract a direct call to dotc from - |usign the sbt export command. For instance, for scalacheck, use + |For a faster feedback loop, one can try to extract a direct call to dotc + |using the sbt export command. For instance, for scalacheck, use | sbt export jvm/test:compileIncremental | |""".stripMargin) @@ -152,7 +153,8 @@ class CommunityBuildTest { @Test def stdLib213 = test( project = "stdLib213", testCommand = "library/compile", - updateCommand = "library/update" + updateCommand = "library/update", + extraSbtArgs = Seq("-Dscala.build.compileWithDotty=true") ) // TODO @oderky? It got broken by #5458 @@ -168,6 +170,6 @@ class UpdateCategory @Category(Array(classOf[UpdateCategory])) class CommunityBuildUpdate extends CommunityBuildTest { - override def test(project: String, testCommand: String, updateCommand: String): Unit = - super.test(project, updateCommand, null) + override def test(project: String, testCommand: String, updateCommand: String, extraSbtArgs: Seq[String]): Unit = + super.test(project, updateCommand, null, extraSbtArgs) } From 24a2d6f4fe1c24a695a2164c87ea661190943f6c Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 21 Mar 2019 18:02:50 +0100 Subject: [PATCH 2/2] community-build: turn off SNAPSHOT updating in the meta-build too We already start sbt with this command, but that only takes effect in the build, not the meta-build (and this still doesn't cover the meta-meta-...-builds, oh well). --- project/Build.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 99b2cd4d7ccc..83718f57a9b5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -918,7 +918,9 @@ object Build { (publishLocal in `dotty-compiler-bootstrapped`).value (publishLocal in `sbt-dotty`).value (publishLocal in `dotty-bootstrapped`).value - val pluginText = s"""addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")""" + val pluginText = + s"""updateOptions in Global ~= (_.withLatestSnapshots(false)) + |addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")""".stripMargin IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText) IO.write(baseDirectory.value / "dotty-bootstrapped.version", dottyVersion) },