From dace332fff65adccfd9bd368ddd425c02098d22e Mon Sep 17 00:00:00 2001 From: Anatolii Date: Wed, 27 Nov 2019 18:04:11 +0100 Subject: [PATCH 1/3] Add ujson and scalatestplus-scalacheck to the community build --- .gitmodules | 6 +++++ .../scalatestplus-scalacheck | 1 + community-build/community-projects/upickle | 1 + .../communitybuild/CommunityBuildTest.scala | 25 ++++++++++++++++--- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 160000 community-build/community-projects/scalatestplus-scalacheck create mode 160000 community-build/community-projects/upickle diff --git a/.gitmodules b/.gitmodules index fde8547ad49b..24bb46799278 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,3 +62,9 @@ [submodule "community-build/community-projects/os-lib"] path = community-build/community-projects/os-lib url = https://github.com/dotty-staging/os-lib.git +[submodule "community-build/community-projects/scalatestplus-scalacheck"] + path = community-build/community-projects/scalatestplus-scalacheck + url = https://github.com/dotty-staging/scalatestplus-scalacheck.git +[submodule "community-build/community-projects/upickle"] + path = community-build/community-projects/upickle + url = https://github.com/dotty-staging/upickle.git diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck new file mode 160000 index 000000000000..349d6d8c9367 --- /dev/null +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -0,0 +1 @@ +Subproject commit 349d6d8c936738a685fe3644d35a46d214b95034 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle new file mode 160000 index 000000000000..e46ab934d7f9 --- /dev/null +++ b/community-build/community-projects/upickle @@ -0,0 +1 @@ +Subproject commit e46ab934d7f92ed621e399f20abde8f9f923d819 diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index fdfca42df8b0..a9c18ef8eadd 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -87,10 +87,9 @@ final case class MillCommunityProject(project: String, baseCommand: String, final case class SbtCommunityProject(project: String, sbtTestCommand: String, sbtUpdateCommand: String, extraSbtArgs: List[String] = Nil, - dependencies: List[CommunityProject] = Nil) extends CommunityProject + dependencies: List[CommunityProject] = Nil, publishCommand: String = null) extends CommunityProject override val binaryName: String = "sbt" private val baseCommand = s";clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! " - override val publishCommand = null override val testCommand = s"$baseCommand$sbtTestCommand" override val updateCommand = s"$baseCommand$sbtUpdateCommand" @@ -126,6 +125,12 @@ object projects dependencies = List(utest, sourcecode) ) + val ujson = MillCommunityProject( + project = "upickle", + baseCommand = s"ujson.jvm[$compilerVersion]", + dependencies = List(scalatest, scalacheck, scalatestplusScalacheck) + ) + val intent = SbtCommunityProject( project = "intent", sbtTestCommand = "test", @@ -141,13 +146,23 @@ object projects val scalacheck = SbtCommunityProject( project = "scalacheck", sbtTestCommand = "jvm/test", - sbtUpdateCommand = "jvm/test:update" + sbtUpdateCommand = "jvm/test:update", + publishCommand = ";set jvm/publishArtifact in (Compile, packageDoc) := false ;jvm/publishLocal" ) val scalatest = SbtCommunityProject( project = "scalatest", sbtTestCommand = ";scalacticDotty/clean;scalacticTestDotty/test;scalatestTestDotty/test", - sbtUpdateCommand = "scalatest/update" + sbtUpdateCommand = "scalatest/update", + publishCommand = ";scalacticDotty/publishLocal; scalatestDotty/publishLocal" + ) + + val scalatestplusScalacheck = SbtCommunityProject( + project = "scalatestplus-scalacheck", + sbtTestCommand = "scalatestPlusScalaCheckJVM/compile", // TODO: compile only because tests are prone to java.lang.OutOfMemoryError: Metaspace + sbtUpdateCommand = "scalatestPlusScalaCheckJVM/update", + publishCommand = "scalatestPlusScalaCheckJVM/publishLocal", + dependencies = List(scalatest, scalacheck) ) val scalaXml = SbtCommunityProject( @@ -300,6 +315,7 @@ class CommunityBuildTest { @Test def algebra = projects.algebra.run() @Test def scalacheck = projects.scalacheck.run() @Test def scalatest = projects.scalatest.run() + @Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run() @Test def scalaXml = projects.scalaXml.run() @Test def scopt = projects.scopt.run() @Test def scalap = projects.scalap.run() @@ -311,6 +327,7 @@ class CommunityBuildTest { @Test def utest = projects.utest.run() @Test def sourcecode = projects.sourcecode.run() @Test def oslib = projects.oslib.run() + @Test def ujson = projects.ujson.run() // @Test def oslibWatch = projects.oslibWatch.run() @Test def stdLib213 = projects.stdLib213.run() @Test def shapeless = projects.shapeless.run() From 5340e15f0b86ac1f6ea0f6aeda9b290ef1ab5a82 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Wed, 27 Nov 2019 18:09:32 +0100 Subject: [PATCH 2/3] Community projects are made lazy So that we do not get NullPointerExceptions when a dependency of a project is defined after the project in question. --- .../communitybuild/CommunityBuildTest.scala | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index a9c18ef8eadd..f0e316952e74 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -103,61 +103,61 @@ final case class SbtCommunityProject(project: String, sbtTestCommand: String, s"--addPluginSbtFile=$sbtPluginFilePath") object projects - val utest = MillCommunityProject( + lazy val utest = MillCommunityProject( project = "utest", baseCommand = s"utest.jvm[$compilerVersion]", ) - val sourcecode = MillCommunityProject( + lazy val sourcecode = MillCommunityProject( project = "sourcecode", baseCommand = s"sourcecode.jvm[$compilerVersion]", ) - val oslib = MillCommunityProject( + lazy val oslib = MillCommunityProject( project = "os-lib", baseCommand = s"os[$compilerVersion]", dependencies = List(utest, sourcecode) ) - val oslibWatch = MillCommunityProject( + lazy val oslibWatch = MillCommunityProject( project = "os-lib", baseCommand = s"os.watch[$compilerVersion]", dependencies = List(utest, sourcecode) ) - val ujson = MillCommunityProject( + lazy val ujson = MillCommunityProject( project = "upickle", baseCommand = s"ujson.jvm[$compilerVersion]", dependencies = List(scalatest, scalacheck, scalatestplusScalacheck) ) - val intent = SbtCommunityProject( + lazy val intent = SbtCommunityProject( project = "intent", sbtTestCommand = "test", sbtUpdateCommand = "update" ) - val algebra = SbtCommunityProject( + lazy val algebra = SbtCommunityProject( project = "algebra", sbtTestCommand = "coreJVM/compile", sbtUpdateCommand = "coreJVM/update" ) - val scalacheck = SbtCommunityProject( + lazy val scalacheck = SbtCommunityProject( project = "scalacheck", sbtTestCommand = "jvm/test", sbtUpdateCommand = "jvm/test:update", publishCommand = ";set jvm/publishArtifact in (Compile, packageDoc) := false ;jvm/publishLocal" ) - val scalatest = SbtCommunityProject( + lazy val scalatest = SbtCommunityProject( project = "scalatest", sbtTestCommand = ";scalacticDotty/clean;scalacticTestDotty/test;scalatestTestDotty/test", sbtUpdateCommand = "scalatest/update", publishCommand = ";scalacticDotty/publishLocal; scalatestDotty/publishLocal" ) - val scalatestplusScalacheck = SbtCommunityProject( + lazy val scalatestplusScalacheck = SbtCommunityProject( project = "scalatestplus-scalacheck", sbtTestCommand = "scalatestPlusScalaCheckJVM/compile", // TODO: compile only because tests are prone to java.lang.OutOfMemoryError: Metaspace sbtUpdateCommand = "scalatestPlusScalaCheckJVM/update", @@ -165,80 +165,80 @@ object projects dependencies = List(scalatest, scalacheck) ) - val scalaXml = SbtCommunityProject( + lazy val scalaXml = SbtCommunityProject( project = "scala-xml", sbtTestCommand = "xml/test", sbtUpdateCommand = "xml/update" ) - val scopt = SbtCommunityProject( + lazy val scopt = SbtCommunityProject( project = "scopt", sbtTestCommand = "scoptJVM/compile", sbtUpdateCommand = "scoptJVM/update" ) - val scalap = SbtCommunityProject( + lazy val scalap = SbtCommunityProject( project = "scalap", sbtTestCommand = "scalap/compile", sbtUpdateCommand = "scalap/update" ) - val squants = SbtCommunityProject( + lazy val squants = SbtCommunityProject( project = "squants", sbtTestCommand = "squantsJVM/compile", sbtUpdateCommand = "squantsJVM/update" ) - val betterfiles = SbtCommunityProject( + lazy val betterfiles = SbtCommunityProject( project = "betterfiles", sbtTestCommand = "dotty-community-build/compile", sbtUpdateCommand = "dotty-community-build/update" ) - val ScalaPB = SbtCommunityProject( + lazy val ScalaPB = SbtCommunityProject( project = "ScalaPB", sbtTestCommand = "dotty-community-build/compile", sbtUpdateCommand = "dotty-community-build/update" ) - val minitest = SbtCommunityProject( + lazy val minitest = SbtCommunityProject( project = "minitest", sbtTestCommand = "dotty-community-build/compile", sbtUpdateCommand = "dotty-community-build/update" ) - val fastparse = SbtCommunityProject( + lazy val fastparse = SbtCommunityProject( project = "fastparse", sbtTestCommand = "dotty-community-build/compile;dotty-community-build/test:compile", sbtUpdateCommand = "dotty-community-build/update" ) - val stdLib213 = SbtCommunityProject( + lazy val stdLib213 = SbtCommunityProject( project = "stdLib213", sbtTestCommand = "library/compile", sbtUpdateCommand = "library/update", extraSbtArgs = List("-Dscala.build.compileWithDotty=true") ) - val shapeless = SbtCommunityProject( + lazy val shapeless = SbtCommunityProject( project = "shapeless", sbtTestCommand = "test", sbtUpdateCommand = "update" ) - val xmlInterpolator = SbtCommunityProject( + lazy val xmlInterpolator = SbtCommunityProject( project = "xml-interpolator", sbtTestCommand = "test", sbtUpdateCommand = "update" ) - val semanticdb = SbtCommunityProject( + lazy val semanticdb = SbtCommunityProject( project = "semanticdb", sbtTestCommand = "test:compile", sbtUpdateCommand = "update" ) - val effpi = SbtCommunityProject( + lazy val effpi = SbtCommunityProject( project = "effpi", // We set `useEffpiPlugin := false` because we don't want to run their // compiler plugin since it relies on external binaries (from the model From 6e90fe4b232eb4a7131177252edd218a4e47bf35 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Wed, 27 Nov 2019 18:12:56 +0100 Subject: [PATCH 3/3] Make sbt publish command use its base command as well So that the correct Dotty version ends up in scope --- .../scala/dotty/communitybuild/CommunityBuildTest.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index f0e316952e74..3d5915ed3448 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -87,11 +87,12 @@ final case class MillCommunityProject(project: String, baseCommand: String, final case class SbtCommunityProject(project: String, sbtTestCommand: String, sbtUpdateCommand: String, extraSbtArgs: List[String] = Nil, - dependencies: List[CommunityProject] = Nil, publishCommand: String = null) extends CommunityProject + dependencies: List[CommunityProject] = Nil, sbtPublishCommand: String = null) extends CommunityProject override val binaryName: String = "sbt" private val baseCommand = s";clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! " override val testCommand = s"$baseCommand$sbtTestCommand" override val updateCommand = s"$baseCommand$sbtUpdateCommand" + override val publishCommand = s"$baseCommand$sbtPublishCommand" override val runCommandsArgs: List[String] = // Run the sbt command with the compiler version and sbt plugin set in the build @@ -147,21 +148,21 @@ object projects project = "scalacheck", sbtTestCommand = "jvm/test", sbtUpdateCommand = "jvm/test:update", - publishCommand = ";set jvm/publishArtifact in (Compile, packageDoc) := false ;jvm/publishLocal" + sbtPublishCommand = ";set jvm/publishArtifact in (Compile, packageDoc) := false ;jvm/publishLocal" ) lazy val scalatest = SbtCommunityProject( project = "scalatest", sbtTestCommand = ";scalacticDotty/clean;scalacticTestDotty/test;scalatestTestDotty/test", sbtUpdateCommand = "scalatest/update", - publishCommand = ";scalacticDotty/publishLocal; scalatestDotty/publishLocal" + sbtPublishCommand = ";scalacticDotty/publishLocal; scalatestDotty/publishLocal" ) lazy val scalatestplusScalacheck = SbtCommunityProject( project = "scalatestplus-scalacheck", sbtTestCommand = "scalatestPlusScalaCheckJVM/compile", // TODO: compile only because tests are prone to java.lang.OutOfMemoryError: Metaspace sbtUpdateCommand = "scalatestPlusScalaCheckJVM/update", - publishCommand = "scalatestPlusScalaCheckJVM/publishLocal", + sbtPublishCommand = "scalatestPlusScalaCheckJVM/publishLocal", dependencies = List(scalatest, scalacheck) )