-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-Reload and safer Plugin-Repositories
- Allow "auto-reload"-Settings to be configured - Improved #1: Added a separate "safer" way to configure plugin repositories for a project. Using the new provider plugin repositories are not added to the global plugin repository list but are rather used for update checking and checking required plugins whenever the project is open and the plugin is loaded.
- Loading branch information
Showing
8 changed files
with
161 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/de/gebit/intellij/autoconfig/plugins/AutoConfigUpdateSettingsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.gebit.intellij.autoconfig.plugins; | ||
|
||
import com.intellij.openapi.updateSettings.impl.UpdateSettingsProvider; | ||
import de.gebit.intellij.autoconfig.ConfigurationLoaderService; | ||
import de.gebit.intellij.autoconfig.handlers.CommonConfigurationHandler; | ||
import de.gebit.intellij.autoconfig.model.GeneralConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* "Safer" Plugin-Repository Provider which does not persist the configured plugin repository. This provider is used when checking for required | ||
* plugins and when checking for plugin updates. | ||
*/ | ||
public class AutoConfigUpdateSettingsProvider implements UpdateSettingsProvider { | ||
|
||
@NotNull | ||
@Override | ||
public List<String> getPluginRepositories() { | ||
List<String> pluginRepositories = new ArrayList<>(); | ||
com.intellij.openapi.project.ProjectUtil.getOpenedProjects().iterator().forEachRemaining(project -> { | ||
ConfigurationLoaderService projectService = project.getService(ConfigurationLoaderService.class); | ||
final Optional<GeneralConfiguration> configuration = projectService.getConfiguration(CommonConfigurationHandler.CONFIGURATION_CLASS, CommonConfigurationHandler.CONFIG_FILE_NAME); | ||
configuration.map(GeneralConfiguration::getPluginRepositories).ifPresent(pluginRepositories::addAll); | ||
}); | ||
return pluginRepositories; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<idea-plugin url="https://gitlab.local.gebit.de/intellij/trend-tools"> | ||
<id>de.gebit.intellij.autoconfig</id> | ||
<name>Autoconfig</name> | ||
<vendor email="info@gebit.de" url="https://www.gebit.de">GEBIT Solutions GmbH</vendor> | ||
<vendor email="jetbrains@gebit.de" url="https://github.com/GEBIT/autoconfig-intellij-plugin">GEBIT Solutions GmbH</vendor> | ||
|
||
<version>0.0.0</version> | ||
<idea-version since-build="231.1"/> | ||
<vendor url="https://github.com/GEBIT/autoconfig-intellij-plugin" | ||
email="[email protected]">GEBIT Solutions GmbH</vendor> | ||
<version>0.0.1</version> | ||
<idea-version since-build="232.1"/> | ||
<description><![CDATA[ | ||
TODO: HTML text describing the autoconfig plugin functionality. | ||
]]> | ||
|
@@ -33,6 +31,7 @@ | |
<postStartupActivity implementation="de.gebit.intellij.autoconfig.AutoconfigStartup"/> | ||
<notificationGroup displayType="BALLOON" id="Autoconfig"/> | ||
<formatOnSaveOptions.defaultsProvider implementation="de.gebit.intellij.autoconfig.FormatOnSaveOptionsDefaultsProvider"/> | ||
<updateSettingsProvider implementation="de.gebit.intellij.autoconfig.plugins.AutoConfigUpdateSettingsProvider"/> | ||
</extensions> | ||
<extensions defaultExtensionNs="JavaScript.JsonSchema"> | ||
<ProviderFactory implementation="de.gebit.intellij.autoconfig.json.ConfigurationJsonSchemeProviderFactory"/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters