Skip to content

Commit

Permalink
steps: added support for VS2012 via msbuild
Browse files Browse the repository at this point in the history
 - the step is called MsBuild as the same code would work for VS2010
   (barring the environment variable name)
 - this new step allows for building drivers as the new Windows Driver Kit 8 integrates into VS2012
   (you can target Vista, Win7 and Win8)
  • Loading branch information
os12 committed Sep 26, 2012
1 parent 6a0fea1 commit b25c1fe
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions master/buildbot/steps/vstudio.py
Expand Up @@ -96,19 +96,21 @@ class VisualStudio(ShellCommand):

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 = 'release',
config = None,
platform = None,
useenv = False,
project = None,
INCLUDE = [],
Expand All @@ -119,6 +121,7 @@ def __init__(self,
self.mode = mode
self.projectfile = projectfile
self.config = config
self.platform = platform
self.useenv = useenv
self.project = project
if len(INCLUDE) > 0:
Expand Down Expand Up @@ -261,7 +264,7 @@ def setupEnvironment(self, cmd):
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")
Expand Down Expand Up @@ -357,3 +360,33 @@ class VC10(VC9):
default_installdir = 'C:\\Program Files\\Microsoft Visual Studio 10.0'

VS2010 = VC10

class MsBuild(VC10):
def setupEnvironment(self, cmd):
VisualStudio.setupEnvironment(self, cmd)
cmd.args['env']['VCENV_BAT'] = "\"${VS110COMNTOOLS}..\\..\\VC\\vcvarsall.bat\""

def describe(self, done=False):
s = "building "
if done:
s = "built "
if self.project is not None:
s += "%s for %s|%s" % (self.project, self.config, self.platform)
else:
s += "solution for %s|%s" % (self.config, self.platform)
return s.split()

def start(self):
command = ["%VCENV_BAT%"]
command.append("x86")
command.append("&&")
command.append("msbuild")
command.append(self.projectfile)
command.append("/p:Configuration=%s" % (self.config))
command.append("/p:Platform=%s" % (self.platform))
if self.project is not None:
command.append("/t:%s" % (self.project))

self.setCommand(command)

return VisualStudio.start(self)

0 comments on commit b25c1fe

Please sign in to comment.