/*
 * Copyright 2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gradle.nativebinaries;

import org.gradle.api.DomainObjectSet;
import org.gradle.api.Incubating;
import org.gradle.api.Named;
import org.gradle.internal.HasInternalProtocol;
import org.gradle.language.base.LanguageSourceSet;

/**
 * Represents a logical software component, which may be built in a number of variant binaries.
 */
@Incubating @HasInternalProtocol
public interface ProjectNativeComponent extends Named {
    /**
     * Returns a human-consumable display name for this component.
     */
    String getDisplayName();

    /**
     * The binaries that are built for this component. You can use this to configure the binaries for this component.
     */
    DomainObjectSet<NativeBinary> getBinaries();

    /**
     * The source sets that are used to build this component.
     */
    DomainObjectSet<LanguageSourceSet> getSource();

    /**
     * Adds one or more {@link org.gradle.language.base.LanguageSourceSet}s that are used to compile this binary.
     * <p/>
     * This method accepts the following types:
     *
     * <ul>
     *     <li>A {@link org.gradle.language.base.FunctionalSourceSet}</li>
     *     <li>A {@link org.gradle.language.base.LanguageSourceSet}</li>
     *     <li>A Collection of {@link org.gradle.language.base.LanguageSourceSet}s</li>
     * </ul>
     */
    void source(Object source);

    /**
     * The name that is used to construct the output file names when building this component.
     */
    String getBaseName();

    /**
     * Sets the name that is used to construct the output file names when building this component.
     */
    void setBaseName(String baseName);

    /**
     * Specifies one or more {@link org.gradle.nativebinaries.Flavor}s that this component should be built for.
     * <p/>
     * This method accepts the following types:
     *
     * <ul>
     *     <li>The String name of the flavor to build.</li>
     * </ul>
     */
    void targetFlavors(Object... flavorSelectors);

    /**
     * Specifies one or more {@link org.gradle.nativebinaries.platform.Platform}s that this component should be built for.
     * <p/>
     * This method accepts the following types:
     *
     * <ul>
     *     <li>The String name of the platform to target.</li>
     * </ul>
     */
    void targetPlatforms(Object... platformSelectors);

    /**
     * Specifies one or more {@link org.gradle.nativebinaries.BuildType}s that this component should be built for.
     * <p/>
     * This method accepts the following types:
     *
     * <ul>
     *     <li>The String name of a build type.</li>
     * </ul>
     */
    void targetBuildTypes(Object... platformSelectors);

}
