-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure third-party classpath is reloaded by extracting common reset c…
…ode to a single class (#630)
- Loading branch information
Showing
7 changed files
with
60 additions
and
79 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
src/main/java/org/infernus/idea/checkstyle/ConfigurationInvalidator.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,37 @@ | ||
package org.infernus.idea.checkstyle; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import org.infernus.idea.checkstyle.checker.CheckerFactoryCache; | ||
import org.infernus.idea.checkstyle.config.PluginConfiguration; | ||
import org.infernus.idea.checkstyle.config.PluginConfigurationManager; | ||
import org.infernus.idea.checkstyle.model.ConfigurationLocation; | ||
import org.infernus.idea.checkstyle.util.TempDirProvider; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ConfigurationInvalidator { | ||
|
||
private final Project project; | ||
private final CheckstyleProjectService checkstyleProjectService; | ||
private final PluginConfigurationManager pluginConfigurationManager; | ||
private final CheckerFactoryCache checkerFactoryCache; | ||
|
||
ConfigurationInvalidator(@NotNull final Project project) { | ||
this.project = project; | ||
this.checkstyleProjectService = project.getService(CheckstyleProjectService.class); | ||
this.checkerFactoryCache = project.getService(CheckerFactoryCache.class); | ||
this.pluginConfigurationManager = project.getService(PluginConfigurationManager.class); | ||
} | ||
|
||
public void invalidateCachedResources() { | ||
checkerFactoryCache.invalidate(); | ||
|
||
PluginConfiguration config = pluginConfigurationManager.getCurrent(); | ||
config.getLocations().forEach(ConfigurationLocation::reset); | ||
|
||
checkstyleProjectService.activateCheckstyleVersion(config.getCheckstyleVersion(), config.getThirdPartyClasspath()); | ||
if (!config.isCopyLibs()) { | ||
new TempDirProvider().deleteCopiedLibrariesDir(project); | ||
} | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
</p> | ||
]]> | ||
</description> | ||
<version>5.87.0</version> | ||
<version>5.87.1</version> | ||
<idea-version since-build="231.9392.1"/> | ||
<vendor url="https://infernus.org/" email="[email protected]">Jamie Shiell</vendor> | ||
|
||
|
@@ -24,6 +24,7 @@ | |
<change-notes> | ||
<![CDATA[ | ||
<ul> | ||
<li>5.87.1: New: Third-party classpath is re-read on configuration reset (#630).</li> | ||
<li>5.87.0: Fixed: Exceptions when opening modal dialogues (#628).</li> | ||
<li>5.87.0: New: Now built against IDEA 2023.1.5 (was 2022.1.4).</li> | ||
<li>5.86.0: New: Added Checkstyle 10.13.0, 10.12.7.</li> | ||
|
@@ -59,6 +60,7 @@ | |
<projectService serviceImplementation="org.infernus.idea.checkstyle.config.ProjectConfigurationState"/> | ||
<projectService serviceImplementation="org.infernus.idea.checkstyle.CheckstylePluginApi"/> | ||
<projectService serviceImplementation="org.infernus.idea.checkstyle.util.ProjectFilePaths"/> | ||
<projectService serviceImplementation="org.infernus.idea.checkstyle.ConfigurationInvalidator"/> | ||
|
||
<postStartupActivity implementation="org.infernus.idea.checkstyle.startup.NotifyUserIfPluginUpdated"/> | ||
<postStartupActivity implementation="org.infernus.idea.checkstyle.startup.DisableCheckstyleLogging"/> | ||
|