You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/05/31 19:57:29 UTC

svn commit: r543195 - in /incubator/stdcxx/trunk/etc/config/windows: build.wsf utilities.js

Author: faridz
Date: Thu May 31 10:57:28 2007
New Revision: 543195

URL: http://svn.apache.org/viewvc?view=rev&rev=543195
Log:
2007-05-31 Farid Zaripov <Fa...@epam.com>

	* build.wsf (getBuildLog): New function to extract data from BuildLog.htm;
	(event_ProjectBuildStarted): Added checking function parameter != null;
	(event_ProjectBuildFinished): If Cfg == null find path to the BuildLog.htm
	in Output window;
	(BuildProject): Invoke event_ProjectBuildStarted() and
	event_ProjectBuildFinished() on ICC.
	* utilities.js (stipTags): Remove additional html tags from buildlog.

Modified:
    incubator/stdcxx/trunk/etc/config/windows/build.wsf
    incubator/stdcxx/trunk/etc/config/windows/utilities.js

Modified: incubator/stdcxx/trunk/etc/config/windows/build.wsf
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/build.wsf?view=diff&rev=543195&r1=543194&r2=543195
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/build.wsf (original)
+++ incubator/stdcxx/trunk/etc/config/windows/build.wsf Thu May 31 10:57:28 2007
@@ -73,20 +73,21 @@
     // clear output window
     outputPane.Clear();
 
-    // delete old BuildLog.htm
-    var path = Cfg.Evaluate(Cfg.IntermediateDirectory) + "\\BuildLog.htm";
-    if (fso.FileExists(path))
-        fso.DeleteFile(path);
+    if (null != Cfg)
+    {
+        // delete old BuildLog.htm
+        var path = Cfg.Evaluate(Cfg.IntermediateDirectory) + "\\BuildLog.htm";
+        if (fso.FileExists(path))
+            fso.DeleteFile(path);
+    }
 }
 
-function event_ProjectBuildFinished(Cfg, Warnings, Errors, Canceled)
+function getBuildLog(path)
 {
     var log = "";
 
     try
     {
-        // try get log from BuildLog.htm file
-        var path = Cfg.Evaluate(Cfg.IntermediateDirectory) + "\\BuildLog.htm";
         var ForReading = 1;
         var format = UNICODELOG ? -1 : 0;
         var logStrm = fso.OpenTextFile(path, ForReading, false, format);
@@ -99,10 +100,53 @@
     }
     catch (e)
     {
+        log = "";
+    }
+
+    return log;
+}
+
+function event_ProjectBuildFinished(Cfg, Warnings, Errors, Canceled)
+{
+    var log = "";
+    var htm = "BuildLog.htm";
+
+    if (null != Cfg)
+    {
+        try
+        {
+            // try get log from BuildLog.htm file
+            var path = Cfg.Evaluate(Cfg.IntermediateDirectory) + "\\" + htm;
+            log = getBuildLog(path);
+        }
+        catch (e)
+        {
+            log = "";
+        }
+    }
+
+    if (0 == log.length)
+    {
         // try get log from output window
         var sel = outputPane.TextDocument.Selection;
         sel.SelectAll();
         log = sel.Text;
+
+        // find BuildLoh.htm path
+        var proto = "file://";
+        var begin = log.indexOf(proto);
+        if (0 <= begin)
+        {
+            begin += proto.length;
+            var end = log.indexOf(htm, begin);
+            if (0 <= end)
+            {
+                var path = log.substring(begin, end + htm.length);
+                var log2 = getBuildLog(path);
+                if (0 < log2.length)
+                    log = log2;
+            }
+        }
     }
 
     WScript.Echo(log);
@@ -121,7 +165,18 @@
 
     if (null != projectFile)
     {
+        var isICC = 0 < projectFile.indexOf(".icproj");
+
+        if (isICC)
+            // event not invoked automatically for Intel projects
+            event_ProjectBuildStarted(null);
+
         solutionBuild.BuildProject(longConfName, projectFile, true);
+
+        if (isICC)
+            // event not invoked automatically for Intel projects
+            event_ProjectBuildFinished(null, 0, 0, 0);
+
         return solutionBuild.LastBuildInfo;
     }
 

Modified: incubator/stdcxx/trunk/etc/config/windows/utilities.js
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/utilities.js?view=diff&rev=543195&r1=543194&r2=543195
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/utilities.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/utilities.js Thu May 31 10:57:28 2007
@@ -321,7 +321,9 @@
            .replace(new RegExp("(^<[\\s\\S]+?>)", "gm"), "")
            .replace(new RegExp("\r", "g"), "")
            .replace(new RegExp("\n{2,}", "g"), "\n\n")
-           .replace(new RegExp("</pre>", "g"), "");
+           .replace(new RegExp("</pre>", "g"), "")
+           .replace(new RegExp("</h3>", "g"), "")
+           .replace(new RegExp("</font>", "g"), "");
 }
 
 // returns source string without first character if it equal to symbol