use of org.gradle.gradleplugin.foundation.favorites.FavoriteTask 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;
}
use of org.gradle.gradleplugin.foundation.favorites.FavoriteTask 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);
}
use of org.gradle.gradleplugin.foundation.favorites.FavoriteTask in project gradle by gradle.
the class FavoritesEditorWrapper method editFavorite.
public String editFavorite(FavoriteTaskVersion1 favoriteTaskVersion1, final String newFullCommandLine, final String newDisplayName, final boolean newAlwaysShowOutput) {
final StringHolder stringHolder = new StringHolder();
FavoriteTask favoriteTask = getFavoriteTask(favoriteTaskVersion1);
favoritesEditor.editFavorite(favoriteTask, new FavoritesEditor.EditFavoriteInteraction() {
public boolean editFavorite(FavoritesEditor.EditibleFavoriteTask favoriteTask) {
favoriteTask.fullCommandLine = newFullCommandLine;
favoriteTask.displayName = newDisplayName;
favoriteTask.alwaysShowOutput = newAlwaysShowOutput;
return true;
}
public void reportError(String error) {
stringHolder.string = error;
}
});
return stringHolder.string;
}
use of org.gradle.gradleplugin.foundation.favorites.FavoriteTask in project gradle by gradle.
the class FavoriteTasksTab method populate.
private void populate() {
model.clear();
Iterator<FavoriteTask> taskIterator = favoritesEditor.getFavoriteTasks().iterator();
while (taskIterator.hasNext()) {
FavoriteTask favoriteTask = taskIterator.next();
model.addElement(favoriteTask);
}
}
use of org.gradle.gradleplugin.foundation.favorites.FavoriteTask in project gradle by gradle.
the class GradlePluginLord method addExecutionRequestToQueue.
/**
* 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 Request addExecutionRequestToQueue(List<FavoriteTask> favorites) {
if (favorites.isEmpty()) {
return null;
}
FavoriteTask firstFavoriteTask = favorites.get(0);
String displayName;
String fullCommandLine;
boolean alwaysShowOutput = firstFavoriteTask.alwaysShowOutput();
if (favorites.size() == 1) {
displayName = firstFavoriteTask.getDisplayName();
fullCommandLine = firstFavoriteTask.getFullCommandLine();
} else {
displayName = "Multiple (" + firstFavoriteTask.getDisplayName() + ", ... )";
fullCommandLine = FavoritesEditor.combineFavoriteCommandLines(favorites);
}
return addExecutionRequestToQueue(fullCommandLine, displayName, alwaysShowOutput);
}
Aggregations