]>
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'] | |
99ab9f3b RD |
9 | dllVer = '21_14' |
10 | wxpVer = '2.1.14' | |
1b55cabf RD |
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 | ||
b7e72427 RD |
85 | logSeparator("Cleaning wxPython build directory...") |
86 | os.chdir(WXDIR + '/utils/wxPython') | |
87 | do("del /sxy *.*") | |
1b55cabf RD |
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: | |
eec92d76 | 131 | time.sleep(5) |
1b55cabf | 132 | os.rename(srcName, destName) |
eec92d76 | 133 | validateFile(destName) |
1b55cabf RD |
134 | except: |
135 | pass | |
136 | ||
137 | ||
714d23b4 | 138 | logSeparator("Building source and docs zip files...") |
1b55cabf RD |
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 | ||
714d23b4 RD |
149 | srcDName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-docs-'+wxpVer+'.zip' |
150 | destDName = WXDIR+'\\utils\\wxPython\\distrib\\wxPython-docs-'+wxpVer+'-'+dateSt+'.zip' | |
151 | validateFile(srcDName) | |
152 | try: | |
153 | os.rename(srcDName, destDName) | |
154 | except: | |
155 | pass | |
1b55cabf | 156 | |
eec92d76 | 157 | |
714d23b4 RD |
158 | # #*#*#*#*#* Comment this out to allow upload... |
159 | #return | |
eec92d76 | 160 | |
1b55cabf RD |
161 | logSeparator("Uploading to website...") |
162 | do('python d:\util32\sendwxp.py %s' % destName) | |
163 | do('python d:\util32\sendwxp.py %s' % destZName) | |
714d23b4 | 164 | do('python d:\util32\sendwxp.py %s' % destDName) |
1b55cabf RD |
165 | os.unlink(destName) |
166 | os.unlink(destZName) | |
167 | ||
168 | ||
169 | logSeparator("Finished!!!") | |
170 | ||
171 | finally: | |
172 | os.system("list " + logfile) | |
173 | pass | |
174 | ||
175 | ||
176 | ||
177 | ||
178 | ||
179 | ||
180 | if __name__ == '__main__': | |
181 | main() |