[Buildbot-devel] Visual Studio: new build step

Oleg Smolsky oleg at smolsky.net
Thu Sep 20 05:28:42 UTC 2012


An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20120919/837afaed/attachment.html>
-------------- next part --------------
--- vstudio.py.orig     2012-09-19 11:10:00.000000000 -0700
+++ vstudio.py  2012-09-19 11:49:05.000000000 -0700
@@ -92,19 +92,21 @@

     projectfile = None
     config = None
+    platform = None
     useenv = False
     project = None
     PATH = []
     INCLUDE = []
     LIB = []

-    renderables = [ 'projectfile', 'config', 'project' ]
+    renderables = [ 'projectfile', 'config', 'platform', 'project' ]

     def __init__(self,
                 installdir = None,
                 mode = "rebuild",
                 projectfile = None,
                 config = None,
+                platform = None,
                 useenv = False,
                 project = None,
                 INCLUDE = [],
@@ -115,6 +117,7 @@
         self.mode = mode
         self.projectfile = projectfile
         self.config = config
+        self.platform = platform
         self.useenv = useenv
         self.project = project
         if len(INCLUDE) > 0:
@@ -132,6 +135,7 @@
             mode = mode,
             projectfile = projectfile,
             config = config,
+            platform = platform,
             useenv = useenv,
             project = project,
             INCLUDE = INCLUDE,
@@ -270,7 +274,7 @@
         addEnvPath(cmd.args['env'], "LIB", VCInstallDir + '\\SDK\\v1.1\\lib')

     def start(self):
-        command = ["devenv.com"]
+        command = ["devenv"]
         command.append(self.projectfile)
         if self.mode == "rebuild":
             command.append("/Rebuild")
@@ -363,3 +367,33 @@
     default_installdir = 'C:\\Program Files\\Microsoft Visual Studio 10.0'

 VS2010 = VC10
+
+class MsBuild(VC10):
+    default_installdir = 'c:\\vs2012'
+
+    def setupEnvironment(self, cmd):
+        VC10.setupEnvironment(self, cmd)
+
+        env = cmd.args['env']
+        addEnvPath(env, "PATH", 'c:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319')
+        env["FrameworkDir"] = "C:\\WINDOWS\\Microsoft.NET\Framework"
+        env["FrameworkDIR32"] = "C:\\WINDOWS\\Microsoft.NET\\Framework"
+        env["FrameworkVersion"] = "v4.0.30319"
+        env["FrameworkVersion32"] = "v4.0.30319"
+
+    def start(self):
+        command = ["msbuild"]
+        command.append(self.projectfile)
+        command.append("/p:Configuration=%s" % (self.config))
+        command.append("/p:Platform=%s" % (self.platform))
+#        if self.mode == "rebuild":
+#            command.append("/t:rebuild")
+        if self.project is not None:
+            command.append("/t:%s" % (self.project))
+
+        self.setCommand(command)
+
+        return VisualStudio.start(self)


More information about the devel mailing list