Search in sources :

Example 51 with FileSet

use of org.apache.tools.ant.types.FileSet in project ceylon-compiler by ceylon.

the class CeylonCompileAntTask method addToCompileList.

private void addToCompileList(List<File> dirs) {
    for (File srcDir : dirs) {
        if (srcDir.isDirectory()) {
            FileSet fs = (FileSet) this.files.clone();
            fs.setDir(srcDir);
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            String[] files = ds.getIncludedFiles();
            for (String fileName : files) compileList.add(new File(srcDir, fileName));
        }
    }
}
Also used : FileSet(org.apache.tools.ant.types.FileSet) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) JarFile(java.util.jar.JarFile) File(java.io.File)

Example 52 with FileSet

use of org.apache.tools.ant.types.FileSet in project processdash by dtuma.

the class PackageLaunchProfile method calculateContentToken.

private String calculateContentToken() throws IOException {
    List<File> files = new ArrayList<File>();
    for (FileSet fs : filesets) {
        DirectoryScanner ds = fs.getDirectoryScanner(getProject());
        for (String name : ds.getIncludedFiles()) files.add(new File(ds.getBasedir(), name));
    }
    if (files.isEmpty())
        throw new BuildException("You must designate at least one file " + "to include in the launch profile.");
    Collections.sort(files, FILENAME_SORTER);
    Checksum ck = new Adler32();
    for (File f : files) calcChecksum(f, ck);
    return Long.toString(Math.abs(ck.getValue()), Character.MAX_RADIX);
}
Also used : FileSet(org.apache.tools.ant.types.FileSet) Checksum(java.util.zip.Checksum) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) ArrayList(java.util.ArrayList) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) Adler32(java.util.zip.Adler32)

Aggregations

FileSet (org.apache.tools.ant.types.FileSet)52 File (java.io.File)38 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)26 IOException (java.io.IOException)20 BuildException (org.apache.tools.ant.BuildException)13 Project (org.apache.tools.ant.Project)11 ArrayList (java.util.ArrayList)10 Iterator (java.util.Iterator)4 FileInputStream (java.io.FileInputStream)3 Test (org.junit.Test)3 AbstractProject (hudson.model.AbstractProject)2 VirtualChannel (hudson.remoting.VirtualChannel)2 URL (java.net.URL)2 URLClassLoader (java.net.URLClassLoader)2 LinkedHashSet (java.util.LinkedHashSet)2 LinkedList (java.util.LinkedList)2 StringTokenizer (java.util.StringTokenizer)2 ZipEntry (java.util.zip.ZipEntry)2 ZipFile (java.util.zip.ZipFile)2 Project (aQute.bnd.build.Project)1