org.apache.tools.ant.types.FileList Java Examples

The following examples show how to use org.apache.tools.ant.types.FileList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CompileTask.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Translates an Ant file list into the file format that the compiler
 * expects.
 */
private List<SourceFile> findJavaScriptFiles(FileList fileList) {
  List<SourceFile> files = Lists.newLinkedList();
  File baseDir = fileList.getDir(getProject());

  for (String included : fileList.getFiles(getProject())) {
    files.add(SourceFile.fromFile(new File(baseDir, included),
        Charset.forName(encoding)));
  }

  return files;
}
 
Example #2
Source File: CompileTask.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private List<SourceFile> findExternFiles() {
  List<SourceFile> files = Lists.newLinkedList();
  if (!this.customExternsOnly) {
    files.addAll(getDefaultExterns());
  }

  for (FileList list : this.externFileLists) {
    files.addAll(findJavaScriptFiles(list));
  }

  return files;
}
 
Example #3
Source File: JarBundler.java    From JarBundler with Apache License 2.0 5 votes vote down vote up
private void processJarFileLists() throws BuildException {

		for (Iterator jarIter = mJarFileLists.iterator(); jarIter.hasNext();) {
			FileList fl = (FileList) jarIter.next();
			Project p = fl.getProject();
			File srcDir = fl.getDir(p);
			String[] files = fl.getFiles(p);

			try {

				for (int i = 0; i < files.length; i++) {
					String fileName = files[i];
					File src = new File(srcDir, fileName);
					File dest = new File(mJavaDir, fileName);

					if (mVerbose) 
						log("Copying JAR file to \"" + bundlePath(dest) + "\"");
					

					mFileUtils.copyFile(src, dest);
					bundleProperties.addToClassPath(fileName);
				}
			} catch (IOException ex) {
				throw new BuildException("Cannot copy jar file: " + ex);
			}
		}
	}
 
Example #4
Source File: JarBundler.java    From JarBundler with Apache License 2.0 5 votes vote down vote up
private void processExtraClassPathFileLists() throws BuildException {
	for (Iterator jarIter = mExtraClassPathFileLists.iterator(); jarIter
			.hasNext();) {
		FileList fl = (FileList) jarIter.next();
		Project p = fl.getProject();
		File srcDir = fl.getDir(p);
		String[] files = fl.getFiles(p);

		for (int i = 0; i < files.length; i++) {
			File f = new File(srcDir, files[i]);
			String path = f.getPath().replace(File.separatorChar, '/');
			bundleProperties.addToExtraClassPath(path);
		}
	}
}
 
Example #5
Source File: JarBundler.java    From JarBundler with Apache License 2.0 5 votes vote down vote up
private void processCopyingFileLists(List fileLists, File targetDir, boolean setExec) throws BuildException {
	for (Iterator execIter = fileLists.iterator(); execIter.hasNext();) {

		FileList fl = (FileList) execIter.next();
		Project p = fl.getProject();
		File srcDir = fl.getDir(p);
		String[] files = fl.getFiles(p);

		if (files.length == 0) {
			// this is probably an error -- warn about it
			System.err.println("WARNING: filelist for copying from directory "
							+ srcDir + ": no files found");
		} else {
			try {
				for (int i = 0; i < files.length; i++) {
					String fileName = files[i];
					File src = new File(srcDir, fileName);
					File dest = new File(targetDir, fileName);
					
					if (mVerbose) 
						log("Copying "
								+ (setExec ? "exec" : "resource")
								+ " file to \"" + bundlePath(dest) +"\"");
					
					mFileUtils.copyFile(src, dest);
					if (setExec)
						setExecutable(dest);
				}
			} catch (IOException ex) {
				throw new BuildException("Cannot copy jar file: " + ex);
			}
		}
	}
}
 
Example #6
Source File: HelpBook.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addFileList(FileList fileList) {
	fileLists.add(fileList);
}
 
Example #7
Source File: CCGBankTaskTemplates.java    From openccg with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Gets the list of files contained in <code>group</code> as an array.
 * The order of files in the returned array is the same as the order 
 * of <code>group</code>'s {@link FileList#getFiles(Project) files}.
 */
@Override
protected File[] getFiles(FileList group) {
	Project proj = getProject();
	return makeFiles(group.getDir(proj), group.getFiles(proj));
}
 
Example #8
Source File: CCGBankTaskTemplates.java    From openccg with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Creates a new xsltProcessors object (no-arg constructor required by Ant).
 */
public CCGBankTaskTemplates() {
	super(new ArrayList<FileList>());
}
 
Example #9
Source File: CompileTask.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Sets the source files.
 */
public void addSources(FileList list) {
  this.sourceFileLists.add(list);
}
 
Example #10
Source File: CompileTask.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Sets the externs file.
 */
public void addExterns(FileList list) {
  this.externFileLists.add(list);
}
 
Example #11
Source File: AddPathTask.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public void addFilelist(FileList fl) throws BuildException {
    toAdd.addFilelist(fl);
}
 
Example #12
Source File: AntTask.java    From forbidden-apis with Apache License 2.0 4 votes vote down vote up
/** List of files with API signatures as <signaturesFileList/> nested element */
public FileList createSignaturesFileList() {
  return addSignaturesResource(new FileList());
}
 
Example #13
Source File: JarBundler.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addExtraclasspathfilelist(FileList fl) {
	mExtraClassPathFileLists.add(fl);
}
 
Example #14
Source File: JarBundler.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addJavafilelist(FileList fl) {
	mJavaFileLists.add(fl);
}
 
Example #15
Source File: JarBundler.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addResourcefilelist(FileList fl) {
	mResourceFileLists.add(fl);
}
 
Example #16
Source File: JarBundler.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addExecfilelist(FileList fl) {
	mExecFileLists.add(fl);
}
 
Example #17
Source File: JarBundler.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public void addJarfilelist(FileList fl) {
	mJarFileLists.add(fl);
}
 
Example #18
Source File: CCGBankTaskTemplates.java    From openccg with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Adds a file list to the list of transforms.
 * @param fileList The <code>FileList</code> object to add.
 */
public void addConfiguredFilelist(FileList fileList) {
	addGroup(fileList);
}