Search in sources :

Example 1 with LayoutFileSet

use of jetbrains.antlayout.util.LayoutFileSet in project intellij-community by JetBrains.

the class RenamedFileContainer method build.

@Override
public List<LayoutFileSet> build(TempFileFactory temp) {
    final LayoutFileSet fileSet = new LayoutFileSet();
    final File destFile = temp.allocateTempFile(newName);
    copyTask.setProject(getProject());
    copyTask.setFile(new File(filePath.replace('/', File.separatorChar)));
    copyTask.setTofile(destFile);
    copyTask.perform();
    fileSet.setFile(destFile);
    return Collections.singletonList(fileSet);
}
Also used : LayoutFileSet(jetbrains.antlayout.util.LayoutFileSet) File(java.io.File)

Example 2 with LayoutFileSet

use of jetbrains.antlayout.util.LayoutFileSet in project intellij-community by JetBrains.

the class RootContainer method copySet.

private void copySet(LayoutFileSet set) {
    Copy task = new Copy();
    task.setTaskName("copy");
    task.setProject(getProject());
    String prefix = set.getPrefix(getProject());
    File target = prefix.length() > 0 ? new File(destDirectory, prefix + "/") : destDirectory;
    target.mkdirs();
    task.setTodir(target);
    LayoutFileSet unprefixed = (LayoutFileSet) set.clone();
    unprefixed.setPrefix("");
    task.addFileset(unprefixed);
    task.perform();
}
Also used : Copy(org.apache.tools.ant.taskdefs.Copy) LayoutFileSet(jetbrains.antlayout.util.LayoutFileSet) File(java.io.File)

Example 3 with LayoutFileSet

use of jetbrains.antlayout.util.LayoutFileSet in project intellij-community by JetBrains.

the class ZipContainer method build.

public List<LayoutFileSet> build(TempFileFactory temp) {
    List<LayoutFileSet> built = super.build(temp);
    File dest = temp.allocateTempFile(name);
    task.setProject(getProject());
    task.setDestFile(dest);
    for (LayoutFileSet set : built) {
        task.addZipfileset(set);
    }
    LayoutFileSet result = new LayoutFileSet();
    result.setFile(dest);
    task.perform();
    return Arrays.asList(result);
}
Also used : LayoutFileSet(jetbrains.antlayout.util.LayoutFileSet) File(java.io.File)

Example 4 with LayoutFileSet

use of jetbrains.antlayout.util.LayoutFileSet in project intellij-community by JetBrains.

the class Container method build.

public List<LayoutFileSet> build(TempFileFactory temp) {
    Set<LayoutFileSet> result = new LinkedHashSet<LayoutFileSet>();
    for (Content child : children) {
        for (LayoutFileSet set : child.build(temp)) {
            result.add(createCopy(set));
        }
    }
    ArrayList<LayoutFileSet> list = new ArrayList<LayoutFileSet>(result);
    for (LayoutFileSet set : list) {
        if (includes != null) {
            set.setIncludes(includes);
        }
        if (excludes != null) {
            set.setExcludes(excludes);
        }
    }
    return list;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ArrayList(java.util.ArrayList) LayoutFileSet(jetbrains.antlayout.util.LayoutFileSet)

Example 5 with LayoutFileSet

use of jetbrains.antlayout.util.LayoutFileSet in project intellij-community by JetBrains.

the class DirContainer method build.

public List<LayoutFileSet> build(TempFileFactory temp) {
    List<LayoutFileSet> unprefixed = super.build(temp);
    List<LayoutFileSet> prefixed = new ArrayList<LayoutFileSet>();
    for (LayoutFileSet set : unprefixed) {
        LayoutFileSet copy = createCopy(set);
        copy.setPrefix(dirName + "/" + set.getPrefix(getProject()));
        prefixed.add(copy);
    }
    return prefixed;
}
Also used : ArrayList(java.util.ArrayList) LayoutFileSet(jetbrains.antlayout.util.LayoutFileSet)

Aggregations

LayoutFileSet (jetbrains.antlayout.util.LayoutFileSet)6 File (java.io.File)4 ArrayList (java.util.ArrayList)2 LinkedHashSet (java.util.LinkedHashSet)1 Copy (org.apache.tools.ant.taskdefs.Copy)1 PatternSet (org.apache.tools.ant.types.PatternSet)1