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