]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/all/build-all
   2 #---------------------------------------------------------------------- 
   4 # Purpose:     Master build script for building all the wxPython 
   5 #              installers and such on all the build machines in 
   6 #              my lab, and then 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
, Config
 
  25 #---------------------------------------------------------------------- 
  28 CFGFILE 
= "./distrib/all/build-environ.cfg" 
  32 #---------------------------------------------------------------------- 
  33 # Define all the build tasks 
  38 #---------------------------------------------------------------------- 
  40 def getTasks(config_env
): 
  41     # Things that need to be done before any of the builds 
  43         Job("", "distrib/all/build-setup", env
=config_env
), 
  44         Job("", "distrib/all/build-docs", env
=config_env
), 
  45         Job("", "distrib/all/build-sources", env
=config_env
), 
  48     # Build tasks.  Anything that can be done in parallel (depends greatly 
  49     # on the nature of the build machines configurations...) is a separate 
  52     jaguarTask 
= Task( Job("whopper.23", "distrib/all/build-osx", 
  53                            [config
.OSX_HOST_jaguar
, "2.3", "ansi"], env
=config_env
) ) 
  55     pantherTask 
= Task( [ Job("bigmac.23",  
  56                               "distrib/all/build-osx", 
  57                               [config
.OSX_HOST_panther
, "2.3", "both"], env
=config_env
), 
  59                               "distrib/all/build-osx", 
  60                               [config
.OSX_HOST_panther
, "2.4", "both"], env
=config_env
) 
  63     tigerTask 
=  Task([ #Job("smallfry.23", 
  64                         #    "distrib/all/build-osx", 
  65                         #    [config.OSX_HOST_tiger, "2.3", "both"], env=config_env), 
  67                             "distrib/all/build-osx", 
  68                             [config
.OSX_HOST_tiger
, "2.4", "both", "universal"], env
=config_env
), 
  70                             "distrib/all/build-osx", 
  71                             [config
.OSX_HOST_tiger
, "2.5", "both", "universal"], env
=config_env
) 
  76         [ Job("beast.23",     "distrib/all/build-windows", ["2.3"], env
=config_env
), 
  77           Job("co-rh9.23",    "distrib/all/build-rpm", ["beast", "co-rh9",   "rh9",   "2.3"], env
=config_env
), 
  78           Job("beast.24",     "distrib/all/build-windows", ["2.4"], env
=config_env
), 
  79           Job("co-rh9.24",    "distrib/all/build-rpm", ["beast", "co-rh9",   "rh9",   "2.4"], env
=config_env
), 
  80           Job("beast.25",     "distrib/all/build-windows", ["2.5"], env
=config_env
), 
  84         [ Job("co-fc2.23",    "distrib/all/build-rpm", ["beast", "co-fc2",     "fc2",     "2.3"], env
=config_env
), 
  85           Job("co-fc4.24",    "distrib/all/build-rpm", ["beast", "co-fc4",     "fc4",     "2.4"], env
=config_env
), 
  86           Job("co-mdk102.24", "distrib/all/build-rpm", ["beast", "co-mdk102",  "mdk102",  "2.4"], env
=config_env
), 
  87           Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env
=config_env
), 
  90     buildTasks 
= [ jaguarTask
, 
  97     # Finalization.  This is for things that must wait until all the 
  98     # builds are done, such as copying the installers someplace, sending 
 100     finalizationTask 
= Task( Job("", "distrib/all/build-finalize", env
=config_env
) ) 
 102     return initialTask
, buildTasks
, finalizationTask
 
 105 #---------------------------------------------------------------------- 
 109     print "Usage: build-all [command flags...]" 
 112     print "   dryrun       Do the build, but don't copy anywhere (default)" 
 113     print "   daily        Do a daily build, copy to starship" 
 114     print "   release      Do a normal release (cantidate) build, copy to starship" 
 116     print "optional command flags:" 
 117     print "   skipsource   Don't build the source archives, use the ones" 
 118     print "                already in the staging dir." 
 119     print "   onlysource   Exit after building the source and docs archives" 
 120     print "   skipdocs     Don't rebuild the docs" 
 121     print "   skipwin      Don't do the remote Windows build" 
 122     print "   skiposx      Don't do the remote OSX build" 
 123     print "   skiplinux    Don't do the remote Linux (RPM) build" 
 124     print "   skipclean    Don't do the cleanup step on the remote builds" 
 125     print "   skipupload   Don't upload the builds to starship" 
 126     print "   ansi         Also do the ansi builds" 
 128     print "   nocohost     Don't start the coLinux sessions if they are" 
 129     print "                not already online" 
 133 #---------------------------------------------------------------------- 
 136     # Make sure we are running in the right directory.  TODO: make 
 137     # this test more robust.  Currenly we just test for the presence 
 138     # of 'wxPython' and 'wx' subdirs. 
 139     if not os
.path
.isdir("wxPython") or not os
.path
.isdir("wx"): 
 140         print "Please run this script from the root wxPython directory." 
 145     # Check command line flags 
 147         if flag 
in ["dryrun", "daily", "release"]: 
 150         elif flag 
== "skipsource": 
 151             config
.skipsource 
= "yes" 
 153         elif flag 
== "onlysource": 
 154             config
.onlysource 
= "yes" 
 156         elif flag 
== "skipdocs": 
 157             config
.skipdocs 
= "yes" 
 159         elif flag 
== "skipnewdocs": 
 160             config
.skipnewdocs 
= "yes" 
 162         elif flag 
== "skipwin": 
 163             config
.skipwin 
= "yes" 
 165         elif flag 
== "skiposx": 
 166             config
.skiposx 
= "yes" 
 168         elif flag 
== "skiplinux": 
 169             config
.skiplinux 
= "yes" 
 171         elif flag 
== "skipclean": 
 172             config
.skipclean 
= "yes" 
 174         elif flag 
== "skipupload": 
 175             config
.skipupload 
= "yes" 
 178             config
.buildansi 
= "yes" 
 180         elif flag 
== "nocohost": 
 181             config
.startcohost 
= "no" 
 184             print 'Unknown flag: "%s"' % flag
 
 189     # ensure the staging area exists 
 190     if not os
.path
.exists(config
.STAGING_DIR
): 
 191         os
.makedirs(config
.STAGING_DIR
) 
 193     # Figure out the wxPython version number, possibly adjusted for being a daily build 
 194     if config
.KIND 
== "daily": 
 196         config
.DAILY 
= time
.strftime("%Y%m%d")   # should it include the hour too?  2-digit year? 
 197         file("DAILY_BUILD", "w").write(config
.DAILY
) 
 200     config
.VERSION 
= setup
.VERSION
 
 202     config_env 
= config
.asDict() 
 203     config_env
.update(os
.environ
) 
 205     initialTask
, buildTasks
, finalizationTask 
= getTasks(config_env
) 
 207     print "Build getting started at: ", time
.ctime() 
 209     # Run the first task, which will create the docs and sources tarballs 
 210     tr 
= TaskRunner(initialTask
) 
 213     # cleanup the DAILY_BUILD file 
 214     if config
.KIND 
== "daily": 
 215         os
.unlink("DAILY_BUILD") 
 218     if rc 
!= 0 or config
.onlysource 
== "yes": 
 222     # Run the main build tasks 
 223     tr 
= TaskRunner(buildTasks
) 
 229     # when all the builds are done, run the finalization task 
 230     tr 
= TaskRunner(finalizationTask
) 
 236     print "Build finished at: ", time
.ctime() 
 242 if __name__ 
== "__main__":