Closed cornerman closed 8 years ago
You could try writing a macro that inspects compilation arguments: https://github.com/scala/scala/blob/1706a37eb84ec252aea77bccebad3e48448534ad/src/compiler/scala/reflect/macros/contexts/Infrastructure.scala#L13. Then, the path to the compiler plugin will be compiled into executable code.
Thank you! That works, I have created a small macro that just returns the compilersettings. From there I can just filter all -Xplugin
options.
In a project, I want to expand macros in tests using
tools.reflect.toolbox
. In order to be able to use the paradise compiler plugin, I need to specify the-Xplugin
and-Xplugin-require
options when creating the toolbox. The latter option needs a path to the paradise.jar, currently I still use this code. This is a hardcoded path with a specific scala as well as paradise version.Is there a more generic way to require currently enabled compiler plugins or to get the path to their jar files?