本文整理了Java中org.apache.tools.ant.taskdefs.Javac.createSrc()
方法的一些代码示例,展示了Javac.createSrc()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Javac.createSrc()
方法的具体详情如下:
包路径:org.apache.tools.ant.taskdefs.Javac
类名称:Javac
方法名:createSrc
[英]Adds a path for source compilation.
[中]为源代码编译添加路径。
代码示例来源:origin: org.apache.ant/ant
/**
* Recreate src.
*
* @return a nested src element.
*/
protected Path recreateSrc() {
src = null;
return createSrc();
}
代码示例来源:origin: org.codehaus.castor/castor-testsuite-xml-framework
/**
* 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);
}
}
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
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();
}
};
内容来源于网络,如有侵权,请联系作者删除!