Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

Solve #140 #142

Closed xamde closed 1 year ago

xamde commented 2 years ago

Explicitly setting the PLATFORM_CLASSPATH seems key for proper shading of native JRE with emulate JRE classes. However, this shading is not desired, when compiling dependencies. So a switch was needed, depending on who calls Javac.

Fixes #140

niloc132 commented 2 years ago

Thanks for this - can you add an integration test with the sample class that demonstrates the issue, and reduce the logging to DEBUG (as users generally won't need to see this)?

There's a good chance that this isn't going to be the long-term fix for this, but it will depend on how good j2cl's error messages are for members/classes that don't exist, but I think this will be good for now.

niloc132 commented 2 years ago

In general I am a bit concerned about this complexity - we might need to test some caching a little more in depth to be sure that changing the JVM doesn't produce unusable code or something. With that said, this entire branch should go away if #150 pans out, since we won't use javac at all to produce gwtincompatible-stripped bytecode for j2cl any more.

If #150 does work out, we will still have these integration tests to ensure that we don't lose this functionality, even if we do end up tossing the code.