-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect colliding cross module values (#2984)
Also add an implicit `ToSegements[os.SubPath]` to accept `os.SubPath` as values in cross modules. Fix #2835 Pull request: #2984
- Loading branch information
Showing
4 changed files
with
68 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import mill._ | ||
|
||
object foo extends Cross[Foo]( | ||
(Seq("a", "b"), Seq("c")), | ||
(Seq("a"), Seq("b", "c")) | ||
) | ||
trait Foo extends Cross.Module2[Seq[String], Seq[String]] |
19 changes: 19 additions & 0 deletions
19
integration/failure/cross-collisions/test/src/CrossCollisionsTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package mill.integration | ||
|
||
import utest._ | ||
|
||
object CrossCollisionsTests extends IntegrationTestSuite { | ||
val tests: Tests = Tests { | ||
initWorkspace() | ||
|
||
test("detect-collision") { | ||
val res = evalStdout("resolve", "foo._") | ||
assert(!res.isSuccess) | ||
assert( | ||
res.err.contains( | ||
"Cross module millbuild.build#foo contains colliding cross values: List(List(a, b), List(c)) and List(List(a), List(b, c))" | ||
) | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters