use of com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference in project gocd by gocd.
the class TaskViewService method allPluginTasks.
private List<PluggableTask> allPluginTasks() {
final ArrayList<PluggableTask> tasks = new ArrayList<>();
for (final String pluginId : PluggableTaskConfigStore.store().pluginIds()) {
GoPluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
if (pluginDescriptor != null && taskPreference != null) {
tasks.add(new PluggableTask(new PluginConfiguration(pluginId, pluginDescriptor.version()), getConfiguration(taskPreference.getConfig())));
}
}
return tasks;
}
use of com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference in project gocd by gocd.
the class PluggableTaskPluginInfoBuilder method pluginInfoFor.
@Override
public PluggableTaskPluginInfo pluginInfoFor(String pluginId) {
if (!store.pluginIds().contains(pluginId)) {
return null;
}
GoPluginDescriptor plugin = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = store.preferenceFor(pluginId);
List<PluginConfiguration> pluginConfigurations = configurations(taskPreference.getConfig());
PluginView pluginView = new PluginView(taskPreference.getView().template());
return new PluggableTaskPluginInfo(plugin, taskPreference.getView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
use of com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference in project gocd by gocd.
the class PluggableTaskViewModelBuilder method allPluginInfos.
public List<PluginInfo> allPluginInfos() {
List<PluginInfo> pluginInfos = new ArrayList<>();
for (String pluginId : PluggableTaskConfigStore.store().pluginIds()) {
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
pluginInfos.add(new PluginInfo(descriptor, TaskExtension.TASK_EXTENSION, taskPreference.getView().displayValue(), null, null));
}
return pluginInfos;
}
use of com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference in project gocd by gocd.
the class TaskViewServiceTest method storeTaskPreferences.
private void storeTaskPreferences(String pluginId, Property... properties) {
FakeTask task = new FakeTask(properties);
PluggableTaskConfigStore.store().setPreferenceFor(pluginId, new TaskPreference(task));
}
use of com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference in project gocd by gocd.
the class TaskViewServiceTest method storeTaskPreferences.
private void storeTaskPreferences(String pluginId, String... properties) {
FakeTask task = new FakeTask(properties);
PluggableTaskConfigStore.store().setPreferenceFor(pluginId, new TaskPreference(task));
}
Aggregations