]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/all/build-all
   2 #---------------------------------------------------------------------- 
   4 # Purpose:     Master build script for building all the installers and 
   5 #              such on all the build machines in my lab, and then  
   6 #              distributing the results as needed. 
   8 #              This will replace the build-all bash script and is 
   9 #              needed because the needs of the build have outgrown 
  10 #              what I can do with bash. 
  14 # Created:     05-Nov-2004 
  16 # Copyright:   (c) 2004 by Total Control Software 
  17 # Licence:     wxWindows license 
  18 #---------------------------------------------------------------------- 
  23 from taskrunner 
import Job
, Task
, TaskRunner
 
  25 #---------------------------------------------------------------------- 
  29     def write(self
, filename
="config", outfile
=None): 
  31             f 
= file(filename
, "w") 
  34         for k
, v 
in self
.__dict
__.items(): 
  35             f
.write('%s="%s"\n' % (k
, v
)) 
  39 # the local spot that we put everything when done, before possibly copying  
  41 config
.STAGING_DIR 
= "./BUILD" 
  44 # host name of the machine to use for windows builds 
  45 config
.WIN_HOST 
= "beast" 
  46 # Where is the build dir from the remote machine's perspective? 
  47 config
.WIN_BUILD 
= "/c/BUILD" 
  51 config
.OSX_HOST_panther 
= "bigmac" 
  52 config
.OSX_HOST_jaguar 
= "whopper" 
  53 config
.OSX_BUILD 
= "/BUILD" 
  56 # Alsmost the same...  See below for hosts and other info 
  57 config
.LINUX_BUILD 
= "/tmp/BUILD" 
  60 # Upload server locations 
  61 config
.UPLOAD_HOST 
= "starship.python.net" 
  62 config
.UPLOAD_DAILY_ROOT 
= "/home/crew/robind/public_html/wxPython/daily" 
  63 config
.UPLOAD_PREVIEW_ROOT 
= "/home/crew/robind/public_html/wxPython/preview" 
  65 # defaults for build options 
  66 config
.KIND 
= "dryrun" 
  68 config
.skipsource 
= "no" 
  69 config
.onlysource 
= "no" 
  70 config
.skipdocs 
= "no" 
  73 config
.skiplinux 
= "no" 
  74 config
.skipclean 
= "no" 
  75 config
.skipupload 
= "no" 
  76 config
.skipnewdocs 
= "no" 
  79 #---------------------------------------------------------------------- 
  80 # Define all the build tasks 
  85 CFGFILE 
= "./tmp/config" 
  88 # Things that need to be done before any of the builds 
  89 initialTask 
= Task([ Job("", ["distrib/all/build-setup", CFGFILE
]), 
  90                      Job("", ["distrib/all/build-docs", CFGFILE
]), 
  91                      Job("", ["distrib/all/build-sources", CFGFILE
]), 
  94 # Build tasks.  Anything that can be done in parallel (depends greatly 
  95 # on the nature of the build machine configurations...) is a separate 
  97 windowsTask 
= Task( Job("beast", ["distrib/all/build-windows", CFGFILE
]) ) 
  99 jaguarTask 
=  Task( Job(config
.OSX_HOST_jaguar
, 
 100                         ["distrib/all/build-osx", CFGFILE
, config
.OSX_HOST_jaguar
, "jaguar"]) ) 
 102 pantherTask 
=  Task( Job(config
.OSX_HOST_panther
, 
 103                          ["distrib/all/build-osx", CFGFILE
, config
.OSX_HOST_panther
, "panther"]) ) 
 105 rpmTask 
= Task([ Job("co-rh9",    ["distrib/all/build-rpm", CFGFILE
, "beast", "co-rh9",   "rh9",   "config"]), 
 106                  Job("co-fc2",    ["distrib/all/build-rpm", CFGFILE
, "beast", "co-fc2",   "fc2",   "2.3"]), 
 107                  Job("co-mdk92",  ["distrib/all/build-rpm", CFGFILE
, "beast", "co-mdk92", "mdk92", "2.3"]), 
 108                  Job("co-mdk101", ["distrib/all/build-rpm", CFGFILE
, "beast", "co-mdk101","mdk101","2.3"]), 
 111 buildTasks 
= [ windowsTask
, 
 117 # Finalization.  This is for things that must wait until all the 
 118 # builds are done, such as copying the installers someplace, sending 
 120 finalizationTask 
= Task( Job("", ["distrib/all/build-finalize", CFGFILE
]) ) 
 123 #---------------------------------------------------------------------- 
 127     print "Usage: build-all [command flags...]" 
 130     print "   dryrun       Do the build, but don't copy anywhere (default)" 
 131     print "   daily        Do a daily build, copy to starship" 
 132     print "   release      Do a normal release (cantidate) build, copy to starship" 
 134     print "optional command flags:" 
 135     print "   2.2          Build for Python 2.2 (default=off)" 
 136     print "   2.3          Build for Python 2.3 (default=on)" 
 137     print "   all          Build for all supported Python versions" 
 139     print "   skipsource   Don't build the source archives, use the ones" 
 140     print "                already in the staging dir." 
 141     print "   onlysource   Exit after building the source and docs archives" 
 142     print "   skipdocs     Don't rebuild the docs" 
 143     print "   skipwin      Don't do the remote Windows build" 
 144     print "   skiposx      Don't do the remote OSX build" 
 145     print "   skiplinux    Don't do the remote Linux build" 
 146     print "   skipclean    Don't do the cleanup step on the remote builds" 
 147     print "   skipupload   Don't upload the builds to starship" 
 151 #---------------------------------------------------------------------- 
 154     # Make sure we are running in the right directory.  TODO: make 
 155     # this test more robust.  Currenly we just test for the presence 
 156     # of 'wxPython' and 'wx' subdirs. 
 157     if not os
.path
.isdir("wxPython") or not os
.path
.isdir("wx"): 
 158         print "Please run this script from the root wxPython directory." 
 161     # Check command line flags 
 163         if flag 
in ["dryrun", "daily", "release"]: 
 166         elif flag 
in ["2.2", "2.3"]: 
 169             config
.PYVER 
= "2.2 2.3" 
 171         elif flag 
== "skipsource": 
 172             config
.skipsource 
= "yes" 
 174         elif flag 
== "onlysource": 
 175             config
.onlysource 
= "yes" 
 177         elif flag 
== "skipdocs": 
 178             config
.skipdocs 
= "yes" 
 180         elif flag 
== "skipnewdocs": 
 181             config
.skipnewdocs 
= "yes" 
 183         elif flag 
== "skipwin": 
 184             config
.skipwin 
= "yes" 
 186         elif flag 
== "skiposx": 
 187             config
.skiposx 
= "yes" 
 189         elif flag 
== "skiplinux": 
 190             config
.skiplinux 
= "yes" 
 192         elif flag 
== "skipclean": 
 193             config
.skipclean 
= "yes" 
 195         elif flag 
== "skipupload": 
 196             config
.skipupload 
= "yes" 
 199             print 'Unknown flag: "%s"' % flag
 
 204     # ensure the staging area exists 
 205     if not os
.path
.exists(config
.STAGING_DIR
): 
 206         os
.makedirs(config
.STAGING_DIR
) 
 208     # Figure out the wxPython version number, possibly adjusted for being a daily build 
 209     if config
.KIND 
== "daily": 
 211         config
.DAILY 
= time
.strftime("%Y%m%d")   # should it include the hour too?  2-digit year? 
 212         file("DAILY_BUILD", "w").write(config
.DAILY
) 
 215     config
.VERSION 
= setup
.VERSION
 
 217     # write the config file where the build scripts can find it 
 218     config
.write(CFGFILE
) 
 219     print "Build getting started at: ", time
.ctime() 
 222     # Run the first task, which will create the docs and sources tarballs 
 223     tr 
= TaskRunner(initialTask
) 
 226     # cleanup the DAILY_BUILD file 
 227     if config
.KIND 
== "daily": 
 228         os
.unlink("DAILY_BUILD") 
 231     if rc 
!= 0 or config
.onlysource 
== "yes": 
 235     # Run the main build tasks 
 236     tr 
= TaskRunner(buildTasks
) 
 242     # when all the builds are done, run the finalization task 
 243     tr 
= TaskRunner(finalizationTask
) 
 249     print "Build finished at: ", time
.ctime() 
 255 if __name__ 
== "__main__":