package org.implab.gradle.common.sources;

import java.util.HashMap;
import java.util.Map;

import org.gradle.api.Action;
import org.gradle.api.Named;
import org.gradle.api.NamedDomainObjectProvider;

import org.gradle.api.artifacts.ConfigurationPublications;
import org.gradle.api.plugins.ExtensionAware;

public abstract class BuildVariant implements Named, ExtensionAware {

    private final Map<String, VariantSourceSet> variantSourceSets = new HashMap<>();

    private final SourceSetsSpec sourceSetsSpec = new SourceSetsSpec();

    public void sourceSets(Action<? super SourceSetsSpec> action) {
        action.execute(sourceSetsSpec);
    }

    public class SourceSetsSpec {
        void add(NamedDomainObjectProvider<GenericSourceSet> sourceSet) {
            var variantSourceSet = new VariantSourceSet(sourceSet);
            variantSourceSets.put(sourceSet.getName(), variantSourceSet);
        }
    }
}
