add custom classloaders to compilation classpath
Anyone who has written java bytecode generators has probably written a custom classloader to expose that bytecode, allowing it to be generated and loaded within a running VM. This sort of stuff is very common when writing bridges to expose non-java code to a java application e.g. exposing objective-c to java where the objective-c classes are only known at bind-time, or when generating systematically-named utility classes (pair_object_object, pair_object_int, tripple_int_int_double and so on).
However, currently there is no way to load these custom classloaders into the classpath that javac will compile code against. This means that we have to have a multi-phaze build:
1) process the source to work out what dynamically generated classes it will use
2) use the custom class-loader to make these classes and write them out
3) include these classes in the classpath, compile the source
4) load the custom class-loader classes from the compiled source and run the app
If we could tell javac to add custom classloaders, then this would change to:
1) javac -custom_class_loader my.custom.ClassLoaderImpl theSource.java
2) - see 4) above
The only potential down-side I can see to this is that if the custom class loader is not the same between the compilation and running steps then the symbols won't resolve, but that's not realy any different to using a different version of a .jar lib for compile and run-time.