New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate the usage of javac plugins #3414
Comments
Hooking such checks in the compiler has some drawbacks: it's relatively difficult, not portable to other compilers... The main responsibility of the compiler is to create .class files (of course, some static analysis that is best and most easily done at compilation is hooked in, but it's not a static analyzer). Things that can be checked outside of the compiler would better be a separate/standalone analyzer. For JDT and package restrictions, or more specifically for PDE, I believe it would be more interesting to add a "validate referenced packages" step in the build. This could easily operate on .class files, and list the referenced packages and ensure they're visible according to the resolved dependencies constraints). |
What other compilers? :-)
That seems an interesting idea but then of course need to be setup as a new step, new invocations, new classpath ... and for some reason was decided to baked into batch compiler or is there any way to call it standalone? The main "issue" with that I think it that all this require yet another tool to parse and interpret the results, while I hope to reuse the output of the compiler that is already understood by tools. |
For access to exported package there is also the possible solution of generating module-info.class always that has exports matching OSGi metadata. That combined with only using module path should in theory provide that verification. |
As far as I know, those "access rules" are a bit like classpath/package filters in JDT and there is no way to extract this logic easily from ECJ to use it standalone. |
Now Tycho supports
javac
as well it might be interesting to supply some functions previously in ecj (e.g. restricted access on packages):The text was updated successfully, but these errors were encountered: