Skip to content

Add ujson and the scalatest-scalacheck bridge to the community build #7632

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 3 commits into from
Nov 28, 2019
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
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions community-build/community-projects/upickle
Submodule upickle added at e46ab9
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +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) 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 publishCommand = null
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
Expand All @@ -104,126 +104,142 @@ 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 intent = SbtCommunityProject(
lazy val ujson = MillCommunityProject(
project = "upickle",
baseCommand = s"ujson.jvm[$compilerVersion]",
dependencies = List(scalatest, scalacheck, scalatestplusScalacheck)
)

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"
sbtUpdateCommand = "jvm/test:update",
sbtPublishCommand = ";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"
sbtUpdateCommand = "scalatest/update",
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",
sbtPublishCommand = "scalatestPlusScalaCheckJVM/publishLocal",
dependencies = List(scalatest, scalacheck)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency on scalatest and scalacheck is not effective, if the versions don't match in dependency specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fine FTTB. Assuming that specifying the correct dependency is the responsibility of the one adding a new project to the build, and that these custom dependencies are local, the test would just fail to resolve the dependencies if they are misspecified in any of the concerned projects.

)

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
Expand Down Expand Up @@ -300,6 +316,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()
Expand All @@ -311,6 +328,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()
Expand Down