Package org.sonar.api.platform

Examples of org.sonar.api.platform.PluginMetadata


    PluginFilter filter = new PluginFilter(settings, analysisMode);
    metadataByKey = Maps.newHashMap();
    for (RemotePlugin remote : remotePlugins) {
      if (filter.accepts(remote.getKey())) {
        File pluginFile = pluginsReferential.pluginFile(remote);
        PluginMetadata metadata = pluginInstaller.installToCache(pluginFile, remote.isCore());
        if (StringUtils.isBlank(metadata.getBasePlugin()) || filter.accepts(metadata.getBasePlugin())) {
          metadataByKey.put(metadata.getKey(), metadata);
        } else {
          LOG.debug("Excluded plugin: " + metadata.getKey());
        }
      }
    }
    classLoaders = new PluginClassloaders(Thread.currentThread().getContextClassLoader());
    pluginsByKey = classLoaders.init(metadataByKey.values());
View Full Code Here


  public Map<PluginMetadata, Plugin> getPluginsByMetadata() {
    Map<PluginMetadata, Plugin> result = Maps.newHashMap();
    for (Map.Entry<String, PluginMetadata> entry : metadataByKey.entrySet()) {
      String pluginKey = entry.getKey();
      PluginMetadata metadata = entry.getValue();
      result.put(metadata, pluginsByKey.get(pluginKey));
    }
    return result;
  }
View Full Code Here

    installPlugins();
  }

  private void installPlugins() {
    for (Map.Entry<PluginMetadata, Plugin> entry : getComponentByType(BatchPluginRepository.class).getPluginsByMetadata().entrySet()) {
      PluginMetadata metadata = entry.getKey();
      Plugin plugin = entry.getValue();
      addExtension(metadata, plugin);
    }
  }
View Full Code Here

    assertThat(container.getComponentByType(Bar.class)).isNotNull();
  }

  @Test
  public void should_install_plugins() {
    PluginMetadata metadata = mock(PluginMetadata.class);
    FakePlugin plugin = new FakePlugin();
    BatchPluginRepository pluginRepository = mock(BatchPluginRepository.class);
    when(pluginRepository.getPluginsByMetadata()).thenReturn(ImmutableMap.<PluginMetadata, Plugin>of(
      metadata, plugin
      ));
View Full Code Here

TOP

Related Classes of org.sonar.api.platform.PluginMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.