Search in sources :

Example 1 with CheckstyleBuilder

use of net.sf.eclipsecs.core.builder.CheckstyleBuilder in project eclipse-cs by checkstyle.

the class RunCheckstyleOnFilesJob method runInWorkspace.

/**
 * {@inheritDoc}
 */
@Override
public final IStatus runInWorkspace(final IProgressMonitor monitor) throws CoreException {
    try {
        Map<IProject, List<IFile>> projectFilesMap = getFilesSortedToProject(mFilesToCheck);
        for (Map.Entry<IProject, List<IFile>> entry : projectFilesMap.entrySet()) {
            IProject project = entry.getKey();
            List<IFile> files = entry.getValue();
            IProjectConfiguration checkConfig = ProjectConfigurationFactory.getConfiguration(project);
            filter(files, checkConfig);
            CheckstyleBuilder builder = new CheckstyleBuilder();
            builder.handleBuildSelection(files, checkConfig, monitor, project, IncrementalProjectBuilder.INCREMENTAL_BUILD);
        }
    } catch (CheckstylePluginException e) {
        Status status = new Status(IStatus.ERROR, CheckstylePlugin.PLUGIN_ID, IStatus.ERROR, e.getLocalizedMessage(), e);
        throw new CoreException(status);
    }
    return Status.OK_STATUS;
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IFile(org.eclipse.core.resources.IFile) CoreException(org.eclipse.core.runtime.CoreException) CheckstyleBuilder(net.sf.eclipsecs.core.builder.CheckstyleBuilder) IProjectConfiguration(net.sf.eclipsecs.core.projectconfig.IProjectConfiguration) CheckstylePluginException(net.sf.eclipsecs.core.util.CheckstylePluginException) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) IProject(org.eclipse.core.resources.IProject)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 CheckstyleBuilder (net.sf.eclipsecs.core.builder.CheckstyleBuilder)1 IProjectConfiguration (net.sf.eclipsecs.core.projectconfig.IProjectConfiguration)1 CheckstylePluginException (net.sf.eclipsecs.core.util.CheckstylePluginException)1 IFile (org.eclipse.core.resources.IFile)1 IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1