diff options
Diffstat (limited to 'scalalib/test/src')
-rw-r--r-- | scalalib/test/src/mill/scalalib/HelloWorldTests.scala | 37 | ||||
-rw-r--r-- | scalalib/test/src/mill/scalalib/publish/IvyTests.scala | 14 |
2 files changed, 44 insertions, 7 deletions
diff --git a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala index 74078221..d6980314 100644 --- a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala +++ b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala @@ -98,6 +98,24 @@ object HelloWorldTests extends TestSuite { override def ivyDeps = Agg(ivy"com.lihaoyi::sourcecode:0.1.4") } } + + object HelloWorldTypeLevel extends HelloBase{ + object foo extends ScalaModule { + def scalaVersion = "2.11.8" + override def mapDependencies(d: coursier.Dependency) = { + val artifacts = Set("scala-library", "scala-compiler", "scala-reflect") + if (d.module.organization != "org.scala-lang" || !artifacts(d.module.name)) d + else d.copy(module = d.module.copy(organization = "org.typelevel")) + } + + def ivyDeps = Agg( + ivy"com.github.julien-truffaut::monocle-macro::1.4.0" + ) + def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg( + ivy"org.scalamacros:::paradise:2.1.0" + ) + } + } val resourcePath = pwd / 'scalalib / 'test / 'resources / "hello-world" def jarMainClass(jar: JarFile): Option[String] = { @@ -438,6 +456,25 @@ object HelloWorldTests extends TestSuite { !result2.exists(_.path.last == "sourcecode_2.12-0.1.3.jar") ) } + 'typeLevel - workspaceTest(HelloWorldTypeLevel){ eval => + val classPathsToCheck = Seq( + HelloWorldTypeLevel.foo.runClasspath, + HelloWorldTypeLevel.foo.ammoniteReplClasspath, + HelloWorldTypeLevel.foo.compileClasspath + ) + for(cp <- classPathsToCheck){ + val Right((result, _)) = eval.apply(cp) + assert( + // Make sure every relevant piece org.scala-lang has been substituted for org.typelevel + !result.map(_.toString).exists(x => + x.contains("scala-lang") && + (x.contains("scala-library") || x.contains("scala-compiler") || x.contains("scala-reflect")) + ), + result.map(_.toString).exists(x => x.contains("typelevel") && x.contains("scala-library")) + + ) + } + } } diff --git a/scalalib/test/src/mill/scalalib/publish/IvyTests.scala b/scalalib/test/src/mill/scalalib/publish/IvyTests.scala index 0f275dd9..d187f969 100644 --- a/scalalib/test/src/mill/scalalib/publish/IvyTests.scala +++ b/scalalib/test/src/mill/scalalib/publish/IvyTests.scala @@ -26,9 +26,9 @@ object IvyTests extends TestSuite { 'topLevel - { val info = singleNode(fullIvy \ "info") assert( - singleAttr(info, "organisation") == artifact.group - , singleAttr(info, "module") == artifact.id - , singleAttr(info, "revision") == artifact.version + singleAttr(info, "organisation") == artifact.group, + singleAttr(info, "module") == artifact.id, + singleAttr(info, "revision") == artifact.version ) } @@ -40,10 +40,10 @@ object IvyTests extends TestSuite { dependencies.zipWithIndex.foreach { case (dep, index) => assert( - singleAttr(dep, "org") == ivyDeps(index).artifact.group - , singleAttr(dep, "name") == ivyDeps(index).artifact.id - , singleAttr(dep, "rev") == ivyDeps(index).artifact.version - , (dep \ "exclude").zipWithIndex forall { case (exclude, j) => + singleAttr(dep, "org") == ivyDeps(index).artifact.group, + singleAttr(dep, "name") == ivyDeps(index).artifact.id, + singleAttr(dep, "rev") == ivyDeps(index).artifact.version, + (dep \ "exclude").zipWithIndex forall { case (exclude, j) => singleAttr(exclude, "org") == ivyDeps(index).exclusions(j)._1 && singleAttr(exclude, "name") == ivyDeps(index).exclusions(j)._2 } |