Support non-local Java compiler use in mixed Java/Scala compilation#2231
Support non-local Java compiler use in mixed Java/Scala compilation#2231lefou merged 2 commits intocom-lihaoyi:mainfrom
Conversation
|
Currently, we maintain two different caches, one for Scala/Mixed usage, and one for Java-only usage. But technically, the same Java compiler can be used in both setups. Thus we could avoid holding additional Javac instances in the Scala-compilers-cache, by retrieving the instance from the javac-only-cache first. |
ckipp01
left a comment
There was a problem hiding this comment.
O nice! It doesn't take much at all to support this. This is great!
I think we should work on this separately, as it probably involves further refactoring. We currently cache |
We need this feature to support SemanticDB generation (#2227) via a Java compiler plugin in mixed Scala/Java projects.
We already introduced non-local Java compilers in #1988. This change now also allows the use of a non-local Java compiler in mixed Java/Scala modules, if any
-Joption is given.As compilers are cached, I added the
hashCodeof the relevant runtimejavacOptionsto the cache key.I took the opportunity to remove non-relevant options from the existing Java compiler cache, to reduce the amount of cached compiler instances.
/CC @ckipp01 who implemented #1988.