Search in sources :

Example 1 with VersionListReader

use of org.infernus.idea.checkstyle.VersionListReader in project checkstyle-idea by jshiell.

the class PluginConfigurationBuilder method defaultConfiguration.

public static PluginConfigurationBuilder defaultConfiguration(final Project project) {
    final String csDefaultVersion = new VersionListReader().getDefaultVersion();
    final SortedSet<ConfigurationLocation> defaultLocations = new TreeSet<>();
    defaultLocations.add(configurationLocationFactory(project).create(BundledConfig.SUN_CHECKS, project));
    defaultLocations.add(configurationLocationFactory(project).create(BundledConfig.GOOGLE_CHECKS, project));
    final boolean copyLibs = OS.isWindows();
    return new PluginConfigurationBuilder(csDefaultVersion, ScanScope.getDefaultValue(), false, copyLibs, defaultLocations, Collections.emptyList(), null, false, CheckStylePlugin.version());
}
Also used : ConfigurationLocation(org.infernus.idea.checkstyle.model.ConfigurationLocation) TreeSet(java.util.TreeSet) VersionListReader(org.infernus.idea.checkstyle.VersionListReader)

Example 2 with VersionListReader

use of org.infernus.idea.checkstyle.VersionListReader in project checkstyle-idea by jshiell.

the class ProjectConfigurationState method readCheckstyleVersion.

@NotNull
private String readCheckstyleVersion(@NotNull final Map<String, String> pLoadedMap) {
    final VersionListReader vlr = new VersionListReader();
    String result = pLoadedMap.get(CHECKSTYLE_VERSION_SETTING);
    if (result == null) {
        result = vlr.getDefaultVersion();
    } else {
        result = vlr.getReplacementMap().getOrDefault(result, result);
    }
    return result;
}
Also used : VersionListReader(org.infernus.idea.checkstyle.VersionListReader) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

VersionListReader (org.infernus.idea.checkstyle.VersionListReader)2 TreeSet (java.util.TreeSet)1 ConfigurationLocation (org.infernus.idea.checkstyle.model.ConfigurationLocation)1 NotNull (org.jetbrains.annotations.NotNull)1