tindzk / seed

Build tool for Scala projects
https://tindzk.github.io/seed/
Apache License 2.0
238 stars 13 forks source link

ArtefactResolution: Fix resolution of test modules #85

Closed tindzk closed 4 years ago

tindzk commented 4 years ago

ArtefactResolution: Fix resolution of test modules

When the base module's targets are overridden in the test module, the following exception may occur during artefact resolution:

Exception in thread "main" java.util.NoSuchElementException: None.get
    at scala.None$.get(Option.scala:529)
    at scala.None$.get(Option.scala:527)
    at seed.artefact.ArtefactResolution$.$anonfun$runtimeResolution$1(ArtefactResolution.scala:388)
    at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
    at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:234)
    at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:468)
    at scala.collection.TraversableLike.map(TraversableLike.scala:238)
    at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
    at scala.collection.AbstractTraversable.map(Traversable.scala:108)
    at seed.artefact.ArtefactResolution$.runtimeResolution(ArtefactResolution.scala:380)
    at seed.cli.Generate$.ui(Generate.scala:38)
    at seed.Cli$.main(Cli.scala:392)
    at seed.Cli.main(Cli.scala)

The exception only happens when the test module's targets are a subset of the base module.

This regression was introduced in ee2e274bc5d576a03532b54c72bd9b3a3954a574.