Skip to content

Use the first scalac-plugin.xml from the plugin classpath#8345

Merged
retronym merged 1 commit intoscala:2.12.xfrom
retronym:topic/plugin-classloader-tweak
Aug 19, 2019
Merged

Use the first scalac-plugin.xml from the plugin classpath#8345
retronym merged 1 commit intoscala:2.12.xfrom
retronym:topic/plugin-classloader-tweak

Conversation

@retronym
Copy link
Member

@retronym retronym commented Aug 19, 2019

This commit reverts part of #8322

I recently changed to using the last entry from getResources to
avoid parent classloader delegation, but this leads to unwanted
results if the plugin classpath itself contains multiple
scalac-plugin.xml resources and wants the compiler to choose
the first.

I have not reverted the other change in #8322 which overrides
getResource to avoid parent delegation for scalac-plugin.xml.
I have documented the findPluginClassLoader extension point
with instructions to do the same.

This commit reverts part of the scala#8322

I recently changed to using the last entry from getResources to
avoid parent classloader delegation, but this leads to unwanted
results if the plugin classpath itself contains multiple
`scalac-plugin.xml` resources and wants the compiler to choose
the first.

I have _not_ reverted the other change in scala#8322 which overrides
`getResource` to avoid parent delegation for `scalac-plugin.xml`.
I have documented the `findPluginClassLoader` extension point
with instructions to do the same.
@som-snytt
Copy link
Contributor

I guess it is too soon to mention ServiceLoader.load(classOf[Plugin], loader).stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants