]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/all/build-all
wxSscanf() and friends are now Unicode+ANSI friendly wrappers instead of defines...
[wxWidgets.git] / wxPython / distrib / all / build-all
1 #!/usr/bin/python -u
2 #----------------------------------------------------------------------
3 # Name: build-all.py
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.
7 #
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.
11 #
12 # Author: Robin Dunn
13 #
14 # Created: 05-Nov-2004
15 # RCS-ID: $Id$
16 # Copyright: (c) 2004 by Total Control Software
17 # Licence: wxWindows license
18 #----------------------------------------------------------------------
19
20 import sys
21 import os
22 import time
23 from taskrunner import Job, Task, TaskRunner, Config
24
25 #----------------------------------------------------------------------
26 # Configuration items
27
28 CFGFILE = "./distrib/all/build-environ.cfg"
29 config = Config()
30 config.read(CFGFILE)
31
32 #----------------------------------------------------------------------
33 # Define all the build tasks
34
35 class Job(Job):
36 LOGBASE = "./tmp"
37
38 #----------------------------------------------------------------------
39
40 def getTasks(config_env):
41 # Things that need to be done before any of the builds
42 initialTask = Task([
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),
46 ])
47
48 # Build tasks. Anything that can be done in parallel (depends greatly
49 # on the nature of the build machines configurations...) is a separate
50 # task.
51
52 ## jaguarTask = Task( Job("whopper.23", "distrib/all/build-osx",
53 ## [config.OSX_HOST_jaguar, "2.3", "ansi"], env=config_env) )
54
55 pantherTask = Task( [ Job("bigmac.23",
56 "distrib/all/build-osx",
57 [config.OSX_HOST_panther, "2.3", "both"], env=config_env),
58 Job("bigmac.24",
59 "distrib/all/build-osx",
60 [config.OSX_HOST_panther, "2.4", "both"], env=config_env),
61 Job("bigmac.25",
62 "distrib/all/build-osx",
63 [config.OSX_HOST_panther, "2.5", "both"], env=config_env)
64 ])
65
66 tigerTask = Task([ #Job("smallfry.23",
67 # "distrib/all/build-osx",
68 # [config.OSX_HOST_tiger, "2.3", "both"], env=config_env),
69 Job("smallfry.24",
70 "distrib/all/build-osx",
71 [config.OSX_HOST_tiger, "2.4", "both", "universal"], env=config_env),
72 Job("smallfry.25",
73 "distrib/all/build-osx",
74 [config.OSX_HOST_tiger, "2.5", "both", "universal"], env=config_env)
75 ])
76
77
78 beastTask1 = Task(
79 [ Job("beast.23", "distrib/all/build-windows", ["2.3"], env=config_env),
80 # Job("co-rh9.23", "distrib/all/build-rpm", ["beast", "co-rh9", "rh9", "2.3"], env=config_env),
81 Job("beast.24", "distrib/all/build-windows", ["2.4"], env=config_env),
82 # Job("co-rh9.24", "distrib/all/build-rpm", ["beast", "co-rh9", "rh9", "2.4"], env=config_env),
83 Job("beast.25", "distrib/all/build-windows", ["2.5"], env=config_env),
84 Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env=config_env),
85 ])
86
87 beastTask2 = Task(
88 [ #Job("co-fc2.23", "distrib/all/build-rpm", ["beast", "co-fc2", "fc2", "2.3"], env=config_env),
89 Job("co-fc4.24", "distrib/all/build-rpm", ["beast", "co-fc4", "fc4", "2.4"], env=config_env),
90 Job("co-mdk102.24", "distrib/all/build-rpm", ["beast", "co-mdk102", "mdk102", "2.4"], env=config_env),
91 # Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env=config_env),
92 ])
93
94 cyclopsTask1 = Task([
95 Job("cyclops.d", "distrib/all/build-deb", ["cyclops", "/work/chroot/dapper", "dapper"], env=config_env),
96 Job("cyclops.d64", "distrib/all/build-deb", ["cyclops", "/work/chroot/dapper64", "dapper64"], env=config_env),
97 Job("cyclops.fc6", "distrib/all/build-chrpm",
98 ["cyclops", "/work/chroot/fc6", "fc6", "fc6", "2.4"], env=config_env),
99 ])
100
101 cyclopsTask2 = Task([
102 Job("cyclops.f", "distrib/all/build-deb", ["cyclops", "/work/chroot/feisty", "feisty"], env=config_env),
103 Job("cyclops.f64", "distrib/all/build-deb", ["cyclops", "/work/chroot/feisty64", "feisty64"], env=config_env),
104 ])
105
106 buildTasks = [ #jaguarTask,
107 pantherTask,
108 tigerTask,
109 beastTask1,
110 beastTask2,
111 cyclopsTask1,
112 cyclopsTask2,
113 ]
114
115 # Finalization. This is for things that must wait until all the
116 # builds are done, such as copying the installers someplace, sending
117 # emails, etc.
118 finalizationTask = Task( Job("", "distrib/all/build-finalize", env=config_env) )
119
120 return initialTask, buildTasks, finalizationTask
121
122
123 #----------------------------------------------------------------------
124
125 def usage():
126 print ""
127 print "Usage: build-all [command flags...]"
128 print ""
129 print "build types:"
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"
133 print ""
134 print "optional command flags:"
135 print " skipsource Don't build the source archives, use the ones"
136 print " already in the staging dir."
137 print " onlysource Exit after building the source and docs archives"
138 print " skipdocs Don't rebuild the docs"
139 print " skipwin Don't do the remote Windows build"
140 print " skiposx Don't do the remote OSX build"
141 print " skiprpm Don't do the remote Linux (RPM) build"
142 print " skipdeb Don't do the remote Linux (DEB) build"
143 print " skipclean Don't do the cleanup step on the remote builds"
144 print " skipupload Don't upload the builds to starship"
145 print " ansi Also do the ansi builds"
146 print ""
147 print " nocohost Don't start the coLinux sessions if they are"
148 print " not already online"
149 print ""
150
151
152 #----------------------------------------------------------------------
153
154 def main(args):
155 # Make sure we are running in the right directory. TODO: make
156 # this test more robust. Currenly we just test for the presence
157 # of 'wxPython' and 'wx' subdirs.
158 if not os.path.isdir("wxPython") or not os.path.isdir("wx"):
159 print "Please run this script from the root wxPython directory."
160 sys.exit(1)
161
162
163
164 # Check command line flags
165 for flag in args:
166 if flag in ["dryrun", "daily", "release"]:
167 config.KIND = flag
168
169 elif flag == "skipsource":
170 config.skipsource = "yes"
171
172 elif flag == "onlysource":
173 config.onlysource = "yes"
174
175 elif flag == "skipdocs":
176 config.skipdocs = "yes"
177
178 elif flag == "skipnewdocs":
179 config.skipnewdocs = "yes"
180
181 elif flag == "skipwin":
182 config.skipwin = "yes"
183
184 elif flag == "skiposx":
185 config.skiposx = "yes"
186
187 elif flag == "skipdeb":
188 config.skipdeb = "yes"
189
190 elif flag == "skiprpm":
191 config.skiprpm = "yes"
192
193 elif flag == "skipclean":
194 config.skipclean = "yes"
195
196 elif flag == "skipupload":
197 config.skipupload = "yes"
198
199 elif flag == "ansi":
200 config.buildansi = "yes"
201
202 elif flag == "nocohost":
203 config.startcohost = "no"
204
205 else:
206 print 'Unknown flag: "%s"' % flag
207 usage()
208 sys.exit(2)
209
210
211 # ensure the staging area exists
212 if not os.path.exists(config.STAGING_DIR):
213 os.makedirs(config.STAGING_DIR)
214
215 # Figure out the wxPython version number, possibly adjusted for being a daily build
216 if config.KIND == "daily":
217 t = time.localtime()
218 config.DAILY = time.strftime("%Y%m%d") # should it include the hour too? 2-digit year?
219 file("DAILY_BUILD", "w").write(config.DAILY)
220 sys.path.append('.')
221 import setup
222 v = config.VERSION = setup.VERSION
223 config.VER2 = '.'.join(v.split('.')[:2])
224
225 config_env = config.asDict()
226 config_env.update(os.environ)
227
228 initialTask, buildTasks, finalizationTask = getTasks(config_env)
229
230 print "Build getting started at: ", time.ctime()
231
232 # Run the first task, which will create the docs and sources tarballs
233 tr = TaskRunner(initialTask)
234 rc = tr.run()
235
236 # cleanup the DAILY_BUILD file
237 if config.KIND == "daily":
238 os.unlink("DAILY_BUILD")
239
240 # Quit now?
241 if rc != 0 or config.onlysource == "yes":
242 sys.exit(rc)
243
244
245 # Run the main build tasks
246 tr = TaskRunner(buildTasks)
247 rc = tr.run()
248 if rc != 0:
249 sys.exit(rc)
250
251
252 # when all the builds are done, run the finalization task
253 tr = TaskRunner(finalizationTask)
254 rc = tr.run()
255 if rc != 0:
256 sys.exit(rc)
257
258
259 print "Build finished at: ", time.ctime()
260 sys.exit(0)
261
262
263
264
265 if __name__ == "__main__":
266 main(sys.argv[1:])