Skip to content

Commit 24f4f88

Browse files
committed
community build: add support for testOnlyDependencies
This allows specifying dependencies that are needed only to build the test suite of a community build project. The evaluation of this list is delayed to permit what would otherwise be circular dependencies. The addition of this capability is motivated by recent versions of ScalaTest, which since version 3.2.4 has test-only dependencies on scalatestplus-junit and scalatestplus-testng, which in turn both depend on ScalaTest itself.
1 parent f3c1468 commit 24f4f88

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ sealed trait CommunityProject:
4040
val publishCommand: String
4141
val docCommand: String
4242
val dependencies: List[CommunityProject]
43+
val testOnlyDependencies: () => List[CommunityProject]
4344
val binaryName: String
4445
val runCommandsArgs: List[String] = Nil
4546
val requiresExperimental: Boolean
@@ -87,6 +88,7 @@ final case class MillCommunityProject(
8788
project: String,
8889
baseCommand: String,
8990
dependencies: List[CommunityProject] = Nil,
91+
testOnlyDependencies: () => List[CommunityProject] = () => Nil,
9092
ignoreDocs: Boolean = false,
9193
requiresExperimental: Boolean = false,
9294
) extends CommunityProject:
@@ -104,6 +106,7 @@ final case class SbtCommunityProject(
104106
sbtTestCommand: String,
105107
extraSbtArgs: List[String] = Nil,
106108
dependencies: List[CommunityProject] = Nil,
109+
testOnlyDependencies: () => List[CommunityProject] = () => Nil,
107110
sbtPublishCommand: String = null,
108111
sbtDocCommand: String = null,
109112
scalacOptions: List[String] = SbtCommunityProject.scalacOptions,

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ abstract class CommunityBuildTest:
2727
)
2828
return
2929
self.dependencies.foreach(_.publish())
30+
self.testOnlyDependencies().foreach(_.publish())
3031
suite.test(self)
3132

3233
/** Build the given project with the published local compiler and sbt plugin.

0 commit comments

Comments
 (0)