forked from xenserver/win-xenvbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdv.py
53 lines (40 loc) · 1.18 KB
/
sdv.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!python -u
import os, sys
import datetime
import re
import glob
import tarfile
import subprocess
def shell(command):
print(command)
sys.stdout.flush()
pipe = os.popen(command, 'r', 1)
for line in pipe:
print(line.rstrip())
return pipe.close()
class msbuild_failure(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def msbuild(name, target, args):
cwd = os.getcwd()
os.environ['PLATFORM'] = 'x64'
os.environ['CONFIGURATION'] = 'Windows 8 Release'
os.environ['TARGET'] = target
os.environ['BUILD_FILE'] = name + '.vcxproj'
os.environ['BUILD_ARGS'] = args
os.chdir('proj')
os.chdir(name)
status = shell('..\\msbuild.bat')
os.chdir(cwd)
# if (status != None):
# raise msbuild_failure(sdv_arg)
if __name__ == '__main__':
msbuild('xencrsh', 'sdv', '/p:Inputs="/clean"')
msbuild('xenvbd', 'sdv', '/p:Inputs="/clean"')
msbuild('xencrsh', 'sdv', '/p:Inputs="/check:default.sdv"')
msbuild('xenvbd', 'sdv', '/p:Inputs="/check:default.sdv"')
msbuild('xencrsh', 'dvl', '')
msbuild('xenvbd', 'dvl', '')
#archive the dvl.xmls