本文整理了Java中org.apache.tools.ant.types.Path.add()
方法的一些代码示例,展示了Path.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.add()
方法的具体详情如下:
包路径:org.apache.tools.ant.types.Path
类名称:Path
方法名:add
[英]Adds a nested path
[中]添加嵌套路径
代码示例来源:origin: org.apache.ant/ant
/**
* Append the contents of the other Path instance to this.
* @param other a <code>Path</code> to be added to the path
*/
public void append(Path other) {
if (other == null) {
return;
}
add(other);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Add a set of files (nested fileset attribute).
*
* @param fs The fileset.
*/
public void addFileset(FileSet fs) {
createAttachments().add(fs);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Add a nested (filesystem-only) ResourceCollection.
* @param rc the ResourceCollection to add.
*/
public void add(ResourceCollection rc) {
getPath().add(rc);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Adds a resource collection to the implicit build path.
*
* @param rc the resource collection to add.
* @since Ant 1.7
*/
public void add(ResourceCollection rc) {
getBuildpath().add(rc);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Add a list of target files.
* @param fl the FileList to add.
*/
public void addTargetfilelist(FileList fl) {
createTargets().add(fl);
}
代码示例来源:origin: org.projectlombok/lombok
public void addFileset(FileSet set) {
if (path == null) path = new Path(getProject());
path.add(set);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Add a set of target files.
* @param fs the FileSet to add.
*/
public void addTargetfileset(FileSet fs) {
createTargets().add(new HideMissingBasedir(fs));
}
代码示例来源:origin: org.apache.ant/ant
/**
* Builds the modulesourcepath for multi module compilation.
* @return the modulesourcepath
* @since 1.9.7
*/
protected Path getModulesourcepath() {
final Path msp = new Path(getProject());
if (moduleSourcepath != null) {
msp.add(moduleSourcepath);
}
return msp;
}
代码示例来源:origin: org.apache.ant/ant
/**
* Creates a nested <code><path></code> element.
* @return a <code>Path</code> to be configured
* @throws BuildException on error
*/
public Path createPath() throws BuildException {
Path p = new Path(getProject());
add(p);
return p;
}
代码示例来源:origin: apache/groovy
createClasspath().add(new Path(getProject(), srcFile.getParentFile().getCanonicalPath()));
command = getText(new BufferedReader(new FileReader(srcFile)));
代码示例来源:origin: org.apache.ant/ant
/**
* Set the list of files to be attached.
*
* @param filenames Comma-separated list of files.
*/
public void setFiles(String filenames) {
StringTokenizer t = new StringTokenizer(filenames, ", ");
while (t.hasMoreTokens()) {
createAttachments()
.add(new FileResource(getProject().resolveFile(t.nextToken())));
}
}
代码示例来源:origin: org.apache.ant/ant
/**
* Adds a nested <code><fileset></code> element.
* @param fs a <code>FileSet</code> to be added to the path
* @throws BuildException on error
*/
public void addFileset(FileSet fs) throws BuildException {
if (fs.getProject() == null) {
fs.setProject(getProject());
}
add(fs);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Adds a nested <code><filelist></code> element.
* @param fl a <code>FileList</code> to be added to the path
* @throws BuildException on error
*/
public void addFilelist(FileList fl) throws BuildException {
if (fl.getProject() == null) {
fl.setProject(getProject());
}
add(fl);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Adds a nested <code><dirset></code> element.
* @param dset a <code>DirSet</code> to be added to the path
* @throws BuildException on error
*/
public void addDirset(DirSet dset) throws BuildException {
if (dset.getProject() == null) {
dset.setProject(getProject());
}
add(dset);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Creates the nested <code><pathelement></code> element.
* @return the <code>PathElement</code> to be configured
* @throws BuildException on error
*/
public PathElement createPathElement() throws BuildException {
if (isReference()) {
throw noChildrenAllowed();
}
PathElement pe = new PathElement();
add(pe);
return pe;
}
代码示例来源:origin: pmd/pmd
private ResourceLoader setupResourceLoader() {
if (classpath == null) {
classpath = new Path(project);
}
/*
* 'basedir' is added to the path to make sure that relative paths such
* as "<ruleset>resources/custom_ruleset.xml</ruleset>" still work when
* ant is invoked from a different directory using "-f"
*/
classpath.add(new Path(null, project.getBaseDir().toString()));
project.log("Using the AntClassLoader: " + classpath, Project.MSG_VERBOSE);
// must be true, otherwise you'll get ClassCastExceptions as classes
// are loaded twice
// and exist in multiple class loaders
final boolean parentFirst = true;
return new ResourceLoader(new AntClassLoader(Thread.currentThread().getContextClassLoader(),
project, classpath, parentFirst));
}
代码示例来源:origin: org.apache.ant/ant
/**
* clone our path and add all explicitly specified FileSets as
* well, patch in the jar attribute as a new fileset if it is
* defined.
* @return a path that contains all files to sign
* @since Ant 1.7
*/
protected Path createUnifiedSourcePath() {
Path p = path == null ? new Path(getProject()) : (Path) path.clone();
for (FileSet fileSet : createUnifiedSources()) {
p.add(fileSet);
}
return p;
}
代码示例来源:origin: org.apache.ant/ant
/**
* Adds a nested path
* @param path a <code>Path</code> to be added to the path
* @throws BuildException on error
* @since Ant 1.6
*/
public void add(Path path) throws BuildException {
if (path == this) {
throw circularReference();
}
if (path.getProject() == null) {
path.setProject(getProject());
}
add((ResourceCollection) path);
}
代码示例来源:origin: checkstyle/checkstyle
@Test
public final void testPathsDirectoryWithNestedFile() throws IOException {
// given
TestRootModuleChecker.reset();
final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub();
antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE));
antTask.setProject(new Project());
final FileResource fileResource = new FileResource(
antTask.getProject(), getPath(""));
final Path sourcePath = new Path(antTask.getProject());
sourcePath.add(fileResource);
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(9));
assertThat("The path of file differs from expected",
filesToCheck.get(6).getAbsolutePath(), is(getPath(FLAWLESS_INPUT)));
assertEquals("Amount of logged messages in unexpected",
8, antTask.getLoggedMessages().size());
}
代码示例来源:origin: org.apache.felix/org.apache.felix.scr.ant
public void setDestdir( File outputDirectory ) {
this.destdir = outputDirectory;
if ( destdir != null ) {
Path dst = new Path( getProject() );
dst.setLocation( destdir );
createClasspath().add( dst );
}
}
内容来源于网络,如有侵权,请联系作者删除!