@@ -208,31 +208,43 @@ def main():
208
208
if args .force :
209
209
do_clear = True
210
210
211
+ system_libraries , system_tasks = get_system_tasks ()
212
+
211
213
# process tasks
212
214
auto_tasks = False
213
- tasks = args .targets
214
- system_libraries , system_tasks = get_system_tasks ()
215
- if 'SYSTEM' in tasks :
216
- tasks = system_tasks
217
- auto_tasks = True
218
- elif 'USER' in tasks :
219
- tasks = PORTS
220
- auto_tasks = True
221
- elif 'MINIMAL' in tasks :
222
- tasks = MINIMAL_TASKS
223
- auto_tasks = True
224
- elif 'MINIMAL_PIC' in tasks :
225
- tasks = MINIMAL_PIC_TASKS
226
- auto_tasks = True
227
- elif 'ALL' in tasks :
228
- tasks = system_tasks + PORTS
229
- auto_tasks = True
215
+ task_targets = dict .fromkeys (args .targets ) # use dict to keep targets order
216
+
217
+ # subsitute
218
+ predefined_tasks = {
219
+ 'SYSTEM' : system_tasks ,
220
+ 'USER' : PORTS ,
221
+ 'MINIMAL' : MINIMAL_TASKS ,
222
+ 'MINIMAL_PIC' : MINIMAL_PIC_TASKS ,
223
+ 'ALL' : system_tasks + PORTS ,
224
+ }
225
+ for name , tasks in predefined_tasks .items ():
226
+ if name in task_targets :
227
+ task_targets [name ] = tasks
228
+ auto_tasks = True
229
+
230
+ # flatten tasks
231
+ tasks = []
232
+ for name , targets in task_targets .items ():
233
+ if targets is None :
234
+ # Use target name as task
235
+ tasks .append (name )
236
+ else :
237
+ # There are some ports that we don't want to build as part
238
+ # of ALL since the are not well tested or widely used:
239
+ if 'cocos2d' in targets :
240
+ targets .remove ('cocos2d' )
241
+
242
+ # Use targets from predefined_tasks
243
+ tasks .extend (targets )
244
+
230
245
if auto_tasks :
231
- # There are some ports that we don't want to build as part
232
- # of ALL since the are not well tested or widely used:
233
- skip_tasks = ['cocos2d' ]
234
- tasks = [x for x in tasks if x not in skip_tasks ]
235
246
print ('Building targets: %s' % ' ' .join (tasks ))
247
+
236
248
for what in tasks :
237
249
for old , new in legacy_prefixes .items ():
238
250
if what .startswith (old ):
0 commit comments