fixed Bug 8850 "Errors in the .pkg file are not marked in the editor." RCL_2_0
authorssobek
Mon, 20 Apr 2009 10:47:45 -0500
branchRCL_2_0
changeset 101 508f2f2592b2
parent 100 b7cd497951b7
child 103 de4b04f4ec57
fixed Bug 8850 "Errors in the .pkg file are not marked in the editor."
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/MakeSisErrorParser.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/MakeSisErrorParser.java	Thu Apr 16 14:40:22 2009 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/MakeSisErrorParser.java	Mon Apr 20 10:47:45 2009 -0500
@@ -22,19 +22,37 @@
 
 public class MakeSisErrorParser extends CarbideBaseErrorParser {
 	
+	String packageFile = null;
+	
 	public MakeSisErrorParser() {
 	}
 
 	public boolean processLine(String aLine, ErrorParserManager aErrorParserManager) {
-		// Known patterns.
+		// Known patterns:
+		//
 		// (a)
 		// filename(lineno) : description
+		// OR
+		// (lineno) : description 
 		//
 		// (b)
 		// filename(lineno) : Warning: description
+		// OR
+		// (lineno) : Warning: description
 		//
 		// (c)
 		// filename(lineno) : Error: description
+		// OR
+		// (lineno) : Error: description
+		
+		if (   aLine.contains("makesis.exe ")) {
+			int packageStart = aLine.indexOf("makesis.exe ") + "makesis.exe ".length();
+			int packageEnd   = aLine.indexOf(' ', packageStart);
+			// store the name of the package file for cases above where
+			// the line number is shown without the package filename
+			if (packageEnd != -1)
+				packageFile = aLine.substring(packageStart, packageEnd);
+		}
 		
 		if (aLine.equalsIgnoreCase("error: invalid destination file")){
 			msgSeverity = IMarkerGenerator.SEVERITY_ERROR_BUILD;
@@ -46,6 +64,17 @@
 			aErrorParserManager.generateMarker(null, -1, aLine, msgSeverity, null);
 		}
 		
+		// if line starts with (lineno):, prefix it with the package file name
+		if (   aLine.indexOf(':') >= 2
+			&& aLine.charAt(0) == '('
+			&& aLine.charAt(aLine.indexOf(':') - 2) == ')') {
+			try {
+				Integer.parseInt(aLine.substring(1, aLine.indexOf(':') - 2));
+				aLine = packageFile + aLine;
+			} catch (NumberFormatException nfe) {
+			}
+		}
+		
 		if (!setFirstColon(aLine)) {
 			return false;
 		}