import sys
import os
import time
-from taskrunner import Job, Task, TaskRunner
+from taskrunner import Job, Task, TaskRunner, Config
#----------------------------------------------------------------------
# Configuration items
-class Config:
- def write(self, filename="config", outfile=None):
- if outfile is None:
- f = file(filename, "w")
- else:
- f = outfile
- for k, v in self.__dict__.items():
- f.write('%s="%s"\n' % (k, v))
-
+CFGFILE = "./distrib/all/build-environ.cfg"
config = Config()
-
-# the local spot that we put everything when done, before possibly copying
-# to remote hosts
-config.STAGING_DIR = "./BUILD"
-
-
-# host name of the machine to use for windows builds
-config.WIN_HOST = "beast"
-# Where is the build dir from the remote machine's perspective?
-config.WIN_BUILD = "/c/BUILD"
-
-
-# Just like the above
-config.OSX_HOST_panther = "bigmac"
-config.OSX_HOST_jaguar = "whopper"
-config.OSX_BUILD = "/BUILD"
-
-
-# Alsmost the same... See below for hosts and other info
-config.LINUX_BUILD = "/tmp/BUILD"
-
-
-# Upload server locations
-config.UPLOAD_HOST = "starship.python.net"
-config.UPLOAD_DAILY_ROOT = "/home/crew/robind/public_html/wxPython/daily"
-config.UPLOAD_PREVIEW_ROOT = "/home/crew/robind/public_html/wxPython/rc"
-
-# defaults for build options
-config.KIND = "dryrun"
-config.skipsource = "no"
-config.onlysource = "no"
-config.skipdocs = "no"
-config.skipwin = "no"
-config.skiposx = "no"
-config.skiplinux = "no"
-config.skipclean = "no"
-config.skipupload = "no"
-config.skipnewdocs = "no"
-config.startcohost = "yes"
+config.read(CFGFILE)
#----------------------------------------------------------------------
# Define all the build tasks
class Job(Job):
LOGBASE = "./tmp"
-CFGFILE = "./tmp/config"
-
-
-# Things that need to be done before any of the builds
-initialTask = Task([ Job("", ["distrib/all/build-setup", CFGFILE]),
- Job("", ["distrib/all/build-docs", CFGFILE]),
- Job("", ["distrib/all/build-sources", CFGFILE]),
- ])
-
-# Build tasks. Anything that can be done in parallel (depends greatly
-# on the nature of the build machines configurations...) is a separate
-# task.
-
-jaguarTask = Task( Job("whopper.23",
- ["distrib/all/build-osx", CFGFILE, config.OSX_HOST_jaguar, "jaguar", "2.3"]) )
-
-pantherTask = Task([ Job("bigmac.23",
- ["distrib/all/build-osx", CFGFILE, config.OSX_HOST_panther, "panther", "2.3"]),
- Job("bigmac.24",
- ["distrib/all/build-osx", CFGFILE, config.OSX_HOST_panther, "panther", "2.4"])
- ])
-
-beastTask1 = Task([ Job("beast.23", ["distrib/all/build-windows", CFGFILE, "2.3"]),
- Job("beast.24", ["distrib/all/build-windows", CFGFILE, "2.4"]),
- Job("co-mdk102.24", ["distrib/all/build-rpm", CFGFILE, "beast", "co-mdk102","mdk102","2.4"]),
- ])
-
-beastTask2 = Task([ Job("co-fc2.23", ["distrib/all/build-rpm", CFGFILE, "beast", "co-fc2", "fc2", "2.3"]),
- Job("co-mdk101.23", ["distrib/all/build-rpm", CFGFILE, "beast", "co-mdk101","mdk101","2.3"]),
- Job("co-fc2.24", ["distrib/all/build-rpm", CFGFILE, "beast", "co-fc2", "fc2", "2.4"]),
- #Job("co-mdk101.24", ["distrib/all/build-rpm", CFGFILE, "beast", "co-mdk101","mdk101","2.4"]),
- ])
-
-cyclopsTask = Task([ Job("co-mdk92.23", ["distrib/all/build-rpm", CFGFILE, "cyclops", "co-mdk92", "mdk92", "2.3"]),
- Job("co-rh9.23", ["distrib/all/build-rpm", CFGFILE, "cyclops", "co-rh9", "rh9", "2.3"]),
- Job("co-mdk92.24", ["distrib/all/build-rpm", CFGFILE, "cyclops", "co-mdk92", "mdk92", "2.4"]),
- Job("co-rh9.24", ["distrib/all/build-rpm", CFGFILE, "cyclops", "co-rh9", "rh9", "2.4"]),
- ])
-
-buildTasks = [ jaguarTask,
- pantherTask,
- beastTask1,
- beastTask2,
- cyclopsTask,
- ]
-
-# Finalization. This is for things that must wait until all the
-# builds are done, such as copying the installers someplace, sending
-# emails, etc.
-finalizationTask = Task( Job("", ["distrib/all/build-finalize", CFGFILE]) )
-
-
#----------------------------------------------------------------------
def usage():
if not os.path.isdir("wxPython") or not os.path.isdir("wx"):
print "Please run this script from the root wxPython directory."
sys.exit(1)
+
+
# Check command line flags
for flag in args:
import setup
config.VERSION = setup.VERSION
- # write the config file where the build scripts can find it
- config.write(CFGFILE)
+ config_env = config.asDict()
+ config_env.update(os.environ)
+
+ print `config_env`
+ # Things that need to be done before any of the builds
+ initialTask = Task([ Job("cleanup", "distrib/all/build-setup", env=config_env),
+ Job("makedocs", "distrib/all/build-docs", env=config_env),
+ Job("maketarball", "distrib/all/build-sources", env=config_env),
+ ])
+
+ # Build tasks. Anything that can be done in parallel (depends greatly
+ # on the nature of the build machines configurations...) is a separate
+ # task.
+
+ jaguarTask = Task( Job("whopper.23",
+ "distrib/all/build-osx", [config.OSX_HOST_jaguar, "jaguar", "2.3"], env=config_env) )
+
+ pantherTask = Task([ Job("bigmac.23",
+ "distrib/all/build-osx", [config.OSX_HOST_panther, "panther", "2.3"], env=config_env),
+ Job("bigmac.24",
+ "distrib/all/build-osx", [config.OSX_HOST_panther, "panther", "2.4"], env=config_env)
+ ])
+
+ beastTask1 = Task([ Job("beast.23", "distrib/all/build-windows", ["2.3"], env=config_env),
+ Job("beast.24", "distrib/all/build-windows", ["2.4"], env=config_env),
+ Job("co-mdk102.24", "distrib/all/build-rpm", ["beast", "co-mdk102","mdk102","2.4"], env=config_env),
+ ])
+
+ beastTask2 = Task([ Job("co-fc2.23", "distrib/all/build-rpm", ["beast", "co-fc2", "fc2", "2.3"], env=config_env),
+ Job("co-mdk101.23", "distrib/all/build-rpm", ["beast", "co-mdk101","mdk101","2.3"], env=config_env),
+ Job("co-fc2.24", "distrib/all/build-rpm", ["beast", "co-fc2", "fc2", "2.4"], env=config_env),
+ #Job("co-mdk101.24", "distrib/all/build-rpm", ["beast", "co-mdk101","mdk101","2.4"], env=config),
+ ])
+
+ cyclopsTask = Task([ Job("co-mdk92.23", "distrib/all/build-rpm", ["cyclops", "co-mdk92", "mdk92", "2.3"], env=config_env),
+ Job("co-rh9.23", "distrib/all/build-rpm", ["cyclops", "co-rh9", "rh9", "2.3"], env=config_env),
+ Job("co-mdk92.24", "distrib/all/build-rpm", ["cyclops", "co-mdk92", "mdk92", "2.4"], env=config_env),
+ Job("co-rh9.24", "distrib/all/build-rpm", ["cyclops", "co-rh9", "rh9", "2.4"], env=config_env),
+ ])
+
+ buildTasks = [ jaguarTask,
+ pantherTask,
+ beastTask1,
+ beastTask2,
+ cyclopsTask,
+ ]
+
+ # Finalization. This is for things that must wait until all the
+ # builds are done, such as copying the installers someplace, sending
+ # emails, etc.
+ finalizationTask = Task( Job("", "distrib/all/build-finalize", env=config_env) )
+
+
print "Build getting started at: ", time.ctime()