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

Removed inner Tests traits to avoid no longer supported shadowing #2558

Merged
merged 10 commits into from
May 30, 2023
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
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ object main extends MillPublicScalaModule with BuildInfo{
def buildInfoMembers = Seq(BuildInfo.Value("millVersion", millVersion(), "Mill version."))
def ivyDeps = Agg(Deps.junixsocket)

object test extends Tests with TestModule.Junit4 {
object test extends JavaModuleTests with TestModule.Junit4 {
def ivyDeps = Agg(Deps.junitInterface, Deps.lambdaTest)
}
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/bloop/test/src/mill/contrib/bloop/BloopTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object BloopTests extends TestSuite {
ivy"org.postgresql:postgresql:42.3.3"
)

object test extends super.Tests with TestModule.Utest
object test extends ScalaModuleTests with TestModule.Utest
}

object scalaModule2 extends scalalib.ScalaModule {
Expand Down
2 changes: 1 addition & 1 deletion contrib/playlib/src/mill/playlib/PlayModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import mill.scalalib._
import mill.{Agg, Args, T}

trait PlayApiModule extends Dependencies with Router with Server {
trait PlayTests extends super.Tests with TestModule.ScalaTest {
trait PlayTests extends ScalaModuleTests with TestModule.ScalaTest {
override def ivyDeps = T {
val scalatestPlusPlayVersion = playMinorVersion() match {
case Versions.PLAY_2_6 => "3.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule =>
override def skipIdea = outer.skipIdea
}

trait ScoverageTests extends outer.Tests {
trait ScoverageTests extends ScalaModuleTests {
override def upstreamAssemblyClasspath = T {
super.upstreamAssemblyClasspath() ++
resolveDeps(T.task {
Expand Down
4 changes: 2 additions & 2 deletions contrib/testng/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use TestNG as test framework, you need to add it to the `TestModule.testFrame
import mill.scalalib._

object project extends ScalaModule {
object test extends Tests {
object test extends ScalaModuleTests {
def testFramework = "mill.testng.TestNGFramework"
def ivyDeps = super.ivyDeps ++ Agg(
ivy"com.lihaoyi:mill-contrib-testng:${mill.BuildInfo.millVersion}"
Expand All @@ -29,6 +29,6 @@ You can also use the more convenient `TestModule.TestNg` trait.
import mill.scalalib._

object project extends ScalaModule {
object test extends Tests with TestModule.TestNg
object test extends ScalaModuleTests with TestModule.TestNg
}
----
2 changes: 1 addition & 1 deletion contrib/testng/test/src/mill/testng/TestNGTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object TestNGTests extends TestSuite {
override def millSourcePath: os.Path =
TestUtil.getSrcPathBase() / millOuterCtx.enclosing.split('.')

object test extends super.Tests {
object test extends JavaModuleTests {
def testngClasspath = T {
millProjectModule(
"mill-contrib-testng",
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/Library_Dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ There is no special test scope in Mill.
[source,scala]
----
object main extends JavaModule {
object test extends Tests {
object test extends JavaModuleTests {
def ivyDeps = Agg(
ivy"org.qos.logback:logback-classic:1.2.3"
)
Expand Down
2 changes: 1 addition & 1 deletion example/basic/1-simple-scala/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object foo extends RootModule with ScalaModule {
ivy"com.lihaoyi::mainargs:0.4.0"
)

object test extends Tests {
object test extends ScalaModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand Down
4 changes: 2 additions & 2 deletions example/basic/3-multi-module/build.sc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mill._, scalalib._

trait MyModule extends ScalaModule{
trait MyModule extends ScalaModule {
def scalaVersion = "2.13.8"
}

Expand All @@ -9,7 +9,7 @@ object foo extends MyModule {
def ivyDeps = Agg(ivy"com.lihaoyi::mainargs:0.4.0")
}

object bar extends MyModule{
object bar extends MyModule {
def ivyDeps = Agg(ivy"com.lihaoyi::scalatags:0.8.2")
}

Expand Down
4 changes: 2 additions & 2 deletions example/basic/4-builtin-commands/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mill._, scalalib._

trait MyModule extends ScalaModule{
trait MyModule extends ScalaModule {
def scalaVersion = "2.13.8"
}

Expand All @@ -11,7 +11,7 @@ object foo extends MyModule {
def ivyDeps = Agg(ivy"com.lihaoyi::mainargs:0.4.0")
}

object bar extends MyModule{
object bar extends MyModule {
def ivyDeps = Agg(ivy"com.lihaoyi::scalatags:0.8.2")
}

Expand Down
6 changes: 3 additions & 3 deletions example/scalabuilds/10-scala-realistic/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ trait MyModule extends PublishModule {
)
}

trait MyScalaModule extends MyModule with CrossScalaModule{
trait MyScalaModule extends MyModule with CrossScalaModule {
def ivyDeps = Agg(ivy"com.lihaoyi::scalatags:0.12.0")
object test extends Tests {
object test extends ScalaModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand All @@ -27,7 +27,7 @@ object foo extends Cross[FooModule](scalaVersions)
trait FooModule extends MyScalaModule {
def moduleDeps = Seq(bar(), qux)

def generatedSources = T{
def generatedSources = T {
os.write(
T.dest / "Version.scala",
s"""package foo
Expand Down
4 changes: 2 additions & 2 deletions example/scalabuilds/4-nested-modules/build.sc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import mill._, scalalib._

trait MyModule extends ScalaModule{
trait MyModule extends ScalaModule {
def scalaVersion = "2.13.8"
def ivyDeps = Agg(
ivy"com.lihaoyi::scalatags:0.8.2",
ivy"com.lihaoyi::mainargs:0.4.0"
)
}

object foo extends MyModule{
object foo extends MyModule {
def moduleDeps = Seq(bar, qux)

object bar extends MyModule
Expand Down
8 changes: 4 additions & 4 deletions example/scalabuilds/5-test-suite/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mill._, scalalib._

object foo extends ScalaModule {
def scalaVersion = "2.13.8"
object test extends Tests {
object test extends ScalaModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand Down Expand Up @@ -47,7 +47,7 @@ compiling 1 Scala source...
object bar extends ScalaModule {
def scalaVersion = "2.13.8"

object test extends Tests with TestModule.Utest {
object test extends ScalaModuleTests with TestModule.Utest {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
}
}
Expand Down Expand Up @@ -87,10 +87,10 @@ object bar extends ScalaModule {
object qux extends ScalaModule {
def scalaVersion = "2.13.8"

object test extends Tests with TestModule.Utest {
object test extends ScalaModuleTests with TestModule.Utest {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
}
object integration extends Tests with TestModule.Utest {
object integration extends ScalaModuleTests with TestModule.Utest {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/scalabuilds/8-sbt-compat-modules/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import mill._, scalalib._

object foo extends SbtModule {
def scalaVersion = "2.13.8"
object test extends Tests {
object test extends SbtModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
}


object bar extends Cross[BarModule]("2.12.17", "2.13.8")
trait BarModule extends CrossSbtModule{
object test extends Tests {
trait BarModule extends CrossSbtModule {
object test extends CrossSbtModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand Down
2 changes: 1 addition & 1 deletion example/scalabuilds/9-java-modules/build.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mill._, scalalib._

trait MyJavaModule extends JavaModule{
object test extends Tests with TestModule.Junit4
object test extends JavaModuleTests with TestModule.Junit4
}

object foo extends MyJavaModule{
Expand Down
4 changes: 2 additions & 2 deletions example/scalamodule/4-test-deps/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object qux extends ScalaModule {
def scalaVersion = "2.13.8"
def moduleDeps = Seq(baz)

object test extends Tests {
object test extends ScalaModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
def moduleDeps = super.moduleDeps ++ Seq(baz.test)
Expand All @@ -26,7 +26,7 @@ object qux extends ScalaModule {
object baz extends ScalaModule {
def scalaVersion = "2.13.8"

object test extends Tests {
object test extends ScalaModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand Down
4 changes: 2 additions & 2 deletions example/web/1-todo-webapp/build.sc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import mill._, scalalib._

object app extends RootModule with ScalaModule{
object app extends RootModule with ScalaModule {
def scalaVersion = "2.13.8"
def ivyDeps = Agg(
ivy"com.lihaoyi::cask:0.9.1",
ivy"com.lihaoyi::scalatags:0.12.0"
)

object test extends Tests{
object test extends ScalaModuleTests {
def testFramework = "utest.runner.Framework"

def ivyDeps = Agg(
Expand Down
4 changes: 2 additions & 2 deletions example/web/2-webapp-cache-busting/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import mill._, scalalib._
import java.util.Arrays

object app extends RootModule with ScalaModule{
object app extends RootModule with ScalaModule {
def scalaVersion = "2.13.8"
def ivyDeps = Agg(
ivy"com.lihaoyi::cask:0.9.1",
Expand All @@ -26,7 +26,7 @@ object app extends RootModule with ScalaModule{
Seq(PathRef(T.dest))
}

object test extends Tests{
object test extends ScalaModuleTests {
def testFramework = "utest.runner.Framework"
def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
Expand Down
2 changes: 1 addition & 1 deletion example/web/3-scalajs-module/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object foo extends ScalaJSModule {
def scalaVersion = "2.13.8"
def scalaJSVersion = "1.13.0"
def ivyDeps = Agg(ivy"com.lihaoyi::scalatags::0.12.0")
object test extends Tests {
object test extends ScalaJSModuleTests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.11")
def testFramework = "utest.runner.Framework"
}
Expand Down
6 changes: 3 additions & 3 deletions example/web/4-webapp-scalajs/build.sc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import mill._, scalalib._, scalajslib._

object app extends RootModule with ScalaModule{
object app extends RootModule with ScalaModule {

def scalaVersion = "2.13.8"
def ivyDeps = Agg(
ivy"com.lihaoyi::cask:0.9.1",
ivy"com.lihaoyi::scalatags:0.12.0"
)

def resources = T{
def resources = T {
os.makeDir(T.dest / "webapp")
val jsPath = client.fastLinkJS().dest.path
// Move main.js[.map]into the proper filesystem position
Expand All @@ -18,7 +18,7 @@ object app extends RootModule with ScalaModule{
super.resources() ++ Seq(PathRef(T.dest))
}

object test extends Tests{
object test extends ScalaModuleTests {
def testFramework = "utest.runner.Framework"

def ivyDeps = Agg(
Expand Down
8 changes: 4 additions & 4 deletions example/web/5-webapp-scalajs-shared/build.sc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import mill._, scalalib._, scalajslib._

trait AppScalaModule extends ScalaModule{
trait AppScalaModule extends ScalaModule {
def scalaVersion = "2.13.8"
}

trait AppScalaJSModule extends AppScalaModule with ScalaJSModule {
def scalaJSVersion = "1.13.0"
}

object app extends RootModule with AppScalaModule{
object app extends RootModule with AppScalaModule {
def moduleDeps = Seq(shared.jvm)
def ivyDeps = Agg(ivy"com.lihaoyi::cask:0.9.1")

Expand All @@ -20,7 +20,7 @@ object app extends RootModule with AppScalaModule{
super.resources() ++ Seq(PathRef(T.dest))
}

object test extends Tests{
object test extends ScalaModuleTests {
def testFramework = "utest.runner.Framework"

def ivyDeps = Agg(
Expand All @@ -29,7 +29,7 @@ object app extends RootModule with AppScalaModule{
)
}

object shared extends Module{
object shared extends Module {
trait SharedModule extends AppScalaModule with PlatformScalaModule {
def ivyDeps = Agg(
ivy"com.lihaoyi::scalatags::0.12.0",
Expand Down
22 changes: 11 additions & 11 deletions example/web/6-cross-version-platform-publishing/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ trait FooModule extends Cross.Module[String] {
)

def ivyDeps = Agg(ivy"com.lihaoyi::scalatags::0.12.0")
}

trait FooTestModule extends Tests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.11")
def testFramework = "utest.runner.Framework"
}
trait FooTestModule extends TestModule {
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.11")
def testFramework = "utest.runner.Framework"
}

trait SharedJS extends Shared with ScalaJSModule {
Expand All @@ -28,25 +28,25 @@ trait FooModule extends Cross.Module[String] {

object bar extends Module {
object jvm extends Shared{
object test extends Tests with FooTestModule
object test extends ScalaModuleTests with FooTestModule
}
object js extends SharedJS{
object test extends Tests with FooTestModule
object js extends SharedJS {
object test extends ScalaJSModuleTests with FooTestModule
}
}

object qux extends Module{
object jvm extends Shared{
object qux extends Module {
object jvm extends Shared {
def moduleDeps = Seq(bar.jvm)
def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.lihaoyi::upickle::3.0.0")

object test extends Tests with FooTestModule
object test extends ScalaModuleTests with FooTestModule
}

object js extends SharedJS {
def moduleDeps = Seq(bar.js)

object test extends Tests with FooTestModule
object test extends ScalaJSModuleTests with FooTestModule
}
}
}
Expand Down
Loading