]>
Commit | Line | Data |
---|---|---|
1b55cabf RD |
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_11' | |
10 | wxpVer = '2.1.11' | |
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 | ||
86 | logSeparator("Copying wxPython workspace to build directory...") | |
87 | do("copy /s %s %s" % ('e:\\projects\\wxPython\*.*', WXDIR+'\\utils\\wxPython')) | |
88 | os.chdir(WXDIR + '/utils/wxPython') | |
89 | f = open("build.local", "w") | |
90 | f.write(""" | |
91 | TARGETDIR = 'e:\\projects\\wx\\utils\\wxPython' | |
92 | WXPSRCDIR = 'e:\\projects\\wx\\utils\\wxPython\\src' | |
93 | CRTFLAG='/MD' | |
94 | FINAL=1 | |
95 | """) | |
96 | f.close() | |
97 | ||
98 | ||
99 | logSeparator("Cleaning wxPython...") | |
100 | os.chdir(WXDIR+'\\utils\\wxPython') | |
101 | do("buildall -cu") | |
102 | do("ll") | |
103 | ||
104 | ||
105 | logSeparator("Building core wxPython...") | |
106 | os.chdir(WXDIR+'\\utils\\wxPython\\src') | |
107 | do("build -bi") | |
108 | validateFile(WXDIR+'\\utils\\wxPython\\wxc.pyd') | |
109 | ||
110 | ||
111 | ||
112 | logSeparator("Building wxPython addon modules...") | |
113 | os.chdir(WXDIR+'\\utils\\wxPython\\modules') | |
114 | do("buildall -bi") | |
115 | validateFile(WXDIR+'\\utils\\wxPython\\utilsc.pyd') | |
116 | validateFile(WXDIR+'\\utils\\wxPython\\htmlc.pyd') | |
117 | validateFile(WXDIR+'\\utils\\wxPython\\glcanvasc.pyd') | |
118 | validateFile(WXDIR+'\\utils\\wxPython\\oglc.pyd') | |
119 | ||
120 | ||
121 | logSeparator("Building installer executable...") | |
122 | os.chdir(WXDIR+'\\utils\\wxPython\\distrib') | |
123 | do("autoit2 wise.aut") | |
124 | srcName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-'+wxpVer+'.EXE' | |
125 | destName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-'+wxpVer+'-'+dateSt+'.EXE' | |
126 | validateFile(srcName) | |
127 | try: | |
128 | os.rename(srcName, destName) | |
129 | except: | |
130 | pass | |
131 | ||
132 | ||
133 | logSeparator("Building source zip file...") | |
134 | os.chdir(WXDIR+'\\utils') | |
135 | do("wxPython\\distrib\\zipit.bat %s" % wxpVer) | |
136 | srcZName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-src-'+wxpVer+'.zip' | |
137 | destZName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-src-'+wxpVer+'-'+dateSt+'.zip' | |
138 | validateFile(srcZName) | |
139 | try: | |
140 | os.rename(srcZName, destZName) | |
141 | except: | |
142 | pass | |
143 | ||
144 | ||
145 | logSeparator("Uploading to website...") | |
146 | do('python d:\util32\sendwxp.py %s' % destName) | |
147 | do('python d:\util32\sendwxp.py %s' % destZName) | |
148 | os.unlink(destName) | |
149 | os.unlink(destZName) | |
150 | ||
151 | ||
152 | logSeparator("Finished!!!") | |
153 | ||
154 | finally: | |
155 | os.system("list " + logfile) | |
156 | pass | |
157 | ||
158 | ||
159 | ||
160 | ||
161 | ||
162 | ||
163 | if __name__ == '__main__': | |
164 | main() |