All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraftforge.gradle.delayed.DelayedFileTree Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package net.minecraftforge.gradle.delayed;

import net.minecraftforge.gradle.ZipFileTree;

import org.gradle.api.Project;
import org.gradle.api.file.FileTree;
import org.gradle.api.internal.file.collections.FileTreeAdapter;

@SuppressWarnings("serial")
public class DelayedFileTree extends DelayedBase
{
    private boolean zipTree = false;

    public DelayedFileTree(Project owner, String pattern)
    {
        super(owner, pattern);
    }

    public DelayedFileTree(Project owner, String pattern, boolean zipTree)
    {
        super(owner, pattern);
        this.zipTree = zipTree;
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public DelayedFileTree(Project owner, String pattern, IDelayedResolver... resolvers)
    {
        super(owner, pattern, resolvers);
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public DelayedFileTree(Project owner, String pattern, boolean zipTree, IDelayedResolver... resolvers)
    {
        super(owner, pattern, resolvers);
        this.zipTree = zipTree;
    }

    @Override
    public FileTree resolveDelayed()
    {
        if (zipTree)
            //resolved = project.zipTree(DelayedString.resolve(pattern, project, resolvers));
            return new FileTreeAdapter(new ZipFileTree(project.file(DelayedBase.resolve(pattern, project, resolvers))));
        else
            return project.fileTree(DelayedBase.resolve(pattern, project, resolvers));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy