]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/distrib/autobuild.py
Some minor updates, fixes, etc.
[wxWidgets.git] / utils / wxPython / distrib / autobuild.py
1
2
3 import sys, os, string, time
4 from ftplib import FTP
5
6
7 logfile = 'e:\\temp\\autobuild.log'
8 WXDIR = os.environ['WXWIN']
9 dllVer = '21_12'
10 wxpVer = '2.1.12'
11 dateSt = time.strftime("%Y%m%d", time.localtime(time.time()))
12
13 #----------------------------------------------------------------------
14
15 def do(cmd):
16 st = " " + cmd + " >> " + logfile
17 print st
18 f = open(logfile, "at")
19 f.write(st + '\n')
20 f.close()
21 os.system(cmd + " >>& " + logfile)
22
23 #----------------------------------------------------------------------
24
25 def logTruncate():
26 f = open(logfile, "wt")
27 f.close()
28
29
30 def logSeparator(msg=None, f=None, recurse=1):
31 if not f:
32 f = open(logfile, "at")
33 f.write('\n')
34 f.write('--' * 35)
35 f.write('\n')
36 if msg:
37 f.write(msg)
38 f.write('\n')
39 f.write('--' * 35)
40 f.write('\n')
41 if recurse:
42 logSeparator(msg, sys.stdout, 0)
43
44 #----------------------------------------------------------------------
45
46 def validateFile(file):
47 if not os.path.exists(file):
48 logSeparator("***** %s does not exist, exiting! *****" % file)
49 raise SystemExit
50 else:
51 logSeparator("%s found, continuing..." % file, recurse=0)
52
53
54 #----------------------------------------------------------------------
55
56 def main():
57 logTruncate()
58
59 try:
60 logSeparator("Cleanup")
61 os.chdir(WXDIR + '/src/msw')
62 do('make cleandll FINAL=1')
63 os.chdir(WXDIR + '/utils/ogl/src')
64 do('wxm clean FINAL=1')
65 os.chdir(WXDIR + '/utils/glcanvas/win')
66 do('wxm clean FINAL=1')
67
68 logSeparator("Building Documentation...")
69 os.chdir(WXDIR + '/src/msw')
70 do('make touchmanual htmlhelp')
71 validateFile(WXDIR + '/docs/html/wx/wx.chm')
72
73 logSeparator("Building wxWindows and libraries...")
74 os.chdir(WXDIR + '/src/msw')
75 do('make dll pch FINAL=1')
76 validateFile(WXDIR + '/lib/wx'+dllVer+'.dll')
77
78 os.chdir(WXDIR + '/utils/ogl/src')
79 do('wxm FINAL=1')
80 os.chdir(WXDIR + '/utils/glcanvas/win')
81 do('wxm FINAL=1')
82 validateFile(WXDIR + '/lib/ogl.lib')
83 validateFile(WXDIR + '/lib/glcanvas.lib')
84
85 logSeparator("Cleaning wxPython build directory...")
86 os.chdir(WXDIR + '/utils/wxPython')
87 do("del /sxy *.*")
88
89 logSeparator("Copying wxPython workspace to build directory...")
90 do("copy /s %s %s" % ('e:\\projects\\wxPython\*.*', WXDIR+'\\utils\\wxPython'))
91 os.chdir(WXDIR + '/utils/wxPython')
92 f = open("build.local", "w")
93 f.write("""
94 TARGETDIR = 'e:\\projects\\wx\\utils\\wxPython'
95 WXPSRCDIR = 'e:\\projects\\wx\\utils\\wxPython\\src'
96 CRTFLAG='/MD'
97 FINAL=1
98 """)
99 f.close()
100
101
102 logSeparator("Cleaning wxPython...")
103 os.chdir(WXDIR+'\\utils\\wxPython')
104 do("buildall -cu")
105 do("ll")
106
107
108 logSeparator("Building core wxPython...")
109 os.chdir(WXDIR+'\\utils\\wxPython\\src')
110 do("build -bi")
111 validateFile(WXDIR+'\\utils\\wxPython\\wxc.pyd')
112
113
114
115 logSeparator("Building wxPython addon modules...")
116 os.chdir(WXDIR+'\\utils\\wxPython\\modules')
117 do("buildall -bi")
118 validateFile(WXDIR+'\\utils\\wxPython\\utilsc.pyd')
119 validateFile(WXDIR+'\\utils\\wxPython\\htmlc.pyd')
120 validateFile(WXDIR+'\\utils\\wxPython\\glcanvasc.pyd')
121 validateFile(WXDIR+'\\utils\\wxPython\\oglc.pyd')
122
123
124 logSeparator("Building installer executable...")
125 os.chdir(WXDIR+'\\utils\\wxPython\\distrib')
126 do("autoit2 wise.aut")
127 srcName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-'+wxpVer+'.EXE'
128 destName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-'+wxpVer+'-'+dateSt+'.EXE'
129 validateFile(srcName)
130 try:
131 time.sleep(5)
132 os.rename(srcName, destName)
133 validateFile(destName)
134 except:
135 pass
136
137
138 logSeparator("Building source zip file...")
139 os.chdir(WXDIR+'\\utils')
140 do("wxPython\\distrib\\zipit.bat %s" % wxpVer)
141 srcZName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-src-'+wxpVer+'.zip'
142 destZName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-src-'+wxpVer+'-'+dateSt+'.zip'
143 validateFile(srcZName)
144 try:
145 os.rename(srcZName, destZName)
146 except:
147 pass
148
149
150
151 return
152
153 logSeparator("Uploading to website...")
154 do('python d:\util32\sendwxp.py %s' % destName)
155 do('python d:\util32\sendwxp.py %s' % destZName)
156 os.unlink(destName)
157 os.unlink(destZName)
158
159
160 logSeparator("Finished!!!")
161
162 finally:
163 os.system("list " + logfile)
164 pass
165
166
167
168
169
170
171 if __name__ == '__main__':
172 main()