1
2
3 from buildbot.steps.shell import ShellCommand
4 from buildbot.process.buildstep import LogLineObserver
5 from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE
6
7 import re
8
9
11 """ concat a path for this name """
12 try:
13 oldval = env[name]
14 if not oldval.endswith(';'):
15 oldval = oldval + ';'
16 except KeyError:
17 oldval = ""
18 if not value.endswith(';'):
19 value = value + ';'
20 env[name] = oldval + value
21
61
62
64 name = "compile"
65 description = "compiling"
66 descriptionDone = "compile"
67
68 logobserver = None
69
70 installdir = None
71
72
73 mode = "rebuild"
74
75 projectfile = None
76 config = None
77 useenv = False
78 PATH = []
79 INCLUDE = []
80 LIB = []
81
83
84 if 'installdir' in kwargs:
85 self.installdir = kwargs['installdir']
86 del kwargs['installdir']
87 if 'mode' in kwargs:
88 self.config = kwargs['mode']
89 del kwargs['mode']
90 if 'projectfile' in kwargs:
91 self.projectfile = kwargs['projectfile']
92 del kwargs['projectfile']
93 if 'config' in kwargs:
94 self.config = kwargs['config']
95 del kwargs['config']
96 if 'useenv' in kwargs:
97 self.useenv = kwargs['useenv']
98 del kwargs['useenv']
99
100 if 'INCLUDE' in kwargs:
101 self.useenv = True
102 self.INCLUDE = kwargs['INCLUDE']
103 del kwargs['INCLUDE']
104 if 'LIB' in kwargs:
105 self.useenv = True
106 self.LIB = kwargs['LIB']
107 del kwargs['LIB']
108 if 'PATH' in kwargs:
109 self.PATH = kwargs['PATH']
110 del kwargs['PATH']
111
112
113 ShellCommand.__init__(self, **kwargs)
114
118
125
126
139
140
153
159
167
172
173 -class VC6(VisualStudio):
179
181 VisualStudio.setupEnvironment(self, cmd)
182
183 if self.installdir:
184 installdir = self.installdir
185 else:
186 installdir = 'C:\\Program Files\\Microsoft Visual Studio'
187
188
189 VSCommonDir = installdir + '\\Common'
190 MSVCDir = installdir + '\\VC98'
191 MSDevDir = VSCommonDir + '\\msdev98'
192
193
194 addEnvPath(cmd.args['env'], "PATH", MSDevDir + '\\BIN')
195 addEnvPath(cmd.args['env'], "PATH", MSVCDir + '\\BIN')
196 addEnvPath(cmd.args['env'], "PATH", VSCommonDir + '\\TOOLS\\WINNT')
197 addEnvPath(cmd.args['env'], "PATH", VSCommonDir + '\\TOOLS')
198
199 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\INCLUDE')
200 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\ATL\\INCLUDE')
201 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\MFC\\INCLUDE')
202
203 addEnvPath(cmd.args['env'], "LIB", MSVCDir + '\\LIB')
204 addEnvPath(cmd.args['env'], "LIB", MSVCDir + '\\MFC\\LIB')
205
219
220 -class VC7(VisualStudio):
226
228 VisualStudio.setupEnvironment(self, cmd)
229
230 if self.installdir:
231 installdir = self.installdir
232 else:
233 installdir = 'C:\\Program Files\\Microsoft Visual Studio .NET 2003'
234
235 VSInstallDir = installdir + '\\Common7\\IDE'
236 VCInstallDir = installdir
237 MSVCDir = installdir + '\\VC7'
238
239 addEnvPath(cmd.args['env'], "PATH", VSInstallDir)
240 addEnvPath(cmd.args['env'], "PATH", MSVCDir + '\\BIN')
241 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\Common7\\Tools')
242 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\Common7\\Tools\\bin')
243
244 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\INCLUDE')
245 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\ATLMFC\\INCLUDE')
246 addEnvPath(cmd.args['env'], "INCLUDE", MSVCDir + '\\PlatformSDK\\include')
247 addEnvPath(cmd.args['env'], "INCLUDE", VCInstallDir + '\\SDK\\v1.1\\include')
248
249 addEnvPath(cmd.args['env'], "LIB", MSVCDir + '\\LIB')
250 addEnvPath(cmd.args['env'], "LIB", MSVCDir + '\\ATLMFC\\LIB')
251 addEnvPath(cmd.args['env'], "LIB", MSVCDir + '\\PlatformSDK\\lib')
252 addEnvPath(cmd.args['env'], "LIB", VCInstallDir + '\\SDK\\v1.1\\lib')
253
266
267
268 VS2003 = VC7
269
270 -class VC8(VisualStudio):
271
272
273 arch = "x86"
274
276
277
278 if 'arch' in kwargs:
279 self.arch = kwargs['arch']
280 del kwargs['arch']
281
282
283 VisualStudio.__init__(self, **kwargs)
284
286 VisualStudio.setupEnvironment(self, cmd)
287
288 if self.installdir:
289 installdir = self.installdir
290 else:
291 installdir = 'C:\\Program Files\\Microsoft Visual Studio 8'
292
293 VSInstallDir = installdir
294 VCInstallDir = installdir + '\\VC'
295
296 addEnvPath(cmd.args['env'], "PATH", VSInstallDir + '\\Common7\\IDE')
297 if self.arch == "x64":
298 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\BIN\\x86_amd64')
299 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\BIN')
300 addEnvPath(cmd.args['env'], "PATH", VSInstallDir + '\\Common7\\Tools')
301 addEnvPath(cmd.args['env'], "PATH", VSInstallDir + '\\Common7\\Tools\\bin')
302 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\PlatformSDK\\bin')
303 addEnvPath(cmd.args['env'], "PATH", VSInstallDir + '\\SDK\\v2.0\\bin')
304 addEnvPath(cmd.args['env'], "PATH", VCInstallDir + '\\VCPackages')
305 addEnvPath(cmd.args['env'], "PATH", r'${PATH}')
306
307 addEnvPath(cmd.args['env'], "INCLUDE", VCInstallDir + '\\INCLUDE')
308 addEnvPath(cmd.args['env'], "INCLUDE", VCInstallDir + '\\ATLMFC\\include')
309 addEnvPath(cmd.args['env'], "INCLUDE", VCInstallDir + '\\PlatformSDK\\include')
310
311 archsuffix = ''
312 if self.arch == "x64":
313 archsuffix = '\\amd64'
314 addEnvPath(cmd.args['env'], "LIB", VCInstallDir + '\\LIB' + archsuffix)
315 addEnvPath(cmd.args['env'], "LIB", VCInstallDir + '\\ATLMFC\\LIB' + archsuffix)
316 addEnvPath(cmd.args['env'], "LIB", VCInstallDir + '\\PlatformSDK\\lib' + archsuffix)
317 addEnvPath(cmd.args['env'], "LIB", VSInstallDir + '\\SDK\\v2.0\\lib' + archsuffix)
318
319
332
333
334 VS2005 = VC8
335