Search in sources :

Example 1 with FavoriteTaskWrapper

use of org.gradle.openapi.wrappers.foundation.favorites.FavoriteTaskWrapper in project gradle by gradle.

the class GradleInterfaceWrapperVersion2 method executeFavorites.

/**
     * Executes several favorites commands at once as a single command. This has the affect of simply concatenating all the favorite command lines into a single line.
     *
     * @param favorites a list of favorites. If just one favorite, it executes it normally. If multiple favorites, it executes them all at once as a single command.
     */
public RequestVersion1 executeFavorites(List<FavoriteTaskVersion1> favorites) {
    List<FavoriteTask> tasks = new ArrayList<FavoriteTask>();
    Iterator<FavoriteTaskVersion1> iterator = favorites.iterator();
    while (iterator.hasNext()) {
        FavoriteTaskVersion1 favoriteTaskVersion1 = iterator.next();
        FavoriteTaskWrapper wrapper = (FavoriteTaskWrapper) favoriteTaskVersion1;
        tasks.add(wrapper.getFavoriteTask());
    }
    return wrapRequest(gradlePluginLord.addExecutionRequestToQueue(tasks));
}
Also used : FavoriteTaskWrapper(org.gradle.openapi.wrappers.foundation.favorites.FavoriteTaskWrapper) FavoriteTaskVersion1(org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1) ArrayList(java.util.ArrayList) FavoriteTask(org.gradle.gradleplugin.foundation.favorites.FavoriteTask)

Aggregations

ArrayList (java.util.ArrayList)1 FavoriteTask (org.gradle.gradleplugin.foundation.favorites.FavoriteTask)1 FavoriteTaskVersion1 (org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1)1 FavoriteTaskWrapper (org.gradle.openapi.wrappers.foundation.favorites.FavoriteTaskWrapper)1