Commit adef049e authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Implemented configurab;e parsing of instances in the tool output

parent 48ea2d41
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -5,8 +5,10 @@ import re
pattern=re.compile("\[[^[:]*:\d*]")
pattern=re.compile("\[[^[:]*:\d*]")
START_REF="(\\"
START_REF="(\\"
END_REF=" )"
END_REF=" )"
PREFIX_REF="@{"
#PREFIX_REF="@{"
SUFFIX_REF="}@"
#SUFFIX_REF="}@"
PREFIX_REF=""
SUFFIX_REF=""
MODE_IMMED=0
MODE_IMMED=0
MODE_SINGLE=1
MODE_SINGLE=1
MODE_ONCE=1
MODE_ONCE=1
+11 −1
Original line number Original line Diff line number Diff line
@@ -121,6 +121,10 @@ public class VDTProgramRunner {
        String patternWarnings=combinePatterns(buildParamsItem.getWarnings(),runConfig.getPatternWarnings()) ;
        String patternWarnings=combinePatterns(buildParamsItem.getWarnings(),runConfig.getPatternWarnings()) ;
        String patternInfo=    combinePatterns(buildParamsItem.getInfo(),    runConfig.getPatternInfo()) ;
        String patternInfo=    combinePatterns(buildParamsItem.getInfo(),    runConfig.getPatternInfo()) ;


        String instCapture=  buildParamsItem.getinstCapture();
        String instSeparator=buildParamsItem.getInstSeparator();
        String instSuffix=   buildParamsItem.getInstSuffix(); 
        
        IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
        IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
        subMonitor.beginTask(Txt.s("Launch.Message.Launching"), 2);
        subMonitor.beginTask(Txt.s("Launch.Message.Launching"), 2);
        subMonitor.subTask(Txt.s("Launch.Message.ConstructingCommandLine"));
        subMonitor.subTask(Txt.s("Launch.Message.ConstructingCommandLine"));
@@ -132,6 +136,9 @@ public class VDTProgramRunner {
        	System.out.println("patternErrors= \""+  patternErrors+"\"");
        	System.out.println("patternErrors= \""+  patternErrors+"\"");
        	System.out.println("patternWarnings= \""+patternWarnings+"\"");
        	System.out.println("patternWarnings= \""+patternWarnings+"\"");
        	System.out.println("patternInfo= \""    +patternInfo+"\"");
        	System.out.println("patternInfo= \""    +patternInfo+"\"");
        	System.out.println("instCapture= \""    +instCapture+"\"");
        	System.out.println("instSeparator= \""  +instSeparator+"\"");
        	System.out.println("instSuffix= \""     +instSuffix+"\"");
        	System.out.println((isShell?"Shell":"Tool")+" to launch=\""+toolTolaunch+"\"");
        	System.out.println((isShell?"Shell":"Tool")+" to launch=\""+toolTolaunch+"\"");
        	if (arguments!=null){
        	if (arguments!=null){
        		for (int i=0;i<arguments.length;i++){
        		for (int i=0;i<arguments.length;i++){
@@ -210,7 +217,10 @@ public class VDTProgramRunner {
        		process,
        		process,
        		patternErrors,
        		patternErrors,
        		patternWarnings,
        		patternWarnings,
        		patternInfo
        		patternInfo,
        		instCapture,
        		instSeparator,
        		instSuffix
        		);
        		);
        
        
        subMonitor.worked(1);
        subMonitor.worked(1);
+20 −10
Original line number Original line Diff line number Diff line
@@ -71,6 +71,11 @@ public class CommandLinesNodeReader extends AbstractConditionNodeReader {
        String errors  =      XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_ERRORS_ATTR);
        String errors  =      XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_ERRORS_ATTR);
        String warnings  =    XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_WARNINGS_ATTR);
        String warnings  =    XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_WARNINGS_ATTR);
        String info  =        XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INFO_ATTR);
        String info  =        XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INFO_ATTR);

        String inst_capture = XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INSTANCE_CAPTURE);
        String inst_separator=XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INSTANCE_SEPARATOR);
        String inst_suffix =  XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INSTANCE_SUFFIX);

        String prompt  =      XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_PROMPT_ATTR);
        String prompt  =      XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_PROMPT_ATTR);
        String interrupt  =   XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INTERRUPT_ATTR);
        String interrupt  =   XMLConfig.getAttributeValue(node, XMLConfig.CONTEXT_LINEBLOCK_INTERRUPT_ATTR);
        
        
@@ -108,6 +113,11 @@ public class CommandLinesNodeReader extends AbstractConditionNodeReader {
                                     errors,
                                     errors,
                                     warnings,
                                     warnings,
                                     info,
                                     info,

                                     inst_capture,
                                     inst_separator,
                                     inst_suffix,

                                     prompt,
                                     prompt,
                                     interrupt,
                                     interrupt,
                                     stderr,
                                     stderr,
+6 −1
Original line number Original line Diff line number Diff line
@@ -157,6 +157,11 @@ public class XMLConfig extends Config {
    static final String CONTEXT_LINEBLOCK_ERRORS_ATTR =   "errors";
    static final String CONTEXT_LINEBLOCK_ERRORS_ATTR =   "errors";
    static final String CONTEXT_LINEBLOCK_WARNINGS_ATTR = "warnings";
    static final String CONTEXT_LINEBLOCK_WARNINGS_ATTR = "warnings";
    static final String CONTEXT_LINEBLOCK_INFO_ATTR =     "info";
    static final String CONTEXT_LINEBLOCK_INFO_ATTR =     "info";
//Regular expressions for capturing hierarchical names    
    static final String CONTEXT_LINEBLOCK_INSTANCE_CAPTURE =  "instance-capture";
    static final String CONTEXT_LINEBLOCK_INSTANCE_SEPARATOR ="instance-separator";
    static final String CONTEXT_LINEBLOCK_INSTANCE_SUFFIX =   "instance-suffix";
    
    static final String CONTEXT_LINEBLOCK_PROMPT_ATTR =   "prompt";
    static final String CONTEXT_LINEBLOCK_PROMPT_ATTR =   "prompt";
    static final String CONTEXT_LINEBLOCK_INTERRUPT_ATTR ="interrupt";
    static final String CONTEXT_LINEBLOCK_INTERRUPT_ATTR ="interrupt";
    static final String CONTEXT_LINEBLOCK_STDERR_ATTR =   "stderr";
    static final String CONTEXT_LINEBLOCK_STDERR_ATTR =   "stderr";
+17 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,11 @@ public class BuildParamsItem implements Cloneable{
    private String toolErrors;   // Eclipse pattern for pattern recognizer
    private String toolErrors;   // Eclipse pattern for pattern recognizer
    private String toolWarnings; // Eclipse pattern for pattern recognizer
    private String toolWarnings; // Eclipse pattern for pattern recognizer
    private String toolInfo;     // Eclipse pattern for pattern recognizer
    private String toolInfo;     // Eclipse pattern for pattern recognizer

    private String instCapture;  // RegEx to extract hierarchical name form tool output (may need extra "()" around)
    private String instSeparator;// RegEx to split name segments (i.e. "\.")
    private String instSuffix;   // RegEx to remove tool-generated name suffixes, like "_reg|_suffix2|suffix3" 
    
    // for commands being sent to opened remote console:
    // for commands being sent to opened remote console:
    private String prompt;       // relevant for commands sent to remote console - double prompt means "done" (extra separator on input) 
    private String prompt;       // relevant for commands sent to remote console - double prompt means "done" (extra separator on input) 
    private String interrupt;    // control character(s) to interrupt console command 
    private String interrupt;    // control character(s) to interrupt console command 
@@ -66,6 +71,9 @@ public class BuildParamsItem implements Cloneable{
		    String toolErrors,
		    String toolErrors,
		    String toolWarnings,
		    String toolWarnings,
		    String toolInfo,
		    String toolInfo,
		    String instCapture,
		    String instSeparator,
		    String instSuffix, 
		    String prompt, 
		    String prompt, 
		    String interrupt, 
		    String interrupt, 
		    String stderr,
		    String stderr,
@@ -83,6 +91,9 @@ public class BuildParamsItem implements Cloneable{
		this.toolErrors=toolErrors;
		this.toolErrors=toolErrors;
		this.toolWarnings=toolWarnings;
		this.toolWarnings=toolWarnings;
		this.toolInfo=toolInfo;
		this.toolInfo=toolInfo;
        this.instCapture=instCapture;
        this.instSeparator=instSeparator;
        this.instSuffix=instSuffix; 
		this.prompt=prompt; 
		this.prompt=prompt; 
		this.interrupt=interrupt; 
		this.interrupt=interrupt; 
		this.stderr=stderr;
		this.stderr=stderr;
@@ -102,6 +113,9 @@ public class BuildParamsItem implements Cloneable{
				item.toolErrors,
				item.toolErrors,
				item.toolWarnings,
				item.toolWarnings,
				item.toolInfo,
				item.toolInfo,
				item.instCapture,
				item.instSeparator,
				item.instSuffix, 
				item.prompt,
				item.prompt,
				item.interrupt,
				item.interrupt,
				item.stderr,
				item.stderr,
@@ -155,6 +169,9 @@ public class BuildParamsItem implements Cloneable{
	public String getErrors()       { return toolErrors; }
	public String getErrors()       { return toolErrors; }
	public String getWarnings()     { return toolWarnings; }
	public String getWarnings()     { return toolWarnings; }
	public String getInfo()         { return toolInfo; }
	public String getInfo()         { return toolInfo; }
	public String getinstCapture()  { return instCapture; }
	public String getInstSeparator(){ return instSeparator; }
	public String getInstSuffix()   { return instSuffix; }
	public String getPrompt()       { return prompt; }
	public String getPrompt()       { return prompt; }
	public String getInterrupt()    { return interrupt; }
	public String getInterrupt()    { return interrupt; }
	public String getStderr()       { return stderr; }
	public String getStderr()       { return stderr; }
Loading