Refine search
Javac javac = new Javac(); javac.setProject(project); javac.setTaskName(getTaskName()); javac.setClasspath(classpath); if (compiler != null) javac.setCompiler(compiler); javac.setDebug(debug); if (debugLevel != null) javac.setDebugLevel(debugLevel); javac.setDestdir(classgendir); javac.setExecutable(forkedExecutable); javac.setFailonerror(failonerror); javac.setFork(fork); if (javasource != null) javac.setSource(javasource); javac.setTarget(javasource); javac.setSource("1.4"); javac.setTarget("1.4"); javac.setIncludeantruntime(includeAntRuntime); javac.setIncludejavaruntime(includeJavaRuntime); javac.setSrcdir(new Path(project, srcgendir.getAbsolutePath())); if (memoryInitialSize != null) javac.setMemoryInitialSize(memoryInitialSize); if (memoryMaximumSize != null) javac.setMemoryMaximumSize(memoryMaximumSize); javac.setOptimize(optimize); javac.setVerbose(verbose); javac.execute();
/** * Performs a compile using the Javac externally. * * @throws BuildException if there is a problem. */ public void execute() throws BuildException { ImplementationSpecificArgument argument = super.createCompilerArg(); argument.setLine("-processor " + WebServiceAp.class.getName()); argument = super.createCompilerArg(); argument.setLine("-s " + sourceDestDir); if (procOnly) { argument = super.createCompilerArg(); argument.setLine("-proc:only"); } super.execute(); } }
public void setDebug(boolean debug) { javac.setDebug(debug); javac.setOptimize(!debug); }
Javac javaCompile = (Javac) webServiceProject.createTask("javac"); javaCompile.createCompilerArg().setValue("-Xstdout"); String filePath = basePath + "resources" + File.separator + "errorlog.log"; javaCompile.createCompilerArg().setFile(new File(filePath)); javaCompile.setNowarn(true);
javac.setExtdirs(extdirs); info.append(" extension dir=" + exts + "\n"); if(endorsed != null) { Javac.ImplementationSpecificArgument endorsedArg = javac.createCompilerArg(); endorsedArg.setLine("-J-Djava.endorsed.dirs=" + quotePathList(endorsed)); javac.setEncoding(javaEncoding); javac.setClasspath(path); javac.setDebug(ctxt.getOptions().getClassDebugInfo()); javac.setSrcdir(srcPath); javac.setTempdir(options.getScratchDir()); javac.setOptimize(! ctxt.getOptions().getClassDebugInfo() ); javac.setFork(ctxt.getOptions().getFork()); info.append(" srcDir=" + srcPath + "\n" ); javac.setCompiler(options.getCompiler()); info.append(" compiler=" + options.getCompiler() + "\n"); javac.setTarget(options.getCompilerTargetVM()); info.append(" compilerTargetVM=" + options.getCompilerTargetVM() + "\n"); javac.setSource(options.getCompilerSourceVM()); info.append(" compilerSourceVM=" + options.getCompilerSourceVM() + "\n"); PatternSet.NameEntry includes = javac.createInclude();
Javac j = new Javac(); j.setProject(project); j.setTaskName("compile"); j.setSrcdir(sources); j.setDestdir(tmp); j.setDebug(true); String javaVersion = jckit.getJavaVersion(); if (java_version != null) { j.setTarget(javaVersion); j.setSource(javaVersion); if (jckit.isVersion(JavaCardSDK.Version.V21)) { j.setDebug(true); j.setIncludeantruntime(false); j.createCompilerArg().setValue("-Xlint"); j.createCompilerArg().setValue("-Xlint:-options"); j.createCompilerArg().setValue("-Xlint:-serial"); if (jckit.getVersion() == JavaCardSDK.Version.V304) { j.createCompilerArg().setLine("-processor com.oracle.javacard.stringproc.StringConstantsProcessor"); Path pcp = new Javac().createClasspath(); j.createCompilerArg().setLine("-processorpath \"" + pcp.toString() + "\""); j.createCompilerArg().setValue("-Xlint:all,-processing");
project.setBasedir(srcDir.getAbsolutePath()); Javac compiler = new Javac(); compiler.setProject(project); compiler.setDestdir(destDir.getAbsoluteFile()); compiler.setOptimize(false); compiler.setDebug(true); compiler.setDebugLevel("lines,vars,source"); compiler.setIncludejavaruntime(true); if (XMLTestCase._verbose) { compiler.setListfiles(true); compiler.setVerbose(true); } else { compiler.setNowarn(true); compiler.setSource(_javaVersion); Path classpath = compiler.createClasspath(); classpath.setPath(System.getProperty("java.class.path")); classpath.add(new Path(project, destDir.getAbsolutePath())); compiler.setClasspath(classpath); return compiler;
public void compile(List files, CompilationUnit cu) { // forward options if (javac.getClasspath()==null) { javac.setClasspath(compileClasspath); } if (javac.getSourcepath()==null && compileSourcepath!=null) { javac.createSourcepath().add(compileSourcepath); } if (javac.getEncoding()==null) { javac.setEncoding(encoding); } javac.setDestdir(destDir); Path p = javac.createSrc(); p.add(src); Path tmpDir = new Path(getProject()); File dir = (File) cu.getConfiguration().getJointCompilationOptions().get("stubDir"); tmpDir.setLocation(dir); p.add(tmpDir); javac.execute(); } };
javac.setEncoding(javaEncoding); Path srcPath = new Path(project); srcPath.setLocation(options.getScratchDir()); javac.setSrcdir(srcPath); info.append(" srcDir=" + srcPath + "\n"); info.append(" work dir=" + options.getScratchDir() + "\n"); PatternSet.NameEntry includes = javac.createInclude(); includes.setName(ctxt.getJavaPath()); info.append(" include=" + ctxt.getJavaPath() + "\n"); if (ctxt.getOptions().getFork()) { try { javac.execute(); } catch (BuildException e) { be = e;
public void setClassPath(List<File> cpath) { Path path = new Path(project); for (File file: cpath) { path.setLocation(file); info.append(" cp=" + file + "\n"); } javac.setClasspath(path); }
/** * Compiles a directory tree. Throws a <code>CompilationException</code> if build fails. * * @param srcDir Source directory holding the files to be compiled. * @param destDir Destination directory to put the compiled classes in. */ private void compileDirectory(final File srcDir, final File destDir) { File[] entries = srcDir.listFiles(); for (int i = 0; i < entries.length; i++) { File entry = entries[i]; if (entry.isDirectory() && !IGNORE_DIRS.contains(entry.getName())) { compileDirectory(entry, destDir); } } entries = null; try { Path srcPath = _compiler.createSrc(); srcPath.setLocation(destDir); _compiler.setSrcdir(srcPath); _compiler.execute(); } catch (BuildException ex) { throw new CompilationException("Problem compiling directory " + srcDir, ex); } }
public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) { this.ctxt = ctxt; this.errDispatcher = errDispatcher; options = ctxt.getOptions(); log = suppressLogging ? new org.tinygroup.jspengine.org.apache.commons.logging.impl.NoOpLog() : org.tinygroup.jspengine.org.apache.commons.logging.LogFactory.getLog( AntJavaCompiler.class); getProject(); javac = (Javac) project.createTask("javac"); javac.setFork(options.getFork()); // Set the Java compiler to use if (options.getCompiler() != null) { javac.setCompiler(options.getCompiler()); } startThreadPool(); }
public void run() { SystemLogHandler.setThread(); try { _javac.execute(); } catch (BuildException e) { _be = e; } finally { _errorCapture = SystemLogHandler.unsetThread(); synchronized(this) { this.notify(); } } }
public void setSourceVM(String sourceVM) { javac.setSource(sourceVM); info.append(" compilerSourceVM=" + sourceVM + "\n"); }
public void setTargetVM(String targetVM) { javac.setTarget(targetVM); info.append(" compilerTargetVM=" + targetVM + "\n"); }
javac.setExtdirs(extdirs); info.append(" extension dir=" + exts + "\n"); if(endorsed != null) { Javac.ImplementationSpecificArgument endorsedArg = javac.createCompilerArg(); endorsedArg.setLine("-J-Djava.endorsed.dirs=" + quotePathList(endorsed)); javac.setEncoding(javaEncoding); javac.setClasspath(path); javac.setDebug(ctxt.getOptions().getClassDebugInfo()); javac.setSrcdir(srcPath); javac.setTempdir(options.getScratchDir()); javac.setOptimize(! ctxt.getOptions().getClassDebugInfo() ); javac.setFork(ctxt.getOptions().getFork()); info.append(" srcDir=" + srcPath + "\n" ); javac.setCompiler(options.getCompiler()); info.append(" compiler=" + options.getCompiler() + "\n"); javac.setTarget(options.getCompilerTargetVM()); info.append(" compilerTargetVM=" + options.getCompilerTargetVM() + "\n"); javac.setSource(options.getCompilerSourceVM()); info.append(" compilerSourceVM=" + options.getCompilerSourceVM() + "\n"); PatternSet.NameEntry includes = javac.createInclude();
javac.setEncoding(javaEncoding); Path srcPath = new Path(project); srcPath.setLocation(options.getScratchDir()); javac.setSrcdir(srcPath); info.append(" srcDir=" + srcPath + "\n" ); info.append(" work dir=" + options.getScratchDir() + "\n"); PatternSet.NameEntry includes = javac.createInclude(); includes.setName(ctxt.getJavaPath()); info.append(" include="+ ctxt.getJavaPath() + "\n" ); if (ctxt.getOptions().getFork()) { try { javac.execute(); } catch (BuildException e) { be = e;
public void setClassPath(List<File> cpath) { Path path = new Path(project); for (File file : cpath) { path.setLocation(file); info.append(" cp=" + file + "\n"); } javac.setClasspath(path); }
public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) { this.ctxt = ctxt; this.errDispatcher = errDispatcher; options = ctxt.getOptions(); log = suppressLogging? new com.sun.org.apache.commons.logging.impl.NoOpLog(): com.sun.org.apache.commons.logging.LogFactory.getLog( AntJavaCompiler.class); getProject(); javac = (Javac) project.createTask("javac"); javac.setFork(options.getFork()); // Set the Java compiler to use if (options.getCompiler() != null) { javac.setCompiler(options.getCompiler()); } startThreadPool(); }