Skip to content

Commit

Permalink
Omit the suffix in artifactName for cross modules (#953)
Browse files Browse the repository at this point in the history
Pull request: #953
  • Loading branch information
joan38 committed Oct 21, 2020
1 parent 2f9b633 commit 81ae1dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions scalalib/src/MiscModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ trait CrossModuleBase extends ScalaModule {
def scalaVersion = T{ crossScalaVersion }

override def millSourcePath = super.millSourcePath / ammonite.ops.up
override def artifactName: T[String] = millModuleSegments.parts.init.mkString("-")
implicit def crossSbtModuleResolver: Resolver[CrossModuleBase] = new Resolver[CrossModuleBase]{
def resolve[V <: CrossModuleBase](c: Cross[V]): V = {
crossScalaVersion.split('.')
Expand Down
7 changes: 7 additions & 0 deletions scalalib/test/src/HelloWorldTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,13 @@ object HelloWorldTests extends TestSuite {
}
}

'artifactNameCross - {
workspaceTest(CrossHelloWorld) { eval =>
val Right((artifactName, _)) = eval.apply(CrossHelloWorld.core("2.13.1").artifactName)
assert(artifactName == "core")
}
}

'runMain - {
'runMainObject - workspaceTest(HelloWorld){eval =>
val runResult = eval.outPath / 'core / 'runMain / 'dest / "hello-mill"
Expand Down

0 comments on commit 81ae1dc

Please sign in to comment.