本文整理匯總了Java中org.apache.tools.ant.types.FileSet.setIncludes方法的典型用法代碼示例。如果您正苦於以下問題:Java FileSet.setIncludes方法的具體用法?Java FileSet.setIncludes怎麽用?Java FileSet.setIncludes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.types.FileSet
的用法示例。
在下文中一共展示了FileSet.setIncludes方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJavaCopyFileSet
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
/**
* FILL IN JAVADOC HERE
*
*/
public FileSet getJavaCopyFileSet(Project p, Location l) throws BuildException {
if (failureReason != null)
throw new BuildException(failureReason, l);
else if (pack.indexOf("/") != -1 || pack.indexOf("\\") != -1)
throw new BuildException("A package name cannot contain '\\' or '/' like package=" + pack
+ "\nIt must look like biz.xsoftware.* for example", l);
FileSet set = new FileSet();
String match = getMatch(p, pack, ".java");
// log("match="+match+" pack="+pack);
// first exclude the compilation module, then exclude all it's
// dependencies too.
set.setIncludes(match);
return set;
}
示例2: compress
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
/**
* ʹ��zipѹ���ļ�
*
* @param source
* ��Ҫѹ�����ļ�
* @param target
* ѹ�����ļ��Ĵ��·��
* @param delflag
* ѹ�����Ƿ�ɾ��Դ�ļ�
*/
public static void compress(File source, File target, boolean delflag) {
if (!target.exists()) {
target.mkdirs();
}
File zipFile = new File(target.getAbsolutePath() + File.separator
+ source.getName() + ".zip");
Project prj = new Project();
org.apache.tools.ant.taskdefs.Zip zip = new org.apache.tools.ant.taskdefs.Zip();
zip.setProject(prj);
zip.setDestFile(zipFile);
FileSet fileSet = new FileSet();
fileSet.setProject(prj);
fileSet.setDir(target);
// ������Щ�ļ����ļ���
fileSet.setIncludes(source.getName());
// �ų���Щ�ļ����ļ���
fileSet.setExcludes("*.zip");
zip.addFileset(fileSet);
zip.execute();
if (delflag) {
source.delete();
}
}
示例3: setUp
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Before
public void setUp() {
TestHelper.cleanCache();
project = TestHelper.newProject();
project.setProperty("ivy.cache.dir", TestHelper.cache.getAbsolutePath());
AntWorkspaceResolver antWorkspaceResolver = new AntWorkspaceResolver();
antWorkspaceResolver.setName("test-workspace");
wa = antWorkspaceResolver.createArtifact();
FileSet fileset = new FileSet();
fileset.setProject(project);
fileset.setDir(new File("test/workspace"));
fileset.setIncludes("*/ivy.xml");
antWorkspaceResolver.addConfigured(fileset);
antWorkspaceResolver.setProject(project);
configure = new IvyConfigure();
configure.setProject(project);
configure.setFile(new File("test/workspace/ivysettings.xml"));
configure.addConfiguredWorkspaceResolver(antWorkspaceResolver);
configure.execute();
}
示例4: copyFiles
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
public void copyFiles(File sourceFile,File destinationDirectory,String filter){
if (sourceFile.isFile()){
this.setFile(sourceFile);
}else {
FileSet fileset = new FileSet();
fileset.setDir(sourceFile);
if (filter!=null){
if (filter.matches("\\.\\w*")){
fileset.setIncludes("**/*"+filter);
}
}
this.addFileset(fileset);
}
this.setTodir(destinationDirectory);
this.perform();
}
示例5: testReverse
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testReverse() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/build.xml,F/build.xml,G/build.xml");
buildlist.addFileset(fs);
buildlist.setReverse(true);
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(5, files.length);
assertListOfFiles("test/buildlist/", new String[] {"E", "D", "A", "C", "B"}, files);
}
示例6: copyFiles
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
public void copyFiles(File sourceFile, File destinationDirectory, String filter) {
if (sourceFile.isFile())
this.setFile(sourceFile);
else {
FileSet fileset = new FileSet();
fileset.setDir(sourceFile);
if (filter != null) {
if (filter.matches("\\.\\w*")) {
fileset.setIncludes("*/**/*" + filter);
}
}
this.addFileset(fileset);
}
this.setTodir(destinationDirectory);
this.perform();
}
示例7: testWithTwoRoots
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithTwoRoots() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setRoot("C,E");
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(3, files.length); // A and D should be filtered out
assertListOfFiles("test/buildlist/", new String[] {"B", "C", "E"}, files);
}
示例8: testWithRootAndOnlyDirectDep
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithRootAndOnlyDirectDep() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setRoot("A");
buildlist.setOnlydirectdep(true);
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(2, files.length); // We should have only A and C
assertListOfFiles("test/buildlist/", new String[] {"C", "A"}, files);
}
示例9: testWithLeaf
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithLeaf() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setLeaf("C");
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(3, files.length); // B should be filtered out
assertListOfFiles("test/buildlist/", new String[] {"C", "A", "D"}, files);
}
示例10: copyFiles
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
public void copyFiles(File sourceFile,File destinationDirectory,String filter){
if (sourceFile.isFile()){
this.setFile(sourceFile);
}else {
FileSet fileset = new FileSet();
fileset.setDir(sourceFile);
if (filter!=null){
if (filter.matches("\\.\\w*")){
fileset.setIncludes("*/**/*"+filter);
}
}
this.addFileset(fileset);
}
this.setTodir(destinationDirectory);
this.perform();
}
示例11: testWithTwoLeafs
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithTwoLeafs() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setLeaf("C,E");
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(4, files.length); // B should be filtered out
assertListOfFiles("test/buildlist/", new String[] {"C", "A", "D", "E"}, files);
}
示例12: testWithLeafExclude
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithLeafExclude() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setLeaf("C");
buildlist.setExcludeLeaf(true);
buildlist.setOnMissingDescriptor("skip");
String[] files = getFiles(buildlist);
assertEquals(2, files.length); // B and C should be filtered out
assertListOfFiles("test/buildlist/", new String[] {"A", "D"}, files);
}
示例13: testWithLeafAndOnlyDirectDep
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testWithLeafAndOnlyDirectDep() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/**");
buildlist.addFileset(fs);
buildlist.setOnMissingDescriptor("skip");
buildlist.setLeaf("C");
buildlist.setOnlydirectdep(true);
String[] files = getFiles(buildlist);
assertEquals(2, files.length); // We must have only A and C
assertListOfFiles("test/buildlist/", new String[] {"C", "A"}, files);
}
示例14: testRestartFrom
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testRestartFrom() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/build.xml,F/build.xml,G/build.xml");
buildlist.addFileset(fs);
buildlist.setOnMissingDescriptor("skip");
buildlist.setRestartFrom("C");
String[] files = getFiles(buildlist);
assertEquals(4, files.length);
assertListOfFiles("test/buildlist/", new String[] {"C", "A", "D", "E"}, files);
}
示例15: testOnMissingDescriptor
import org.apache.tools.ant.types.FileSet; //導入方法依賴的package包/類
@Test
public void testOnMissingDescriptor() {
FileSet fs = new FileSet();
fs.setDir(new File("test/buildlist"));
fs.setIncludes("**/build.xml");
fs.setExcludes("E2/build.xml,F/build.xml,G/build.xml");
buildlist.addFileset(fs);
buildlist.setOnMissingDescriptor("tail"); // IVY-805: new String instance
String[] files = getFiles(buildlist);
assertEquals(6, files.length);
assertListOfFiles("test/buildlist/", new String[] {"B", "C", "A", "D", "E", "H"}, files);
}