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
15
# RCS-ID: $Id: build-all 72053 2012-07-12 20:24:04Z RD $
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
54
Job("carbon.26", "distrib/all/build-osx", [config.OSX_HOST_carbon, "2.6", "carbon"], env=config_env),
55
Job("carbon.27", "distrib/all/build-osx", [config.OSX_HOST_carbon, "2.7", "carbon"], env=config_env),
59
Job("cocoa.27", "distrib/all/build-osx", [config.OSX_HOST_cocoa, "2.7", "cocoa"], env=config_env),
64
Job("win32-26", "distrib/all/build-windows", ["2.6"], env=config_env),
65
Job("win32-27", "distrib/all/build-windows", ["2.7"], env=config_env),
66
Job("win64-26", "distrib/all/build-windows", ["2.6", "X64"], env=config_env),
67
Job("win64-27", "distrib/all/build-windows", ["2.7", "X64"], env=config_env),
72
Job("lucid", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lucid", "lucid"], env=config_env),
73
Job("lucid64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lucid64", "lucid64"], env=config_env),
74
Job("maverick", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/maverick", "maverick"], env=config_env),
75
Job("maverick64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/maverick64", "maverick64"], env=config_env),
79
# 64-bit builds are now handled w/o a VM, see above
80
#Job("win64-26", "distrib/all/build-vmwin", ["cyclops", "WinXP-x64-1", "cy-win64", "2.6", "X64"], env=config_env),
81
#Job("win64-27", "distrib/all/build-vmwin", ["cyclops", "WinXP-x64-1", "cy-win64", "2.7", "X64"], env=config_env),
85
Job("etch", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/etch", "etch"], env=config_env),
86
Job("etch64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/etch64", "etch64"], env=config_env),
87
Job("lenny", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny", "lenny"], env=config_env),
88
Job("lenny64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny64", "lenny64"], env=config_env),
91
buildTasks = [ carbonTask,
99
# Finalization. This is for things that must wait until all the
100
# builds are done, such as copying the installers someplace, sending
102
finalizationTask = Task( Job("", "distrib/all/build-finalize", env=config_env) )
104
return initialTask, buildTasks, finalizationTask
107
#----------------------------------------------------------------------
111
print "Usage: build-all [command flags...]"
114
print " dryrun Do the build, but don't copy anywhere (default)"
115
print " daily Do a daily build, copy to starship"
116
print " release Do a normal release (cantidate) build, copy to starship"
118
print "optional command flags:"
119
print " skipsource Don't build the source archives, use the ones"
120
print " already in the staging dir."
121
print " onlysource Exit after building the source and docs archives"
122
print " skipdocs Don't rebuild the docs"
123
print " skipwin Don't do the remote Windows build"
124
print " skiposx Don't do the remote OSX build"
125
print " skiprpm Don't do the remote Linux (RPM) build"
126
print " skipdeb Don't do the remote Linux (DEB) build"
127
print " skipclean Don't do the cleanup step on the remote builds"
128
print " skipupload Don't upload the builds to starship"
130
print " nocohost Don't start the coLinux sessions if they are"
131
print " not already online"
135
#----------------------------------------------------------------------
138
# Make sure we are running in the right directory. TODO: make
139
# this test more robust. Currenly we just test for the presence
140
# of 'wxPython' and 'wx' subdirs.
141
if not os.path.isdir("distrib") or not os.path.isdir("wx"):
142
print "Please run this script from the root wxPython directory."
147
# Check command line flags
149
if flag in ["dryrun", "daily", "release"]:
152
elif flag == "skipsource":
153
config.skipsource = "yes"
155
elif flag == "onlysource":
156
config.onlysource = "yes"
158
elif flag == "skipdocs":
159
config.skipdocs = "yes"
161
elif flag == "skipnewdocs":
162
config.skipnewdocs = "yes"
164
elif flag == "skipwin":
165
config.skipwin = "yes"
167
elif flag == "skiposx":
168
config.skiposx = "yes"
170
elif flag == "skipdeb":
171
config.skipdeb = "yes"
173
elif flag == "skiprpm":
174
config.skiprpm = "yes"
176
elif flag == "skipclean":
177
config.skipclean = "yes"
179
elif flag == "skipupload":
180
config.skipupload = "yes"
182
elif flag == "nocohost":
183
config.startcohost = "no"
186
print 'Unknown flag: "%s"' % flag
191
# ensure the staging area exists
192
if not os.path.exists(config.STAGING_DIR):
193
os.makedirs(config.STAGING_DIR)
195
# Figure out the wxPython version number, possibly adjusted for being a daily build
196
if config.KIND == "daily":
198
config.DAILY = time.strftime("%Y%m%d") # should it include the hour too? 2-digit year?
199
file("DAILY_BUILD", "w").write(config.DAILY)
202
v = config.VERSION = setup.VERSION
203
config.VER2 = '.'.join(v.split('.')[:2])
205
config_env = config.asDict()
206
config_env.update(os.environ)
208
initialTask, buildTasks, finalizationTask = getTasks(config_env)
210
print "Build getting started at: ", time.ctime()
212
# Run the first task, which will create the docs and sources tarballs
213
tr = TaskRunner(initialTask)
216
# cleanup the DAILY_BUILD file
217
if config.KIND == "daily":
218
os.unlink("DAILY_BUILD")
221
if rc != 0 or config.onlysource == "yes":
225
# Run the main build tasks
226
tr = TaskRunner(buildTasks)
232
# when all the builds are done, run the finalization task
233
tr = TaskRunner(finalizationTask)
239
print "Build finished at: ", time.ctime()
245
if __name__ == "__main__":