Search in sources :

Example 1 with FavoriteTaskVersion1

use of org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1 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)

Example 2 with FavoriteTaskVersion1

use of org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1 in project gradle by gradle.

the class FavoritesEditorWrapper method getFavoriteTasks.

public List<FavoriteTaskVersion1> getFavoriteTasks() {
    List<FavoriteTaskVersion1> returnedTasks = new ArrayList<FavoriteTaskVersion1>();
    Iterator<FavoriteTask> taskIterator = favoritesEditor.getFavoriteTasks().iterator();
    while (taskIterator.hasNext()) {
        FavoriteTask favoriteTask = taskIterator.next();
        returnedTasks.add(new FavoriteTaskWrapper(favoriteTask));
    }
    return returnedTasks;
}
Also used : FavoriteTaskVersion1(org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1) ArrayList(java.util.ArrayList) FavoriteTask(org.gradle.gradleplugin.foundation.favorites.FavoriteTask)

Example 3 with FavoriteTaskVersion1

use of org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1 in project gradle by gradle.

the class FavoritesEditorWrapper method removeFavorites.

public void removeFavorites(List<FavoriteTaskVersion1> favoritesToRemove) {
    List<FavoriteTask> favoriteTasksToRemove = new ArrayList<FavoriteTask>();
    Iterator<FavoriteTaskVersion1> iterator = favoritesToRemove.iterator();
    while (iterator.hasNext()) {
        FavoriteTaskVersion1 favoriteTaskVersion1 = iterator.next();
        favoriteTasksToRemove.add(getFavoriteTask(favoriteTaskVersion1));
    }
    favoritesEditor.removeFavorites(favoriteTasksToRemove);
}
Also used : FavoriteTaskVersion1(org.gradle.openapi.external.foundation.favorites.FavoriteTaskVersion1) ArrayList(java.util.ArrayList) FavoriteTask(org.gradle.gradleplugin.foundation.favorites.FavoriteTask)

Aggregations

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