else
origOptions.put(s, value);
}
origOptions = Collections.unmodifiableMap(origOptions);
JavacFileManager fm = (JavacFileManager) context.get(JavaFileManager.class);
{
// Note: it might be necessary to check for an empty
// component ("") of the source path or class path
String sourceDest = options.get("-s");
if (fm.hasLocation(StandardLocation.SOURCE_PATH)) {
for(File f: fm.getLocation(StandardLocation.SOURCE_PATH))
augmentedSourcePath += (f + File.pathSeparator);
augmentedSourcePath += (sourceDest == null)?".":sourceDest;
} else {
augmentedSourcePath = ".";
if (sourceDest != null)
augmentedSourcePath += (File.pathSeparator + sourceDest);
}
String classDest = options.get("-d");
if (fm.hasLocation(StandardLocation.CLASS_PATH)) {
for(File f: fm.getLocation(StandardLocation.CLASS_PATH))
baseClassPath += (f + File.pathSeparator);
// put baseClassPath into map to handle any
// value needed for the classloader
options.put("-classpath", baseClassPath);
augmentedClassPath = baseClassPath + ((classDest == null)?".":classDest);
} else {
baseClassPath = ".";
if (classDest != null)
augmentedClassPath = baseClassPath + (File.pathSeparator + classDest);
}
assert options.get("-classpath") != null;
}
/*
* Create base and augmented class loaders
*/
ClassLoader augmentedAptCL = null;
{
/*
* Use a url class loader to look for classes on the
* user-specified class path. Prepend computed bootclass
* path, which includes extdirs, to the URLClassLoader apt
* uses.
*/
String aptclasspath = "";
String bcp = "";
Iterable<? extends File> bootclasspath = fm.getLocation(StandardLocation.PLATFORM_CLASS_PATH);
if (bootclasspath != null) {
for(File f: bootclasspath)
bcp += (f + File.pathSeparator);
}