From de96a55c3267bb1508e77a6815007807e3fd73fb Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 14 Jan 2018 04:25:56 -0800 Subject: Some tweaks to get tests passing... --- .../test/scala/mill/scalalib/HelloWorldTests.scala | 103 ++++++++++----------- 1 file changed, 51 insertions(+), 52 deletions(-) (limited to 'scalalib/src') diff --git a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala index 0f525b38..657ddc9e 100644 --- a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala +++ b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala @@ -6,7 +6,6 @@ import ammonite.ops._ import ammonite.ops.ImplicitWd._ import mill._ import mill.define.Target - import mill.eval.{Evaluator, Result} import mill.scalalib.publish._ import mill.util.{TestEvaluator, TestUtil} @@ -15,66 +14,66 @@ import utest._ import scala.collection.JavaConverters._ -trait HelloWorldModule extends scalalib.Module { - def scalaVersion = "2.12.4" - def basePath = HelloWorldTests.workingSrcPath -} -object HelloWorld extends TestUtil.BaseModule with HelloWorldModule -object CrossHelloWorld extends TestUtil.BaseModule { - object cross extends Cross[HelloWorldCross]("2.10.6", "2.11.11", "2.12.3", "2.12.4") - class HelloWorldCross(v: String) extends HelloWorldModule { - def scalaVersion = v +object HelloWorldTests extends TestSuite { + trait HelloWorldModule extends scalalib.Module { + def scalaVersion = "2.12.4" + def basePath = HelloWorldTests.workingSrcPath } -} -object HelloWorldWithMain extends TestUtil.BaseModule with HelloWorldModule { - def mainClass = Some("Main") -} + object HelloWorld extends TestUtil.BaseModule with HelloWorldModule + object CrossHelloWorld extends TestUtil.BaseModule { + object cross extends Cross[HelloWorldCross]("2.10.6", "2.11.11", "2.12.3", "2.12.4") + class HelloWorldCross(v: String) extends HelloWorldModule { + def scalaVersion = v + } + } -object HelloWorldWithMainAssembly extends TestUtil.BaseModule with HelloWorldModule { - def mainClass = Some("Main") - def assembly = T{ - mill.modules.Jvm.createAssembly( - runClasspath().map(_.path).filter(exists), - prependShellScript = prependShellScript(), - mainClass = mainClass() - ) + object HelloWorldWithMain extends TestUtil.BaseModule with HelloWorldModule { + def mainClass = Some("Main") } -} -object HelloWorldWarnUnused extends TestUtil.BaseModule with HelloWorldModule { - def scalacOptions = T(Seq("-Ywarn-unused")) -} + object HelloWorldWithMainAssembly extends TestUtil.BaseModule with HelloWorldModule { + def mainClass = Some("Main") + def assembly = T{ + mill.modules.Jvm.createAssembly( + runClasspath().map(_.path).filter(exists), + prependShellScript = prependShellScript(), + mainClass = mainClass() + ) + } + } -object HelloWorldFatalWarnings extends TestUtil.BaseModule with HelloWorldModule { - def scalacOptions = T(Seq("-Ywarn-unused", "-Xfatal-warnings")) -} + object HelloWorldWarnUnused extends TestUtil.BaseModule with HelloWorldModule { + def scalacOptions = T(Seq("-Ywarn-unused")) + } -object HelloWorldWithPublish extends TestUtil.BaseModule with HelloWorldModule with PublishModule { - def artifactName = "hello-world" - def publishVersion = "0.0.1" - - def pomSettings = PomSettings( - organization = "com.lihaoyi", - description = "hello world ready for real world publishing", - url = "https://github.com/lihaoyi/hello-world-publish", - licenses = Seq( - License("Apache License, Version 2.0", - "http://www.apache.org/licenses/LICENSE-2.0")), - scm = SCM( - "https://github.com/lihaoyi/hello-world-publish", - "scm:git:https://github.com/lihaoyi/hello-world-publish" - ), - developers = - Seq(Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")) - ) -} -object HelloWorldScalaOverride extends TestUtil.BaseModule with HelloWorldModule { - override def scalaVersion: Target[String] = "2.11.11" -} -object HelloWorldTests extends TestSuite { + object HelloWorldFatalWarnings extends TestUtil.BaseModule with HelloWorldModule { + def scalacOptions = T(Seq("-Ywarn-unused", "-Xfatal-warnings")) + } + object HelloWorldWithPublish extends TestUtil.BaseModule with HelloWorldModule with PublishModule { + def artifactName = "hello-world" + def publishVersion = "0.0.1" + + def pomSettings = PomSettings( + organization = "com.lihaoyi", + description = "hello world ready for real world publishing", + url = "https://github.com/lihaoyi/hello-world-publish", + licenses = Seq( + License("Apache License, Version 2.0", + "http://www.apache.org/licenses/LICENSE-2.0")), + scm = SCM( + "https://github.com/lihaoyi/hello-world-publish", + "scm:git:https://github.com/lihaoyi/hello-world-publish" + ), + developers = + Seq(Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")) + ) + } + object HelloWorldScalaOverride extends TestUtil.BaseModule with HelloWorldModule { + override def scalaVersion: Target[String] = "2.11.11" + } val srcPath = pwd / 'scalalib / 'src / 'test / 'resources / "hello-world" val basePath = pwd / 'target / 'workspace / "hello-world" val workingSrcPath = basePath / 'src -- cgit v1.2.3