APT: Getting project classpath in Java 6 processors, automatic processor options [message #661684] |
Sat, 26 March 2011 00:49  |
Eclipse User |
|
|
|
I'm trying to access the classpath of a Java project from a Java 6 anntotation processor used in that project.
I've read in the documentation that "there are no automatically provided options for processors using the Java 6 annotation processing API, because the JavaFileManager methods provide the same functionality".
I tried to get the classpath of the Java project via ToolProvider.getSystemJavaCompiler().getStandardFileManager( ).getLocation(StandardLocation.CLASS_PATH), but that contains only the org.eclipse.equinox.launcher Jar. If I use PLATFORM_CLASS_PATH it doesn't contain the project classpath entries, only the JDK. Is there some other way to get a JavaFileManager that would contain the classpath of the Java project?
I looked into the code while debugging this issue and saw that the options are all present in IdeProcessingEnvImpl#getOptions() but that those starting with "-" are discarded. This is consistent with the documentation, but I'm wondering why these options are not passed to all processors. To me it seems that would be an easy and consistent way to access them.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03388 seconds