From 57501fca3b6c2c64d32744e6d534b9de3a6674f6 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sat, 13 Jan 2018 13:00:21 -0800 Subject: Migrate most classpath-related code onto `Loose.OSet` abstraction, to enforce deduplication --- integration/src/test/resources/acyclic/build.sc | 9 ++++----- integration/src/test/resources/better-files/build.sc | 8 ++++---- integration/src/test/resources/jawn/build.sc | 12 ++++++------ .../test/scala/mill/integration/IntegrationTestSuite.scala | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) (limited to 'integration/src/test') diff --git a/integration/src/test/resources/acyclic/build.sc b/integration/src/test/resources/acyclic/build.sc index 66d64501..094893f5 100644 --- a/integration/src/test/resources/acyclic/build.sc +++ b/integration/src/test/resources/acyclic/build.sc @@ -1,9 +1,9 @@ import mill.Cross -import mill.scalalib.{SbtModule, PublishModule, Dep} +import mill.scalalib.{SbtModule, PublishModule, Dep, CrossSbtModule} import mill.scalalib.publish.{PomSettings, License, Developer, SCM} object acyclic extends Cross[AcyclicModule]("2.10.6", "2.11.8", "2.12.3", "2.12.4") -class AcyclicModule(crossVersion: String) extends SbtModule with PublishModule { +class AcyclicModule(val crossScalaVersion: String) extends CrossSbtModule with PublishModule { def basePath = super.basePath / ammonite.ops.up def artifactName = "acyclic" def publishVersion = "0.1.7" @@ -24,13 +24,12 @@ class AcyclicModule(crossVersion: String) extends SbtModule with PublishModule { ) ) - def scalaVersion = crossVersion - def ivyDeps = Seq( + def ivyDeps = OSet( Dep.Java("org.scala-lang", "scala-compiler", scalaVersion()) ) object test extends Tests{ def forkWorkingDir = ammonite.ops.pwd / 'target / 'workspace / 'acyclic - def ivyDeps = Seq( + def ivyDeps = OSet( Dep("com.lihaoyi", "utest", "0.6.0") ) def testFramework = "utest.runner.Framework" diff --git a/integration/src/test/resources/better-files/build.sc b/integration/src/test/resources/better-files/build.sc index cd6cac04..fe11f1b8 100644 --- a/integration/src/test/resources/better-files/build.sc +++ b/integration/src/test/resources/better-files/build.sc @@ -54,7 +54,7 @@ trait BetterFilesModule extends SbtModule{ def projectDeps = if (this == core.test) super.projectDeps else super.projectDeps ++ Seq(core.test) - def ivyDeps = Seq(Dep("org.scalatest", "scalatest", "3.0.4")) + def ivyDeps = OSet(Dep("org.scalatest", "scalatest", "3.0.4")) def testFramework = "org.scalatest.tools.Framework" } } @@ -63,17 +63,17 @@ object core extends BetterFilesModule object akka extends BetterFilesModule{ def projectDeps = Seq(core) - def ivyDeps = Seq(Dep("com.typesafe.akka", "akka-actor", "2.5.6")) + def ivyDeps = OSet(Dep("com.typesafe.akka", "akka-actor", "2.5.6")) } object shapeless extends BetterFilesModule{ def projectDeps = Seq(core) - def ivyDeps = Seq(Dep("com.chuusai", "shapeless", "2.3.2")) + def ivyDeps = OSet(Dep("com.chuusai", "shapeless", "2.3.2")) } object benchmarks extends BetterFilesModule{ def projectDeps = Seq(core) - def ivyDeps = Seq( + def ivyDeps = OSet( Dep.Java("commons-io", "commons-io", "2.5") // "fastjavaio" % "fastjavaio" % "1.0" from "https://github.com/williamfiset/FastJavaIO/releases/download/v1.0/fastjavaio.jar" ) diff --git a/integration/src/test/resources/jawn/build.sc b/integration/src/test/resources/jawn/build.sc index 8b830f70..a90d93b5 100644 --- a/integration/src/test/resources/jawn/build.sc +++ b/integration/src/test/resources/jawn/build.sc @@ -4,7 +4,7 @@ import mill.scalalib.{Dep, TestModule, Module} object jawn extends Cross[JawnModule]("2.10.6", "2.11.11", "2.12.3") class JawnModule(crossVersion: String) extends mill.Module{ - override def basePath = super.basePath / ammonite.ops.up + override def basePath = super.basePath / ammonite.ops.up / ammonite.ops.up trait JawnModule extends scalalib.SbtModule{ def scalaVersion = crossVersion @@ -16,7 +16,7 @@ class JawnModule(crossVersion: String) extends mill.Module{ def testProjectDeps: Seq[TestModule] = Nil object test extends Tests{ def projectDeps = super.projectDeps ++ testProjectDeps - def ivyDeps = Seq( + def ivyDeps = OSet( Dep("org.scalatest", "scalatest", "3.0.3"), Dep("org.scalacheck", "scalacheck", "1.13.5") ) @@ -35,7 +35,7 @@ class JawnModule(crossVersion: String) extends mill.Module{ } class Support(ivyDeps0: Dep*)(implicit ctx: mill.Module.Ctx) extends JawnModule{ def projectDeps = Seq[Module](parser) - def ivyDeps = ivyDeps0 + def ivyDeps = OSet.from(ivyDeps0) } object support extends mill.Module{ object argonaut extends Support(Dep("io.argonaut", "argonaut", "6.2")) @@ -44,9 +44,9 @@ class JawnModule(crossVersion: String) extends mill.Module{ object play extends Support(){ def ivyDeps = mill.T{ scalaBinaryVersion() match{ - case "2.10" => Seq(Dep("com.typesafe.play", "play-json", "2.4.11")) - case "2.11" => Seq(Dep("com.typesafe.play", "play-json", "2.5.15")) - case _ => Seq(Dep("com.typesafe.play", "play-json", "2.6.0")) + case "2.10" => OSet(Dep("com.typesafe.play", "play-json", "2.4.11")) + case "2.11" => OSet(Dep("com.typesafe.play", "play-json", "2.5.15")) + case _ => OSet(Dep("com.typesafe.play", "play-json", "2.6.0")) } } } diff --git a/integration/src/test/scala/mill/integration/IntegrationTestSuite.scala b/integration/src/test/scala/mill/integration/IntegrationTestSuite.scala index ba4415fa..82f4de72 100644 --- a/integration/src/test/scala/mill/integration/IntegrationTestSuite.scala +++ b/integration/src/test/scala/mill/integration/IntegrationTestSuite.scala @@ -8,7 +8,7 @@ import utest._ abstract class IntegrationTestSuite(repoKey: String, workspaceSlug: String) extends TestSuite{ val workspacePath = pwd / 'target / 'workspace / workspaceSlug val buildFilePath = pwd / 'integration / 'src / 'test / 'resources / workspaceSlug - val stdOutErr = new PrintStream(new ByteArrayOutputStream()) + val stdOutErr = System.out//new PrintStream(new ByteArrayOutputStream()) val stdIn = new ByteArrayInputStream(Array()) val runner = new mill.main.MainRunner( ammonite.main.Cli.Config(wd = workspacePath), false, -- cgit v1.2.3