@@ -322,87 +322,98 @@ class BuildScriptInvocation(object):
322322 # FIXME: We should move the platform-derived arguments to be entirely
323323 # data driven, so that we can eliminate this code duplication and just
324324 # 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 )
325331
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 ()
327336 if not args .build_linux :
328- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
337+ platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
329338 if not args .build_freebsd :
330- self . platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
339+ platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
331340 if not args .build_cygwin :
332- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
341+ platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
333342 if not args .build_osx :
334- self . platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
343+ platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
335344 if not args .build_ios_device :
336- self . platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
345+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
337346 if not args .build_ios_simulator :
338- self .platforms_to_skip_build .add (
339- StdlibDeploymentTarget .iOSSimulator )
347+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOSSimulator )
340348 if not args .build_tvos_device :
341- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
349+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
342350 if not args .build_tvos_simulator :
343- self . platforms_to_skip_build .add (
351+ platforms_to_skip_build .add (
344352 StdlibDeploymentTarget .AppleTVSimulator )
345353 if not args .build_watchos_device :
346- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
354+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
347355 if not args .build_watchos_simulator :
348- self . platforms_to_skip_build .add (
356+ platforms_to_skip_build .add (
349357 StdlibDeploymentTarget .AppleWatchSimulator )
350358 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
352361
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 ()
355364 if not args .test_linux :
356- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
365+ platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
357366 if not args .test_freebsd :
358- self . platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
367+ platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
359368 if not args .test_cygwin :
360- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
369+ platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
361370 if not args .test_osx :
362- self . platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
371+ platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
363372 if not args .test_ios_host :
364- self . platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
373+ platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
365374 else :
366375 exit_rejecting_arguments ("error: iOS device tests are not " +
367376 "supported in open-source Swift." )
368377 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 )
374379 if not args .test_tvos_host :
375- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
380+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
376381 else :
377382 exit_rejecting_arguments ("error: tvOS device tests are not " +
378383 "supported in open-source Swift." )
379384 if not args .test_tvos_simulator :
380- self .platforms_to_skip_test .add (
381- StdlibDeploymentTarget .AppleTVSimulator )
385+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTVSimulator )
382386 if not args .test_watchos_host :
383- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
387+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
384388 else :
385389 exit_rejecting_arguments ("error: watchOS device tests are not " +
386390 "supported in open-source Swift." )
387391 if not args .test_watchos_simulator :
388- self . platforms_to_skip_test .add (
392+ platforms_to_skip_test .add (
389393 StdlibDeploymentTarget .AppleWatchSimulator )
390394 if not args .test_android :
391- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
395+ platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
392396
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 ()
394408 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 )
397410 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 )
399412 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 )
402414 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
406417
407418 def initialize_runtime_environment (self ):
408419 """Change the program environment for building."""
0 commit comments