4 Visual Studio 2010 Build Script
6 $Id: Build.py 87 2008-08-15 19:03:36Z bok $
15 # Setup some path stuff
17 if environ
['VISUALSTUDIO_BIN']:
18 VSBINDIR
= environ
['VISUALSTUDIO_BIN']
20 # Use default value for visual studio.
21 VSBINDIR
= 'C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE'
22 print 'VISUALSTUDIO_BIN not set. Trying default value:'
27 # ------------------------------------------------------------
29 # ------------------------------------------------------------
32 print 'Error: %s' % (errMsg
)
37 print ' %s -s <path to solution> -b [Release|Debug|etc.]' % (sys
.argv
[0])
39 print ' REQUIRED OPTIONS'
40 print '\t-s <solution>'
41 print '\t-b <configuration>'
43 print ' BUILD OPTIONS'
44 print '\t-c\tMake clean'
45 print '\t-r\tRe-build all'
48 # ------------------------------------------------------------
50 # ------------------------------------------------------------
52 opts
, args
= getopt
.getopt(sys
.argv
[1:], "s:b:rc")
53 except getopt
.GetoptError
, (msg
, opt
):
54 # print 'Error: invalid argument, %s: %s' % (opt, msg)
55 usage('invalid argument, %s: %s' % (opt
, msg
))
76 if rebuildAll
and makeClean
:
77 usage('Error cannot specify -c and -r together')
82 if rebuildAll
: buildSwitch
= 'rebuild'
83 elif makeClean
: buildSwitch
= 'clean'
85 cmd_list
= ['%s/devenv.com' % VSBINDIR
, '/%s' % buildSwitch
, buildName
, solutionFile
]
86 cmd
= " ".join(cmd_list
)
89 retVal
= subprocess
.call(cmd_list
)
90 # only the least sig 8 bits are the real return value
93 print '** BUILD FAILURE **'
95 except NameError, (name
):
96 usage('missing argument %s' % (name
))