]>
git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/build_controller.py
1 import sys
, os
, string
, time
, shutil
4 from taskrunner
import Job
, Task
, TaskRunner
, Config
6 # read in the build settings...
8 CFGFILE
= "./scripts/build-environ.cfg"
12 config
.WXWIN
= os
.path
.abspath("..")
17 # ensure the staging area exists
18 if not os
.path
.exists(config
.STAGING_DIR
):
19 os
.makedirs(config
.STAGING_DIR
)
21 # Figure out the wxPython version number, possibly adjusted for being a daily build
22 if config
.KIND
== "daily":
24 config
.DAILY
= time
.strftime("%Y%m%d") # should it include the hour too? 2-digit year?
25 file("DAILY_BUILD", "w").write(config
.DAILY
)
26 # stamp the date on daily builds
27 config
.BUILD_VERSION
=config
.BUILD_VERSION
+ "-" + config
.DAILY
29 # Let the user override build machine names, etc., etc. with their own
30 # config file settings
32 myconfig_file
= os
.path
.expanduser("~/wxrelease-environ.cfg")
33 if os
.path
.exists(myconfig_file
):
35 myconfig
.read(myconfig_file
)
37 # TODO: Set up different environs for daily, release, etc.
38 # so that people can have different configs for different builds
40 # prepare the environment file
41 config_env
= config
.asDict()
42 config_env
.update(os
.environ
)
44 config_env
.update(myconfig
.asDict())
46 tasks
= Task([ Job("pre-flight", "./scripts/pre-flight.sh", env
=config_env
),
47 Job("win_build", "./scripts/build-windows.sh", env
=config_env
),
48 Job("lin_build", "./scripts/build-linux.sh", env
=config_env
),
49 Job("mac_build", "./scripts/build-mac.sh", env
=config_env
),
52 print "Build getting started at: ", time
.ctime()
55 # Run the first task, which will create the docs and sources tarballs
56 tr
= TaskRunner(tasks
)
59 if rc
== 0 and config
.delete_temps
== "yes":
60 shutil
.rmtree(config
.WX_TEMP_DIR
)
62 # cleanup the DAILY_BUILD file
63 if config
.KIND
== "daily":
64 os
.unlink("DAILY_BUILD")
66 print "Build finished at: ", time
.ctime()