mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
Moved ConsoleOutputSniffer from make.core plugin.
Added minimal console parser interface.
This commit is contained in:
parent
96d33f7198
commit
fc915aee25
8 changed files with 53 additions and 23 deletions
|
@ -23,9 +23,9 @@ import org.eclipse.cdt.core.ErrorParserManager;
|
||||||
import org.eclipse.cdt.core.model.ICModelMarker;
|
import org.eclipse.cdt.core.model.ICModelMarker;
|
||||||
import org.eclipse.cdt.core.resources.ACBuilder;
|
import org.eclipse.cdt.core.resources.ACBuilder;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
||||||
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ConsoleOutputSniffer;
|
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.make.core.scannerconfig;
|
package org.eclipse.cdt.make.core.scannerconfig;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IConsoleParser;
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
@ -19,7 +20,7 @@ import org.eclipse.core.runtime.IPath;
|
||||||
*
|
*
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
public interface IScannerInfoConsoleParser {
|
public interface IScannerInfoConsoleParser extends IConsoleParser {
|
||||||
/**
|
/**
|
||||||
* One time initialization of a console parser.
|
* One time initialization of a console parser.
|
||||||
*
|
*
|
||||||
|
@ -30,17 +31,5 @@ public interface IScannerInfoConsoleParser {
|
||||||
*/
|
*/
|
||||||
public void startup(IProject project, IPath workingDirectory,
|
public void startup(IProject project, IPath workingDirectory,
|
||||||
IScannerInfoCollector collector, IMarkerGenerator markerGenerator);
|
IScannerInfoCollector collector, IMarkerGenerator markerGenerator);
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse one line of output.
|
|
||||||
*
|
|
||||||
* @param line
|
|
||||||
* @return true if scanner info entry was found in the line
|
|
||||||
*/
|
|
||||||
public boolean processLine(String line);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional finalization of a console parser.
|
|
||||||
*/
|
|
||||||
public void shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.make.internal.core.scannerconfig;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
|
|
|
@ -20,13 +20,13 @@ import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.CommandLauncher;
|
import org.eclipse.cdt.core.CommandLauncher;
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
||||||
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ConsoleOutputSniffer;
|
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
||||||
|
|
|
@ -20,13 +20,13 @@ import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
||||||
import org.eclipse.cdt.make.core.MakeBuilder;
|
import org.eclipse.cdt.make.core.MakeBuilder;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ConsoleOutputSniffer;
|
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2005-03-23 Vladimir Hirsl
|
||||||
|
Moved ConsoleOutputSniffer from make.core plugin.
|
||||||
|
Added minimal console parser interface.
|
||||||
|
+ src/org/eclipse/cdt/core/IConsoleParser.java
|
||||||
|
+ src/org/eclipse/cdt/internal/core/ConsoleOutputSniffer.java
|
||||||
|
|
||||||
2005-03-19 Alain Magloire
|
2005-03-19 Alain Magloire
|
||||||
PR 87336: Did not check if the resource exists.
|
PR 87336: Did not check if the resource exists.
|
||||||
* model/org/eclipse/cdt/internal/core/model/Archive.java
|
* model/org/eclipse/cdt/internal/core/model/Archive.java
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A basic interface for console parsers
|
||||||
|
*
|
||||||
|
* @author vhirsl
|
||||||
|
*/
|
||||||
|
public interface IConsoleParser {
|
||||||
|
/**
|
||||||
|
* Parse one line of output.
|
||||||
|
*
|
||||||
|
* @param line
|
||||||
|
* @return true if line was successfully processed; skip other console parsers<p>
|
||||||
|
* false - try other console parsers
|
||||||
|
*/
|
||||||
|
public boolean processLine(String line);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finalization of a console parser when the stream is closed.
|
||||||
|
*/
|
||||||
|
public void shutdown();
|
||||||
|
|
||||||
|
}
|
|
@ -8,15 +8,16 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig;
|
package org.eclipse.cdt.internal.core;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.*;
|
import org.eclipse.cdt.core.IConsoleParser;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercepts an output to console and forwards it to line parsers for processing
|
* Intercepts an output to console and forwards it to console parsers for processing
|
||||||
*
|
*
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
|
@ -117,13 +118,13 @@ public class ConsoleOutputSniffer {
|
||||||
private int nOpens = 0;
|
private int nOpens = 0;
|
||||||
private OutputStream consoleOutputStream;
|
private OutputStream consoleOutputStream;
|
||||||
private OutputStream consoleErrorStream;
|
private OutputStream consoleErrorStream;
|
||||||
private IScannerInfoConsoleParser[] parsers;
|
private IConsoleParser[] parsers;
|
||||||
|
|
||||||
public ConsoleOutputSniffer(IScannerInfoConsoleParser[] parsers) {
|
public ConsoleOutputSniffer(IConsoleParser[] parsers) {
|
||||||
this.parsers = parsers;
|
this.parsers = parsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsoleOutputSniffer(OutputStream outputStream, OutputStream errorStream, IScannerInfoConsoleParser[] parsers) {
|
public ConsoleOutputSniffer(OutputStream outputStream, OutputStream errorStream, IConsoleParser[] parsers) {
|
||||||
this(parsers);
|
this(parsers);
|
||||||
this.consoleOutputStream = outputStream;
|
this.consoleOutputStream = outputStream;
|
||||||
this.consoleErrorStream = errorStream;
|
this.consoleErrorStream = errorStream;
|
Loading…
Add table
Reference in a new issue