Skip to content

Commit

Permalink
Add test case to catch duplicated items, and fixed the impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Aug 9, 2024
1 parent e51f88f commit ed681b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions integration/ide/gen-idea/repo/hello-idea/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ object moduleD extends JavaModule {
override def compileModuleDeps = Seq(moduleC)
}
object moduleE extends JavaModule
object moduleF extends JavaModule {
override def compileModuleDeps = Seq(moduleC)
override def moduleDeps = Seq(moduleB, moduleA)
}
1 change: 1 addition & 0 deletions integration/ide/gen-idea/repo/hello-idea/idea/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<module fileurl="file://$PROJECT_DIR$/.idea/mill_modules/modulec.iml" filepath="$PROJECT_DIR$/.idea/mill_modules/modulec.iml"/>
<module fileurl="file://$PROJECT_DIR$/.idea/mill_modules/moduled.iml" filepath="$PROJECT_DIR$/.idea/mill_modules/moduled.iml"/>
<module fileurl="file://$PROJECT_DIR$/.idea/mill_modules/modulee.iml" filepath="$PROJECT_DIR$/.idea/mill_modules/modulee.iml"/>
<module fileurl="file://$PROJECT_DIR$/.idea/mill_modules/modulef.iml" filepath="$PROJECT_DIR$/.idea/mill_modules/modulef.iml"/>
</modules>
</component>
</project>
3 changes: 2 additions & 1 deletion scalalib/src/mill/scalalib/internal/ModuleUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ object ModuleUtils {
throw new BuildScriptException(msg)
}
rec(
seenModules ++ Seq(cand),
if (seenModules.contains(cand)) seenModules
else { seenModules ++ Seq(cand) },
toAnalyze = ((cand :: trace, deps(cand).toList)) :: (trace, remaining) :: rest
)
}
Expand Down

0 comments on commit ed681b3

Please sign in to comment.