/** * Based on the parameter passed in, this method creates the necessary * factory desired. * * The current mapping for compiler names are as follows: * <ul><li>jikes = jikes compiler * <li>classic, javac1.1, javac1.2 = the standard compiler from JDK * 1.1/1.2 * <li>modern, javac1.3, javac1.4, javac1.5 = the compiler of JDK 1.3+ * <li>jvc, microsoft = the command line compiler from Microsoft's SDK * for Java / Visual J++ * <li>kjc = the kopi compiler</li> * <li>gcj = the gcj compiler from gcc</li> * <li>sj, symantec = the Symantec Java compiler</li> * <li><i>a fully qualified classname</i> = the name of a compiler * adapter * </ul> * * @param compilerType either the name of the desired compiler, or the * full classname of the compiler's adapter. * @param task a task to log through. * @return the compiler adapter * @throws BuildException if the compiler type could not be resolved into * a compiler adapter. */ public static CompilerAdapter getCompiler(String compilerType, Task task) throws BuildException { return getCompiler(compilerType, task, null); }
private String[] findSupportedFileExtensions() { final String compilerImpl = getCompiler(); final CompilerAdapter adapter = nestedAdapter != null ? nestedAdapter : CompilerAdapterFactory.getCompiler(compilerImpl, this, createCompilerClasspath()); String[] extensions = null; if (adapter instanceof CompilerAdapterExtension) { extensions = ((CompilerAdapterExtension) adapter).getSupportedFileExtensions(); } if (extensions == null) { extensions = new String[] {"java"}; } // now process the extensions to ensure that they are the // right format for (int i = 0; i < extensions.length; i++) { if (!extensions[i].startsWith("*.")) { extensions[i] = "*." + extensions[i]; } } return extensions; }
CompilerAdapterFactory.getCompiler(compilerImpl, this, createCompilerClasspath());