本文整理了Java中org.apache.tools.ant.types.Path.addFileset()
方法的一些代码示例,展示了Path.addFileset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.addFileset()
方法的具体详情如下:
包路径:org.apache.tools.ant.types.Path
类名称:Path
方法名:addFileset
[英]Adds a nested <fileset>
element.
[中]添加嵌套的<fileset>
元素。
代码示例来源:origin: org.apache.ant/ant
/**
* Emulation of extdirs feature in Java >= 1.2.
* This method adds all files in the given
* directories (but not in sub-directories!) to the classpath,
* so that you don't have to specify them all one by one.
* @param extdirs - Path to append files to
*/
public void addExtdirs(Path extdirs) {
if (extdirs == null) {
String extProp = System.getProperty("java.ext.dirs");
if (extProp != null) {
extdirs = new Path(getProject(), extProp);
} else {
return;
}
}
for (String d : extdirs.list()) {
File dir = resolveFile(getProject(), d);
if (dir.exists() && dir.isDirectory()) {
FileSet fs = new FileSet();
fs.setDir(dir);
fs.setIncludes("*");
addFileset(fs);
}
}
}
代码示例来源:origin: org.apache.ant/ant
kaffeJarFiles.setDir(kaffeShare);
kaffeJarFiles.setIncludes("*.jar");
addFileset(kaffeJarFiles);
+ File.separator + "Packages"));
msZipFiles.setIncludes("*.ZIP");
addFileset(msZipFiles);
} else {
代码示例来源:origin: checkstyle/checkstyle
examinationFileSet.setFile(new File(getPath(FLAWLESS_INPUT)));
final Path sourcePath = new Path(antTask.getProject());
sourcePath.addFileset(examinationFileSet);
antTask.addPath(sourcePath);
antTask.addPath(new Path(new Project()));
代码示例来源:origin: checkstyle/checkstyle
@Test
public final void testPathsOneFile() throws IOException {
// given
TestRootModuleChecker.reset();
final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE);
final FileSet examinationFileSet = new FileSet();
examinationFileSet.setFile(new File(getPath(FLAWLESS_INPUT)));
final Path sourcePath = new Path(antTask.getProject());
sourcePath.addFileset(examinationFileSet);
antTask.addPath(sourcePath);
// when
antTask.execute();
// then
assertTrue("Checker is not processed",
TestRootModuleChecker.isProcessed());
final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck();
assertThat("There more files to check then expected",
filesToCheck.size(), is(1));
assertThat("The path of file differs from expected",
filesToCheck.get(0).getAbsolutePath(), is(getPath(FLAWLESS_INPUT)));
}
代码示例来源:origin: org.apache.ivy/ivy
public void addFileset(FileSet fs) throws BuildException {
toAdd.addFileset(fs);
}
代码示例来源:origin: Ant-Grand/Grand
/**
* @param set FileSet
*/
public final void addFileset(final FileSet set) {
getBuildpath().addFileset(set);
}
代码示例来源:origin: org.apache.ivy/ivy
private void addBuildFile(Path path, File buildFile) {
FileSet fs = new FileSet();
fs.setFile(buildFile);
path.addFileset(fs);
}
代码示例来源:origin: stackoverflow.com
path.addFileset(fset);
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
public void execute() {
if (applicationDir == null) {
throw new BuildException("No applicationDir set!");
}
// Add the properties from application.conf as ant properties
for (Map.Entry<String,String> entry: properties().entrySet()) {
String key = entry.getKey();
String value = project.replaceProperties(entry.getValue());
project.setProperty(prefix + key, value);
project.log("Loaded property '" + prefix + key + "'='" + value + "'", Project.MSG_VERBOSE);
}
// Add the module classpath as an ant property
Path path = new Path(project);
FilenameSelector endsToJar = new FilenameSelector();
endsToJar.setName("*.jar");
for (File module: modules()) {
File moduleLib = new File(module, "lib");
if (moduleLib.exists()) {
FileSet fileSet = new FileSet();
fileSet.setDir(moduleLib);
fileSet.addFilename(endsToJar);
path.addFileset(fileSet);
project.log("Added fileSet to path: " + fileSet, Project.MSG_VERBOSE);
} else {
project.log("Ignoring non existing lib dir: " + moduleLib.getAbsolutePath(), Project.MSG_VERBOSE);
}
}
project.addReference(modulesClasspath, path);
project.log("Generated classpath '" + modulesClasspath + "':" + project.getReference(modulesClasspath), Project.MSG_VERBOSE);
}
代码示例来源:origin: org.apache.maven/maven-ant-tasks
private void addArtifactToResult( ArtifactRepository localRepo, Artifact artifact,
FileSet toFileSet, Path path, ArtifactFilter filter )
{
String filename = localRepo.pathOf( artifact );
toFileSet.createInclude().setName( filename );
getProject().setProperty( artifact.getDependencyConflictId(), artifact.getFile().getAbsolutePath() );
FileSet artifactFileSet = new FileSet();
artifactFileSet.setProject( getProject() );
artifactFileSet.setFile( artifact.getFile() );
getProject().addReference( artifact.getDependencyConflictId(), artifactFileSet );
if ( path != null && ( filter == null || filter.include( artifact ) ) )
{
path.addFileset( artifactFileSet );
}
}
代码示例来源:origin: org.apache.maven/maven-ant-tasks
private void setupLocalMaven()
{
// Set the required properties
Variable classworldsConfProp = new Variable();
classworldsConfProp.setKey( "classworlds.conf" );
File classworldsPath = new File( mavenHome, "bin/m2.conf" );
classworldsConfProp.setValue( classworldsPath.getAbsolutePath() );
this.addSysproperty( classworldsConfProp );
Variable mavenHomeProp = new Variable();
mavenHomeProp.setKey( "maven.home" );
mavenHomeProp.setValue( mavenHome.getAbsolutePath() );
this.addSysproperty( mavenHomeProp );
// Set the boot classpath
FileSet bootDir = new FileSet();
bootDir.setDir( new File ( mavenHome, "boot" ) );
bootDir.setIncludes( "*.jar" );
Path mavenClasspath = new Path( getProject() );
mavenClasspath.addFileset( bootDir );
this.setClasspath( mavenClasspath );
this.setClassname( "org.codehaus.classworlds.Launcher" );
}
代码示例来源:origin: mojohaus/nbm-maven-plugin
set.createInclude().setName( "platform*/lib/*.jar" );
convert.createPath().addFileset( set );
try
代码示例来源:origin: javaee/metro-jax-ws
jwsFS.setDir(tmpDir);
jwsFS.createInclude().setName("src");
sourcepath.addFileset(jwsFS);
内容来源于网络,如有侵权,请联系作者删除!