aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/main/java/org/sonar/batch/bootstrap
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-11-25 16:11:28 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2013-11-25 16:11:28 +0100
commit7e9a3bde0738853e0a26083c910695951cede2f6 (patch)
tree1563236c8110811796a8bdd1bf9c8e0c9d2e49a7 /sonar-batch/src/main/java/org/sonar/batch/bootstrap
parentaf8f783bf9d1f4b91405f02235bd6ed7f396c982 (diff)
downloadsonarqube-7e9a3bde0738853e0a26083c910695951cede2f6.tar.gz
sonarqube-7e9a3bde0738853e0a26083c910695951cede2f6.zip
SONAR-4912 Drop support of deprecated plugin rules extension
Diffstat (limited to 'sonar-batch/src/main/java/org/sonar/batch/bootstrap')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java5
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/PluginDownloader.java29
2 files changed, 15 insertions, 19 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
index e0e7be4ffcb..bcc4c0afd9c 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
@@ -75,11 +75,10 @@ public class BatchPluginRepository implements PluginRepository {
metadataByKey = Maps.newHashMap();
for (RemotePlugin remote : remotePlugins) {
if (filter.accepts(remote.getKey())) {
- List<File> pluginFiles = pluginDownloader.downloadPlugin(remote);
- List<File> extensionFiles = pluginFiles.subList(1, pluginFiles.size());
+ File pluginFile = pluginDownloader.downloadPlugin(remote);
File targetDir = tempDirectories.newDir("plugins/" + remote.getKey());
LOG.debug("Installing plugin {} into {}", remote.getKey(), targetDir.getAbsolutePath());
- PluginMetadata metadata = extractor.install(pluginFiles.get(0), remote.isCore(), extensionFiles, targetDir);
+ PluginMetadata metadata = extractor.install(pluginFile, remote.isCore(), targetDir);
if (StringUtils.isBlank(metadata.getBasePlugin()) || filter.accepts(metadata.getBasePlugin())) {
metadataByKey.put(metadata.getKey(), metadata);
} else {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PluginDownloader.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PluginDownloader.java
index 8af4e2c975e..48e4755c0e5 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PluginDownloader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PluginDownloader.java
@@ -46,24 +46,21 @@ public class PluginDownloader implements BatchComponent {
this.fileCache = fileCache;
}
- public List<File> downloadPlugin(final RemotePlugin remote) {
+ public File downloadPlugin(final RemotePlugin remote) {
try {
- List<File> files = Lists.newArrayList();
- for (final RemotePluginFile file : remote.getFiles()) {
- File cachedFile = fileCache.get(file.getFilename(), file.getHash(), new FileCache.Downloader() {
- public void download(String filename, File toFile) throws IOException {
- String url = "/deploy/plugins/" + remote.getKey() + "/" + file.getFilename();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Download {} to {}", url, toFile.getAbsolutePath());
- } else {
- LOG.info("Download {}", file.getFilename());
- }
- server.download(url, toFile);
+ final RemotePluginFile file = remote.file();
+ File cachedFile = fileCache.get(file.getFilename(), file.getHash(), new FileCache.Downloader() {
+ public void download(String filename, File toFile) throws IOException {
+ String url = "/deploy/plugins/" + remote.getKey() + "/" + file.getFilename();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Download {} to {}", url, toFile.getAbsolutePath());
+ } else {
+ LOG.info("Download {}", file.getFilename());
}
- });
- files.add(cachedFile);
- }
- return files;
+ server.download(url, toFile);
+ }
+ });
+ return cachedFile;
} catch (Exception e) {
throw new SonarException("Fail to download plugin: " + remote.getKey(), e);