]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/autobuild.py
3 import sys
, os
, string
, time
8 logfile
= 'c:\\temp\\autobuild.log'
9 WXDIR
= os
.environ
['WXWIN']
12 dateSt
= time
.strftime("%Y%m%d", time
.localtime(time
.time()))
14 base
= os
.path
.split(sys
.argv
[0])[0]
15 base
= os
.path
.join(base
, '..')
16 WXPYDIR
= os
.path
.abspath(base
)
18 #----------------------------------------------------------------------
21 st
= " " + cmd
+ " >> " + logfile
23 f
= open(logfile
, "at")
26 os
.system(cmd
+ " >>& " + logfile
)
28 #----------------------------------------------------------------------
31 f
= open(logfile
, "wt")
35 def logSeparator(msg
=None, f
=None, recurse
=1):
37 f
= open(logfile
, "at")
47 logSeparator(msg
, sys
.stdout
, 0)
49 #----------------------------------------------------------------------
51 def validateFile(file):
52 if not os
.path
.exists(file):
53 logSeparator("***** %s does not exist, exiting! *****" % file)
56 logSeparator("%s found, continuing..." % file, recurse
=0)
59 #----------------------------------------------------------------------
65 logSeparator("Cleanup")
66 os
.chdir(WXDIR
+ '/src/msw')
67 do('make cleandll FINAL=1')
69 logSeparator("Building Documentation...")
70 os
.chdir(WXDIR
+ '/src/msw')
71 do('make touchmanual htmlhelp')
72 validateFile(WXDIR
+ '/docs/htmlhelp/wx.chm')
74 logSeparator("Building wxWindows and other libraries...")
75 os
.chdir(WXDIR
+ '/src/msw')
76 do('make dll pch FINAL=1')
77 validateFile(WXDIR
+ '/lib/wx'+dllVer
+'.dll')
81 logSeparator("Cleaning wxPython build directory...")
84 os
.rename('build.local', 'build.local.save')
85 f
= open("build.local", "w")
93 logSeparator("Building core wxPython...")
94 os
.chdir(WXPYDIR
+ '\\src')
96 validateFile(WXPYDIR
+'\\wxPython\\wxc.pyd')
99 logSeparator("Building wxPython addon modules...")
100 os
.chdir(WXPYDIR
+'\\contrib')
102 validateFile(WXPYDIR
+'\\wxPython\\glcanvasc.pyd')
103 validateFile(WXPYDIR
+'\\wxPython\\oglc.pyd')
104 validateFile(WXPYDIR
+'\\wxPython\\stc_c.pyd')
108 os
.unlink('build.local')
109 os
.rename('build.local.save', 'build.local')
112 logSeparator("Building installer executable...")
113 os
.chdir(WXPYDIR
+'\\distrib')
114 do("autoit2 wise.aut")
115 srcName
= WXPYDIR
+'\\distrib\\wxPython-'+wxpVer
+'.EXE'
116 destName
= WXPYDIR
+'\\distrib\\wxPython-'+wxpVer
+'-'+dateSt
+'.EXE'
117 validateFile(srcName
)
120 os
.rename(srcName
, destName
)
121 validateFile(destName
)
123 logSeparator("****** UNABLE TO RENAME FILE ******")
126 logSeparator("Building source and docs zip files...")
128 do("distrib\\zipit.bat %s" % wxpVer
)
129 srcZName
= WXPYDIR
+'\\distrib\\wxPython-src-'+wxpVer
+'.zip'
130 destZName
= WXPYDIR
+'\\distrib\\wxPython-src-'+wxpVer
+'-'+dateSt
+'.zip'
131 validateFile(srcZName
)
133 os
.rename(srcZName
, destZName
)
137 srcDName
= WXPYDIR
+'\\distrib\\wxPython-docs-'+wxpVer
+'.zip'
138 destDName
= WXPYDIR
+'\\distrib\\wxPython-docs-'+wxpVer
+'-'+dateSt
+'.zip'
139 validateFile(srcDName
)
141 os
.rename(srcDName
, destDName
)
147 # #*#*#*#*#* Comment this out to allow upload...
150 logSeparator("Uploading to website...")
151 do('python c:\\utils\\sendwxp.py %s' % destName
)
152 do('python c:\\utils\\sendwxp.py %s' % destZName
)
153 do('python c:\\utils\\sendwxp.py %s' % destDName
)
156 logSeparator("Finished!!!")
159 os
.system("list " + logfile
)
167 if __name__
== '__main__':