-
Notifications
You must be signed in to change notification settings - Fork 246
Description
Describe the bug
For an sbt multi-project build which uses the ScroogeSBT autoplugin on a subproject, an unavoidable warning message (warn [Importer$] Expected to find just 1 match for ...
, introduced March 2020 with 9191deb) will be shown for every single .thrift
file found, with no possible way to configure the project to avoid that warning.
To Reproduce
Steps to reproduce the behavior:
- Create a sbt multi-project build, with ScroogeSBT disabled on all projects, except the subproject containing
.thrift
files insrc/main/thrift
- Execute
sbt compile
- See a warning for every
.thrift
file:
2020-11-26 12:43:26.379Z warn [Importer$] Expected to find just 1 match for /Users/roberto_tyley/code/ophan/event-model/src/main/thrift/device.thrift, but found 2, in DirImporter(/Users/roberto_tyley/code/ophan), DirImporter(/Users/roberto_tyley/code/ophan/event-model/src/main/thrift)
2020-11-26 12:43:26.394Z warn [Importer$] Expected to find just 1 match for /Users/roberto_tyley/code/ophan/event-model/src/main/thrift/device.thrift, but found 2, in DirImporter(/Users/roberto_tyley/code/ophan), DirImporter(/Users/roberto_tyley/code/ophan/event-model/src/main/thrift)
Expected behavior
Warnings should not be shown, or it should be at least possible to configure the sbt project in such a way that there are not two DirImporter
s for the same file. The number of warnings shown at the moment is heavily noisy, at least if you have many .thrift
files.
Environment
sbt v1.4.4, scrooge v20.10.0
Additional context
The warning was introduced with 9191deb. It's probably valid, but the fact that there are two paths found (the project root, and the path of the subproject src/main/thrift
dir) is because the root is hard-coded into the scrooge Compiler
class, and there's no way to turn it off:
val importer = Importer(new File(".")) +: Importer(config.includePaths.toSeq) |
...I've played the scroogeThriftIncludes
setting, and could not find any way to remove the warnings.
cc @mosesn