stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r574643 - in /incubator/stdcxx/trunk/etc/config/windows: build.wsf generate.wsf
Date Tue, 11 Sep 2007 17:30:35 GMT
Author: faridz
Date: Tue Sep 11 10:30:34 2007
New Revision: 574643

URL: http://svn.apache.org/viewvc?rev=574643&view=rev
Log:
2007-09-11 Farid Zaripov <Farid_Zaripov@epam.com>

	* build.wsf: Added optional parameter TOPDIR. Replace build
	dir path and src dir path in logs to $(BUILDDIR) and $(TOPDIR)
	respectively.
	(removeLogClutter): New function to remove clutters from build log.
	* generate.wsf (generateBuildBatch): Pass /TOPDIR parameter to
	build.wsf script.

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

Modified: incubator/stdcxx/trunk/etc/config/windows/build.wsf
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/build.wsf?rev=574643&r1=574642&r2=574643&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/build.wsf (original)
+++ incubator/stdcxx/trunk/etc/config/windows/build.wsf Tue Sep 11 10:30:34 2007
@@ -28,6 +28,8 @@
                 name="CONFIG" required="true" type="string"/>
             <named helpstring="Output directory for modules" 
                 name="BUILDDIR" required="true" type="string"/>
+            <named helpstring="Top directory of stdcxx sources tree" 
+                name="TOPDIR" required="false" type="string"/>
             <named helpstring="Name of the solution configuration" 
                 name="BUILDTYPE" required="true" type="string"/>
             <named helpstring="Build projects only, do not execute tests" 
@@ -35,10 +37,12 @@
             <example>cscript build.wsf /CONFIG:msvc-7.1 /BUILDTYPE:11d
             </example>
             <usage>
-Usage: cscript build.wsf /CONFIG:@CONFIG /BUILDDIR:@BUILDDIR /BUILDTYPE:@BUILDTYPE [/BUILDONLY:@BUILDONLY]
+Usage: cscript build.wsf /CONFIG:@CONFIG /BUILDDIR:@BUILDDIR
+/TOPDIR:@TOPDIR /BUILDTYPE:@BUILDTYPE [/BUILDONLY:@BUILDONLY]
 where
 @CONFIG is the compiler configuration (msvc-7.1, icc-9.0, etc).
 @BUILDDIR is the root of the build directory.
+@TOPDIR is the root of the stdcxx source tree.
 @BUILDTYPE is the build type (11d, 11s, etc).
 @BUILDONLY is one of { yes, no } - execute or not the tests.
             </usage>
@@ -61,11 +65,15 @@
 // constants
 var currentCfg = "";
 var slnDir = "";
+var srcDir = "";
 var buildType = "";
 var longConfName = "";
 var buildOnly = false;
 var outputPane = null;
+var winconfigDir = "\\etc\\config\\windows";
 var postBuildInvoked;
+var rxBuildDir = null;
+var rxTopDir = null;
 
 var description = new build; // run
 
@@ -107,6 +115,33 @@
     return log;
 }
 
+function removeLogClutter(log)
+{
+    if ("" != slnDir)
+    {
+        if (null == rxBuildDir)
+        {
+            var buildDir = slnDir.replace(/\\/g, "\\\\");
+            rxBuildDir = new RegExp("(" + buildDir + ")", "ig");
+        }
+        log = log.replace(rxBuildDir, "$(BUILDDIR)");
+    }
+
+    if ("" != srcDir)
+    {
+        if (null == rxTopDir)
+        {
+            var topDir = srcDir.replace(/\\/g, "\\\\");
+            rxTopDir = new RegExp("(" + topDir + ")", "ig");
+        }
+        log = log.replace(rxTopDir, "$(TOPDIR)");
+    }
+
+    log = log.replace(/^Build log was saved at.*$/gm, "");
+
+    return log;
+}
+
 function event_ProjectBuildFinished(Cfg, Warnings, Errors, Canceled)
 {
     postBuildInvoked = true;
@@ -159,7 +194,7 @@
             log = log2;
     }
 
-    WScript.Echo(log);
+    WScript.Echo(removeLogClutter(log));
 }
 
 function BuildProject(solutionBuild, projectName)
@@ -214,7 +249,7 @@
     
     dte.SuppressUI = true;
     
-    var solutionName = slnDir + "\\" + currentCfg + "\\" + currentCfg + ".sln";
+    var solutionName = slnDir + "\\" + currentCfg + ".sln";
 
     WScript.Echo("Loading solution...");
     var solution = dte.Solution;
@@ -417,7 +452,22 @@
     currentCfg = WScript.Arguments.Named("CONFIG");
     
     slnDir = WScript.Arguments.Named("BUILDDIR");
-    slnDir = fso.GetAbsolutePathName (slnDir);
+    slnDir = fso.GetAbsolutePathName (slnDir) + "\\" + currentCfg;
+
+    if (WScript.Arguments.Named.Exists("TOPDIR"))
+    {
+        srcDir = WScript.Arguments.Named("TOPDIR");
+    }
+    else
+    {
+        // try to deduce it
+        var myDir = WScript.ScriptFullName;
+        var dirIndex = myDir.indexOf(winconfigDir);
+        if (0 <= dirIndex)
+            srcDir = myDir.substr(0, dirIndex);
+        else
+            srcDir = "";
+    }
 
     buildType = WScript.Arguments.Named("BUILDTYPE");
     

Modified: incubator/stdcxx/trunk/etc/config/windows/generate.wsf
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/generate.wsf?rev=574643&r1=574642&r2=574643&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/generate.wsf (original)
+++ incubator/stdcxx/trunk/etc/config/windows/generate.wsf Tue Sep 11 10:30:34 2007
@@ -428,8 +428,8 @@
 
         buildBatchFile.WriteLine("cscript /nologo "
             + "\"%topdir%\\%scriptdir%\\build.wsf\""
-            + " /BUILDDIR:\"%builddir%\" /BUILDTYPE:%cfgbrief%"
-            + " /CONFIG:" + currentCfg);
+            + " /BUILDDIR:\"%builddir%\" /TOPDIR:\"%topdir%\""
+            + " /BUILDTYPE:%cfgbrief% /CONFIG:" + currentCfg);
         buildBatchFile.WriteLine("cscript /nologo "
             + "\"%topdir%\\%scriptdir%\\%makelog%\""
             + " /BUILDDIR:\"%builddir%\" /BUILDTYPE:%cfgbrief%"



Mime
View raw message