Skip to content
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

Re-introduce Mill special handling of ivydeps, overhaul test classpath management to allow testing #2476

Merged
merged 26 commits into from
Apr 29, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
.
  • Loading branch information
lihaoyi committed Apr 28, 2023
commit 926ce9a00343e04c5fcbb9f18e9a3e00a6836d37
7 changes: 6 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ trait MillScalaModule extends ScalaModule with MillCoursierModule { outer =>
}

// Test setup
def testDep = T{ s"-DMILL_TEST_DEP_com.lihaoyi-${artifactName()}=${runClasspath().map(_.path).mkString(",")}" }
def testDepPaths = T{ runClasspath() }
def testDep = T{ s"-DMILL_TEST_DEP_com.lihaoyi-${artifactName()}=${testDepPaths.map(_.path).mkString(",")}" }
def testArgs: T[Seq[String]] = Seq(testDep())

def testIvyDeps: T[Agg[Dep]] = Agg(Deps.utest)
Expand Down Expand Up @@ -844,6 +845,7 @@ object scalajslib extends MillModule with BuildInfo {
}
object worker extends Cross[WorkerModule]("1")
class WorkerModule(scalajsWorkerVersion: String) extends MillInternalModule {
def testDepPaths = T{ Seq(compile().classes) }
override def moduleDeps = Seq(scalajslib.`worker-api`, main.client, main.api)
override def ivyDeps = Agg(
Deps.Scalajs_1.scalajsLinker,
Expand Down Expand Up @@ -961,6 +963,7 @@ object contrib extends MillModule {
object worker extends MillInternalModule {
override def compileModuleDeps = Seq(main.api)
override def moduleDeps = Seq(scoverage.api)
def testDepPaths = T{ Seq(compile().classes) }
override def compileIvyDeps = T {
Agg(
// compile-time only, need to provide the correct scoverage version at runtime
Expand All @@ -976,6 +979,7 @@ object contrib extends MillModule {
object worker2 extends MillInternalModule {
override def compileModuleDeps = Seq(main.api)
override def moduleDeps = Seq(scoverage.api)
def testDepPaths = T{ Seq(compile().classes) }
override def compileIvyDeps = T {
Agg(
// compile-time only, need to provide the correct scoverage version at runtime
Expand Down Expand Up @@ -1099,6 +1103,7 @@ object scalanativelib extends MillModule {
object worker extends Cross[WorkerModule]("0.4")
class WorkerModule(scalaNativeWorkerVersion: String)
extends MillInternalModule {
def testDepPaths = T{ Seq(compile().classes) }
override def moduleDeps = Seq(scalanativelib.`worker-api`)
override def ivyDeps = scalaNativeWorkerVersion match {
case "0.4" =>
Expand Down