本文整理汇总了Java中org.apache.tools.ant.taskdefs.Copy.addFileset方法的典型用法代码示例。如果您正苦于以下问题:Java Copy.addFileset方法的具体用法?Java Copy.addFileset怎么用?Java Copy.addFileset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.taskdefs.Copy
的用法示例。
在下文中一共展示了Copy.addFileset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copySet
import org.apache.tools.ant.taskdefs.Copy; //导入方法依赖的package包/类
private void copySet(LayoutFileSet set) {
Copy task = new Copy();
task.setTaskName("copy");
task.setProject(getProject());
String prefix = set.getPrefix(getProject());
File target = prefix.length() > 0 ? new File(destDirectory, prefix + "/") : destDirectory;
target.mkdirs();
task.setTodir(target);
LayoutFileSet unprefixed = (LayoutFileSet) set.clone();
unprefixed.setPrefix("");
task.addFileset(unprefixed);
task.perform();
}
示例2: copyFiles
import org.apache.tools.ant.taskdefs.Copy; //导入方法依赖的package包/类
/**
* Move java or class files to temp files or moves the temp files back to
* java or class files. This must be done because javac is too nice and
* sticks already compiled classes and ones depended on in the classpath
* destroying the compile time wall. This way, we can keep the wall up.
*
* @param srcDir
* Directory to copy files from/to(Usually the java files dir or
* the class files dir)
* @param fileset
* The fileset of files to include in the move.
* @param moveToTempFile
* true if moving src files to temp files, false if moving temp
* files back to src files.
* @param isJavaFiles
* true if we are moving .java files, false if we are moving
* .class files.
*/
private void copyFiles(File srcDir, File destDir, FileSet fileset) {
fileset.setDir(srcDir);
if (!srcDir.exists())
throw new BuildException("Directory=" + srcDir + " does not exist", getLocation());
// before we do this, we have to move all files not
// in the above fileset to xxx.java.ant-tempfile
// so that they don't get dragged into the compile
// This way we don't miss anything and all the dependencies
// are listed or the compile will break.
Copy move = (Copy) getProject().createTask("SilentCopy");
move.setProject(getProject());
move.setOwningTarget(getOwningTarget());
move.setTaskName(getTaskName());
move.setLocation(getLocation());
move.setTodir(destDir);
// move.setOverwrite(true);
move.addFileset(fileset);
move.perform();
}
示例3: copyDirectory
import org.apache.tools.ant.taskdefs.Copy; //导入方法依赖的package包/类
public static void copyDirectory(File source, File dest) {
Project p = new Project();
Copy c = new Copy();
c.setProject(p);
c.setTodir(dest);
FileSet fs = new FileSet();
fs.setDir(source);
c.addFileset(fs);
c.execute();
}
示例4: copyClassFiles
import org.apache.tools.ant.taskdefs.Copy; //导入方法依赖的package包/类
private void copyClassFiles(File jspCompileDir) {
Copy copy = new Copy();
copy.setProject(getProject());
copy.setTaskName(getTaskName());
destdir.mkdirs();
copy.setTodir(destdir);
FileSet files = new FileSet();
files.setDir(jspCompileDir);
files.setIncludes("**/*.class");
copy.addFileset(files);
copy.execute();
}
示例5: copyJars
import org.apache.tools.ant.taskdefs.Copy; //导入方法依赖的package包/类
void copyJars() {
if (!parent.getLibs().isEmpty()) {
Copy cp = createTask(Copy.class);
cp.setTodir(javaDir);
cp.setFlatten(true);
for (FileSet fs : parent.getLibs()) {
cp.addFileset(fs);
}
cp.execute();
}
}