]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/all/build-all
don't pass unneeded arguments to AdustForGrowables()
[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 ])
62
63 tigerTask = Task([ #Job("smallfry.23",
64 # "distrib/all/build-osx",
65 # [config.OSX_HOST_tiger, "2.3", "both"], env=config_env),
66 Job("smallfry.24",
67 "distrib/all/build-osx",
68 [config.OSX_HOST_tiger, "2.4", "both", "universal"], env=config_env),
69 Job("smallfry.25",
70 "distrib/all/build-osx",
71 [config.OSX_HOST_tiger, "2.5", "both", "universal"], env=config_env)
72 ])
73
74
75 beastTask1 = Task(
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),
81 Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env=config_env),
82 ])
83
84 beastTask2 = Task(
85 [ #Job("co-fc2.23", "distrib/all/build-rpm", ["beast", "co-fc2", "fc2", "2.3"], env=config_env),
86 Job("co-fc4.24", "distrib/all/build-rpm", ["beast", "co-fc4", "fc4", "2.4"], env=config_env),
87 Job("co-mdk102.24", "distrib/all/build-rpm", ["beast", "co-mdk102", "mdk102", "2.4"], env=config_env),
88 # Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env=config_env),
89 ])
90
91 xavierTask = Task([
92 Job("xavier.d", "distrib/all/build-deb", ["xavier", "/work/chroot/dapper", "dapper"], env=config_env),
93 Job("xavier.f", "distrib/all/build-deb", ["xavier", "/work/chroot/feisty", "feisty"], env=config_env),
94 ])
95
96 buildTasks = [ #jaguarTask,
97 pantherTask,
98 tigerTask,
99 beastTask1,
100 beastTask2,
101 xavierTask,
102 ]
103
104 # Finalization. This is for things that must wait until all the
105 # builds are done, such as copying the installers someplace, sending
106 # emails, etc.
107 finalizationTask = Task( Job("", "distrib/all/build-finalize", env=config_env) )
108
109 return initialTask, buildTasks, finalizationTask
110
111
112 #----------------------------------------------------------------------
113
114 def usage():
115 print ""
116 print "Usage: build-all [command flags...]"
117 print ""
118 print "build types:"
119 print " dryrun Do the build, but don't copy anywhere (default)"
120 print " daily Do a daily build, copy to starship"
121 print " release Do a normal release (cantidate) build, copy to starship"
122 print ""
123 print "optional command flags:"
124 print " skipsource Don't build the source archives, use the ones"
125 print " already in the staging dir."
126 print " onlysource Exit after building the source and docs archives"
127 print " skipdocs Don't rebuild the docs"
128 print " skipwin Don't do the remote Windows build"
129 print " skiposx Don't do the remote OSX build"
130 print " skiprpm Don't do the remote Linux (RPM) build"
131 print " skipdeb Don't do the remote Linux (DEB) build"
132 print " skipclean Don't do the cleanup step on the remote builds"
133 print " skipupload Don't upload the builds to starship"
134 print " ansi Also do the ansi builds"
135 print ""
136 print " nocohost Don't start the coLinux sessions if they are"
137 print " not already online"
138 print ""
139
140
141 #----------------------------------------------------------------------
142
143 def main(args):
144 # Make sure we are running in the right directory. TODO: make
145 # this test more robust. Currenly we just test for the presence
146 # of 'wxPython' and 'wx' subdirs.
147 if not os.path.isdir("wxPython") or not os.path.isdir("wx"):
148 print "Please run this script from the root wxPython directory."
149 sys.exit(1)
150
151
152
153 # Check command line flags
154 for flag in args:
155 if flag in ["dryrun", "daily", "release"]:
156 config.KIND = flag
157
158 elif flag == "skipsource":
159 config.skipsource = "yes"
160
161 elif flag == "onlysource":
162 config.onlysource = "yes"
163
164 elif flag == "skipdocs":
165 config.skipdocs = "yes"
166
167 elif flag == "skipnewdocs":
168 config.skipnewdocs = "yes"
169
170 elif flag == "skipwin":
171 config.skipwin = "yes"
172
173 elif flag == "skiposx":
174 config.skiposx = "yes"
175
176 elif flag == "skipdeb":
177 config.skipdeb = "yes"
178
179 elif flag == "skiprpm":
180 config.skiprpm = "yes"
181
182 elif flag == "skipclean":
183 config.skipclean = "yes"
184
185 elif flag == "skipupload":
186 config.skipupload = "yes"
187
188 elif flag == "ansi":
189 config.buildansi = "yes"
190
191 elif flag == "nocohost":
192 config.startcohost = "no"
193
194 else:
195 print 'Unknown flag: "%s"' % flag
196 usage()
197 sys.exit(2)
198
199
200 # ensure the staging area exists
201 if not os.path.exists(config.STAGING_DIR):
202 os.makedirs(config.STAGING_DIR)
203
204 # Figure out the wxPython version number, possibly adjusted for being a daily build
205 if config.KIND == "daily":
206 t = time.localtime()
207 config.DAILY = time.strftime("%Y%m%d") # should it include the hour too? 2-digit year?
208 file("DAILY_BUILD", "w").write(config.DAILY)
209 sys.path.append('.')
210 import setup
211 v = config.VERSION = setup.VERSION
212 config.VER2 = '.'.join(v.split('.')[:2])
213
214 config_env = config.asDict()
215 config_env.update(os.environ)
216
217 initialTask, buildTasks, finalizationTask = getTasks(config_env)
218
219 print "Build getting started at: ", time.ctime()
220
221 # Run the first task, which will create the docs and sources tarballs
222 tr = TaskRunner(initialTask)
223 rc = tr.run()
224
225 # cleanup the DAILY_BUILD file
226 if config.KIND == "daily":
227 os.unlink("DAILY_BUILD")
228
229 # Quit now?
230 if rc != 0 or config.onlysource == "yes":
231 sys.exit(rc)
232
233
234 # Run the main build tasks
235 tr = TaskRunner(buildTasks)
236 rc = tr.run()
237 if rc != 0:
238 sys.exit(rc)
239
240
241 # when all the builds are done, run the finalization task
242 tr = TaskRunner(finalizationTask)
243 rc = tr.run()
244 if rc != 0:
245 sys.exit(rc)
246
247
248 print "Build finished at: ", time.ctime()
249 sys.exit(0)
250
251
252
253
254 if __name__ == "__main__":
255 main(sys.argv[1:])