Question on how to properly find all the sources going into a JDK

Joe Darcy Joe.Darcy at Sun.COM
Thu Apr 8 19:40:22 UTC 2010


 From time to time, I want to run an annotation processor over all the 
Java sources going into the JDK.  Annotation processors as compiler 
plug-ins can be used to check various structural properties of the 
code.  For example, an annotation processor could be used to find 
potential methods to be converted to use var-args.

The goal is to ideally have a single command like

    javac -proc:only -processor MyProcessor $OTHER_OPTIONS  `Long list 
of files`

and I wanted to verify the proper way to get the long list of files.  
 From the root of a JDK 7 forest with a build directory, does

find corba/src \
jaxp/drop/jaxp_src \
jaxws/drop/jaxws_src \
langools/src \
jdk/src/share jdk/src/$OS \
-name "*.java"

cover all the files of interest?

(It is technically possible, but less convenient, to run such annotation 
processors over the class files in rt.jar and tools.jar.)



More information about the build-dev mailing list