package org.implab.gradle.common.sources;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.gradle.api.Named;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.Directory;
import org.gradle.api.file.FileCollection;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Copy;
import org.gradle.api.tasks.TaskProvider;

@NonNullByDefault
public final class ArtifactAssembly implements Named {
    private final String name;
    private final ConfigurableFileCollection sources;
    private final ConfigurableFileCollection output;
    private final Provider<Directory> outputDirectory;
    private final TaskProvider<Copy> task;

    ArtifactAssembly(
            String name,
            ConfigurableFileCollection sources,
            Provider<Directory> outputDirectory,
            TaskProvider<Copy> task,
            ConfigurableFileCollection output) {
        this.name = name;
        this.sources = sources;
        this.outputDirectory = outputDirectory;
        this.task = task;
        this.output = output;
    }

    @Override
    public String getName() {
        return name;
    }

    public ConfigurableFileCollection getSources() {
        return sources;
    }

    public FileCollection getOutput() {
        return output;
    }

    public Provider<Directory> getOutputDirectory() {
        return outputDirectory;
    }

    public TaskProvider<Copy> getTask() {
        return task;
    }
}
