@@ -328,87 +328,98 @@ class BuildScriptInvocation(object):
328
328
# FIXME: We should move the platform-derived arguments to be entirely
329
329
# data driven, so that we can eliminate this code duplication and just
330
330
# iterate over all supported platforms.
331
+ self .platforms_to_skip_build = self .__platforms_to_skip_build (args )
332
+ self .platforms_to_skip_test = self .__platforms_to_skip_test (args )
333
+ self .platforms_archs_to_skip_test = \
334
+ self .__platforms_archs_to_skip_test (args )
335
+ self .platforms_to_skip_test_host = \
336
+ self .__platforms_to_skip_test_host (args )
331
337
332
- self .platforms_to_skip_build = set ()
338
+ self .build_libparser_only = args .build_libparser_only
339
+
340
+ def __platforms_to_skip_build (self , args ):
341
+ platforms_to_skip_build = set ()
333
342
if not args .build_linux :
334
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
343
+ platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
335
344
if not args .build_freebsd :
336
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
345
+ platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
337
346
if not args .build_cygwin :
338
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
347
+ platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
339
348
if not args .build_osx :
340
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
349
+ platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
341
350
if not args .build_ios_device :
342
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
351
+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
343
352
if not args .build_ios_simulator :
344
- self .platforms_to_skip_build .add (
345
- StdlibDeploymentTarget .iOSSimulator )
353
+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOSSimulator )
346
354
if not args .build_tvos_device :
347
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
355
+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
348
356
if not args .build_tvos_simulator :
349
- self . platforms_to_skip_build .add (
357
+ platforms_to_skip_build .add (
350
358
StdlibDeploymentTarget .AppleTVSimulator )
351
359
if not args .build_watchos_device :
352
- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
360
+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
353
361
if not args .build_watchos_simulator :
354
- self . platforms_to_skip_build .add (
362
+ platforms_to_skip_build .add (
355
363
StdlibDeploymentTarget .AppleWatchSimulator )
356
364
if not args .build_android :
357
- self .platforms_to_skip_build .add (StdlibDeploymentTarget .Android )
365
+ platforms_to_skip_build .add (StdlibDeploymentTarget .Android )
366
+ return platforms_to_skip_build
358
367
359
- self . platforms_to_skip_test = set ()
360
- self . platforms_archs_to_skip_test = set ()
368
+ def __platforms_to_skip_test ( self , args ):
369
+ platforms_to_skip_test = set ()
361
370
if not args .test_linux :
362
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
371
+ platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
363
372
if not args .test_freebsd :
364
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
373
+ platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
365
374
if not args .test_cygwin :
366
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
375
+ platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
367
376
if not args .test_osx :
368
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
377
+ platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
369
378
if not args .test_ios_host :
370
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
379
+ platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
371
380
else :
372
381
exit_rejecting_arguments ("error: iOS device tests are not " +
373
382
"supported in open-source Swift." )
374
383
if not args .test_ios_simulator :
375
- self .platforms_to_skip_test .add (
376
- StdlibDeploymentTarget .iOSSimulator )
377
- if not args .test_ios_32bit_simulator :
378
- self .platforms_archs_to_skip_test .add (
379
- StdlibDeploymentTarget .iOSSimulator .i386 )
384
+ platforms_to_skip_test .add (StdlibDeploymentTarget .iOSSimulator )
380
385
if not args .test_tvos_host :
381
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
386
+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
382
387
else :
383
388
exit_rejecting_arguments ("error: tvOS device tests are not " +
384
389
"supported in open-source Swift." )
385
390
if not args .test_tvos_simulator :
386
- self .platforms_to_skip_test .add (
387
- StdlibDeploymentTarget .AppleTVSimulator )
391
+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTVSimulator )
388
392
if not args .test_watchos_host :
389
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
393
+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
390
394
else :
391
395
exit_rejecting_arguments ("error: watchOS device tests are not " +
392
396
"supported in open-source Swift." )
393
397
if not args .test_watchos_simulator :
394
- self . platforms_to_skip_test .add (
398
+ platforms_to_skip_test .add (
395
399
StdlibDeploymentTarget .AppleWatchSimulator )
396
400
if not args .test_android :
397
- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
401
+ platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
398
402
399
- self .platforms_to_skip_test_host = set ()
403
+ return platforms_to_skip_test
404
+
405
+ def __platforms_archs_to_skip_test (self , args ):
406
+ platforms_archs_to_skip_test = set ()
407
+ if not args .test_ios_32bit_simulator :
408
+ platforms_archs_to_skip_test .add (
409
+ StdlibDeploymentTarget .iOSSimulator .i386 )
410
+ return platforms_archs_to_skip_test
411
+
412
+ def __platforms_to_skip_test_host (self , args ):
413
+ platforms_to_skip_test_host = set ()
400
414
if not args .test_android_host :
401
- self .platforms_to_skip_test_host .add (
402
- StdlibDeploymentTarget .Android )
415
+ platforms_to_skip_test_host .add (StdlibDeploymentTarget .Android )
403
416
if not args .test_ios_host :
404
- self . platforms_to_skip_test_host .add (StdlibDeploymentTarget .iOS )
417
+ platforms_to_skip_test_host .add (StdlibDeploymentTarget .iOS )
405
418
if not args .test_tvos_host :
406
- self .platforms_to_skip_test_host .add (
407
- StdlibDeploymentTarget .AppleTV )
419
+ platforms_to_skip_test_host .add (StdlibDeploymentTarget .AppleTV )
408
420
if not args .test_watchos_host :
409
- self .platforms_to_skip_test_host .add (
410
- StdlibDeploymentTarget .AppleWatch )
411
- self .build_libparser_only = args .build_libparser_only
421
+ platforms_to_skip_test_host .add (StdlibDeploymentTarget .AppleWatch )
422
+ return platforms_to_skip_test_host
412
423
413
424
def initialize_runtime_environment (self ):
414
425
"""Change the program environment for building."""
0 commit comments