|
From: <caw...@us...> - 2007-08-17 15:21:58
|
Revision: 2995
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2995&view=rev
Author: cawilliams
Date: 2007-08-17 08:21:56 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix #5580 - Warnings from CompilationParticipant subclasses aren't get set as markers on files
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java 2007-08-17 15:03:31 UTC (rev 2994)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java 2007-08-17 15:21:56 UTC (rev 2995)
@@ -44,4 +44,8 @@
return this.resource.toString();
}
+public CategorizedProblem[] getProblems() {
+ return problems;
}
+
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java 2007-08-17 15:03:31 UTC (rev 2994)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java 2007-08-17 15:21:56 UTC (rev 2995)
@@ -8,6 +8,12 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.rubypeople.rdt.core.IRubyProject;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.compiler.BuildContext;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
+import org.rubypeople.rdt.core.compiler.CompilationParticipant;
+import org.rubypeople.rdt.internal.core.RubyModelManager;
import org.rubypeople.rdt.internal.core.util.ListUtil;
public abstract class AbstractRdtCompiler {
@@ -52,6 +58,7 @@
monitor.worked(filesToClear);
compileFiles(files, monitor);
+
monitor.done();
}
@@ -62,7 +69,7 @@
if (monitor.isCanceled())
return;
compiler.compileFile(list, monitor);
- }
+ }
for (IFile file : list) {
if (monitor.isCanceled())
return;
@@ -70,9 +77,37 @@
monitor.subTask(file.getFullPath().toString());
compileFile(file, monitor);
}
+ BuildContext[] contexts = getBuildContexts(list);
+ CompilationParticipant[] participants = RubyModelManager.getRubyModelManager().compilationParticipants.getCompilationParticipants(getRubyProject());
+ if (participants != null) {
+ for (int i = 0; i < participants.length; i++) {
+ if (monitor.isCanceled())
+ return;
+ participants[i].buildStarting(contexts, true);
+ }
+ }
+ for (int i = 0; i < contexts.length; i++) {
+ CategorizedProblem[] problems = contexts[i].getProblems();
+ if (problems == null || problems.length == 0) continue;
+ for (int j = 0; j < problems.length; j++) {
+ markerManager.addProblem(contexts[i].getFile(), problems[j]);
+ }
+ }
}
- private void compileFile(IFile file, IProgressMonitor monitor) throws CoreException {
+ private BuildContext[] getBuildContexts(List<IFile> list) {
+ List<BuildContext> contexts = new ArrayList<BuildContext>();
+ for (IFile file : list) {
+ contexts.add(new BuildContext(file));
+ }
+ return contexts.toArray(new BuildContext[contexts.size()]);
+ }
+
+ private IRubyProject getRubyProject() {
+ return RubyCore.create(project);
+ }
+
+ private void compileFile(IFile file, IProgressMonitor monitor) throws CoreException {
for (Iterator<SingleFileCompiler> cIter = singleFileCompilers.iterator(); cIter.hasNext();) {
SingleFileCompiler fileCompiler = cIter.next();
fileCompiler.compileFile(file);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|