use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class UpgradesAction method writeIncompatiblePlugins.
private void writeIncompatiblePlugins(JsonWriter jsonWriter, List<Plugin> incompatiblePlugins) {
jsonWriter.name(ARRAY_INCOMPATIBLE).beginArray();
for (Plugin incompatiblePlugin : incompatiblePlugins) {
jsonWriter.beginObject();
pluginWSCommons.writePlugin(jsonWriter, incompatiblePlugin);
jsonWriter.endObject();
}
jsonWriter.endArray();
}
use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class UpdatesAction method writePluginUpdateAggregate.
private void writePluginUpdateAggregate(JsonWriter jsonWriter, PluginUpdateAggregate aggregate) {
jsonWriter.beginObject();
Plugin plugin = aggregate.getPlugin();
pluginWSCommons.writePlugin(jsonWriter, plugin);
writeUpdates(jsonWriter, aggregate.getUpdates());
jsonWriter.endObject();
}
use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class PluginUpdateAggregator method aggregate.
public Collection<PluginUpdateAggregate> aggregate(@Nullable Collection<PluginUpdate> pluginUpdates) {
if (pluginUpdates == null || pluginUpdates.isEmpty()) {
return Collections.emptyList();
}
Map<Plugin, PluginUpdateAggregateBuilder> builders = Maps.newHashMap();
for (PluginUpdate pluginUpdate : pluginUpdates) {
Plugin plugin = pluginUpdate.getPlugin();
PluginUpdateAggregateBuilder builder = builders.get(plugin);
if (builder == null) {
builder = PluginUpdateAggregateBuilder.builderFor(plugin);
builders.put(plugin, builder);
}
builder.add(pluginUpdate);
}
return Lists.newArrayList(transform(builders.values(), BuilderToPluginUpdateAggregate.INSTANCE));
}
use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class PluginWSCommons method writeUpdateProperties.
/**
* Write the update properties to the specified jsonwriter.
* <pre>
* "status": "COMPATIBLE",
* "requires": [
* {
* "key": "java",
* "name": "Java",
* "description": "SonarQube rule engine."
* }
* ]
* </pre>
*/
public void writeUpdateProperties(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
jsonWriter.prop(PROPERTY_STATUS, toJSon(pluginUpdate.getStatus()));
jsonWriter.name(ARRAY_REQUIRES).beginArray();
Release release = pluginUpdate.getRelease();
for (Plugin child : filter(transform(release.getOutgoingDependencies(), ReleaseToArtifact.INSTANCE), Plugin.class)) {
jsonWriter.beginObject();
jsonWriter.prop(PROPERTY_KEY, child.getKey());
jsonWriter.prop(PROPERTY_NAME, child.getName());
jsonWriter.prop(PROPERTY_DESCRIPTION, child.getDescription());
jsonWriter.endObject();
}
jsonWriter.endArray();
}
use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class UpgradesActionTest method createSonar_51_update.
private static SonarUpdate createSonar_51_update() {
Plugin brandingPlugin = Plugin.factory("branding").setCategory("Integration").setName("Branding").setDescription("Allows to add your own logo to the SonarQube UI.").setHomepageUrl("http://docs.codehaus.org/display/SONAR/Branding+Plugin").setLicense("GNU LGPL 3").setOrganization("SonarSource").setOrganizationUrl("http://www.sonarsource.com").setIssueTrackerUrl("http://jira.sonarsource.com/browse/SONARPLUGINS/component/14663").setSourcesUrl("https://github.com/SonarCommunity/sonar-branding");
Plugin viewsPlugin = Plugin.factory("views").setName("Views").setCategory("Governance").setDescription("Create aggregation trees to group projects. Projects can for instance be grouped by applications, applications by team, teams by department.").setHomepageUrl("https://redirect.sonarsource.com/plugins/views.html").setLicense("Commercial").setOrganization("SonarSource").setOrganizationUrl("http://www.sonarsource.com").setTermsConditionsUrl("http://dist.sonarsource.com/SonarSource_Terms_And_Conditions.pdf").setIssueTrackerUrl("http://jira.sonarsource.com/browse/VIEWS");
release = new Release(new Sonar(), Version.create("5.1.0.5498")).setDate(DateUtils.parseDate("2015-04-02")).setDescription("New overall layout, merge Issues Drilldown [...]").setDownloadUrl("http://dist.sonar.codehaus.org/sonarqube-5.1.zip").setChangelogUrl("http://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=11694&version=20666");
SonarUpdate sonarUpdate = new SonarUpdate(release);
sonarUpdate.addIncompatiblePlugin(brandingPlugin);
sonarUpdate.addPluginToUpgrade(new Release(viewsPlugin, Version.create("2.8.0.5498")).setDisplayVersion("2.8 (build 5498)"));
return sonarUpdate;
}
Aggregations