private void handlePluginAdded(@NotNull PluginDescriptor pluginDescriptor) {
    if (myExternalBuildPlugins.contains(pluginDescriptor)) {
      return;
    }
    SourceRootTypeRegistryImpl.getInstance().clearCache();
    Set<String> before = new HashSet<>();
    for (JpsModelSerializerExtension extension : loadExtensions(JpsModelSerializerExtension.class)) {
      for (JpsModuleSourceRootPropertiesSerializer<?> serializer : extension.getModuleSourceRootPropertiesSerializers()) {
        before.add(serializer.getTypeId());
      }
    }

    myExternalBuildPlugins.add(pluginDescriptor);
    myModificationStamp.incrementAndGet();

    Map<String, JpsModuleSourceRootPropertiesSerializer<?>> added = new HashMap<>();
    for (JpsModelSerializerExtension extension : loadExtensions(JpsModelSerializerExtension.class)) {
      for (JpsModuleSourceRootPropertiesSerializer<?> serializer : extension.getModuleSourceRootPropertiesSerializers()) {
        added.put(serializer.getTypeId(), serializer);
      }
    }
    added.keySet().removeAll(before);
    
    if (!added.isEmpty()) {
      for (Project project : ProjectManager.getInstance().getOpenProjects()) {
        updateCustomRootTypes(project, added.values());
      }
    }
  }
private void handlePluginAdded(@NotNull PluginDescriptor pluginDescriptor)