information added to response of WS listing installed pluging and pending operations on plugins
*/
package org.sonar.server.platform;
-import com.google.common.collect.Lists;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+
+import javax.annotation.Nullable;
+
import org.sonar.api.config.EmailSettings;
import org.sonar.api.issue.action.Actions;
import org.sonar.api.platform.ComponentContainer;
import org.sonar.server.ws.ListingWs;
import org.sonar.server.ws.WebServiceEngine;
-import javax.annotation.Nullable;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
+import com.google.common.collect.Lists;
class ServerComponents {
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.collect.Ordering;
+import java.util.Comparator;
+import javax.annotation.Nonnull;
import org.sonar.api.platform.PluginMetadata;
import org.sonar.api.utils.text.JsonWriter;
import org.sonar.updatecenter.common.Artifact;
import org.sonar.updatecenter.common.Release;
import org.sonar.updatecenter.common.UpdateCenter;
-import javax.annotation.Nonnull;
-import java.util.Comparator;
-
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.transform;
import static java.lang.String.CASE_INSENSITIVE_ORDER;
static final String OBJECT_RELEASE = "release";
static final String ARRAY_REQUIRES = "requires";
static final String PROPERTY_UPDATE_CENTER_REFRESH = "updateCenterRefresh";
+ static final String PROPERTY_IMPLEMENTATION_BUILD = "implementationBuild";
public static final Ordering<PluginMetadata> NAME_KEY_PLUGIN_METADATA_COMPARATOR = Ordering.natural()
.onResultOf(PluginMetadataToName.INSTANCE)
jsonWriter.prop(PROPERTY_ORGANIZATION_URL, pluginMetadata.getOrganizationUrl());
jsonWriter.prop(PROPERTY_HOMEPAGE, pluginMetadata.getHomepage());
jsonWriter.prop(PROPERTY_ISSUE_TRACKER_URL, pluginMetadata.getIssueTrackerUrl());
+ jsonWriter.prop(PROPERTY_IMPLEMENTATION_BUILD, pluginMetadata.getImplementationBuild());
}
public void writeArtifact(JsonWriter jsonWriter, PluginMetadata pluginMetadata) {
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCGIT",
+ "implementationBuild": "9ce9d330c313c296fab051317cc5ad4b26319e07",
"artifact": {
"name": "sonar-scm-git-plugin-1.0.jar"
}
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/java.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARJAVA",
+ "implementationBuild": "65396a609ddface8b311a6a665aca92a7da694f1",
"artifact": {
"name": "sonar-java-plugin-3.0.jar"
}
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCSVN",
+ "implementationBuild": "213fc8a8b582ff530b12dd4a59a6512be1071234",
"artifact": {
"name": "sonar-scm-svn-plugin-1.0.jar"
}
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCGIT",
+ "implementationBuild": "9ce9d330c313c296fab051317cc5ad4b26319e07",
"artifact": {
"name": "sonar-scm-git-plugin-1.0.jar"
}
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/java.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARJAVA",
+ "implementationBuild": "65396a609ddface8b311a6a665aca92a7da694f1",
"artifact": {
"name": "sonar-java-plugin-3.0.jar"
}
"organizationUrl": "http://www.sonarsource.com",
"homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
"issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCSVN",
+ "implementationBuild": "213fc8a8b582ff530b12dd4a59a6512be1071234",
"artifact": {
"name": "sonar-scm-svn-plugin-1.0.jar"
}
*/
package org.sonar.server.plugins.ws;
+import java.io.File;
import org.junit.Test;
import org.sonar.api.platform.PluginMetadata;
import org.sonar.api.platform.PluginRepository;
import org.sonar.core.plugins.DefaultPluginMetadata;
import org.sonar.server.ws.WsTester;
-import java.io.File;
-
import static com.google.common.collect.ImmutableList.of;
import static java.lang.String.valueOf;
import static org.assertj.core.api.Assertions.assertThat;
.setHomepage("homepage_url")
.setIssueTrackerUrl("issueTracker_url")
.setFile(new File(getClass().getResource(jarFilename).toURI()))
+ .setImplementationBuild("sou_rev_sha1")
)
);
" \"organizationUrl\": \"org_url\"," +
" \"homepage\": \"homepage_url\"," +
" \"issueTrackerUrl\": \"issueTracker_url\"," +
+ " \"implementationBuild\": \"sou_rev_sha1\"," +
" \"artifact\":" +
" {" +
" \"name\": \"some.jar\"" +
*/
package org.sonar.server.plugins.ws;
+import java.io.File;
import org.junit.Test;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.plugins.ServerPluginJarsInstaller;
import org.sonar.server.ws.WsTester;
-import java.io.File;
-
import static com.google.common.collect.ImmutableList.of;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
.setOrganizationUrl("http://www.sonarsource.com")
.setHomepage("http://redirect.sonarsource.com/plugins/scmgit.html")
.setIssueTrackerUrl("http://jira.codehaus.org/browse/SONARSCGIT")
- .setFile(new File("/home/user/sonar-scm-git-plugin-1.0.jar"));
+ .setFile(new File("/home/user/sonar-scm-git-plugin-1.0.jar"))
+ .setImplementationBuild("9ce9d330c313c296fab051317cc5ad4b26319e07");
private static final String DUMMY_CONTROLLER_KEY = "dummy";
public static final DefaultPluginMetadata PLUGIN_2_2 = create("key2").setName("name2");
public static final DefaultPluginMetadata PLUGIN_2_1 = create("key1").setName("name2");
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
" \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
" \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
+ " \"implementationBuild\": \"9ce9d330c313c296fab051317cc5ad4b26319e07\"," +
" \"artifact\": {" +
" \"name\": \"sonar-scm-git-plugin-1.0.jar\"" +
" }" +
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
" \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
" \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
+ " \"implementationBuild\": \"9ce9d330c313c296fab051317cc5ad4b26319e07\"," +
" \"artifact\": {" +
" \"name\": \"sonar-scm-git-plugin-1.0.jar\"" +
" }" +
return this;
}
+ @Override
public String getImplementationBuild() {
return implementationBuild;
}
List<String> getRequiredPlugins();
boolean isCore();
+
+ String getImplementationBuild();
}