@@ -328,87 +328,98 @@ class BuildScriptInvocation(object):
328328 # FIXME: We should move the platform-derived arguments to be entirely
329329 # data driven, so that we can eliminate this code duplication and just
330330 # 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 )
331337
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 ()
333342 if not args .build_linux :
334- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
343+ platforms_to_skip_build .add (StdlibDeploymentTarget .Linux )
335344 if not args .build_freebsd :
336- self . platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
345+ platforms_to_skip_build .add (StdlibDeploymentTarget .FreeBSD )
337346 if not args .build_cygwin :
338- self . platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
347+ platforms_to_skip_build .add (StdlibDeploymentTarget .Cygwin )
339348 if not args .build_osx :
340- self . platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
349+ platforms_to_skip_build .add (StdlibDeploymentTarget .OSX )
341350 if not args .build_ios_device :
342- self . platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
351+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOS )
343352 if not args .build_ios_simulator :
344- self .platforms_to_skip_build .add (
345- StdlibDeploymentTarget .iOSSimulator )
353+ platforms_to_skip_build .add (StdlibDeploymentTarget .iOSSimulator )
346354 if not args .build_tvos_device :
347- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
355+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleTV )
348356 if not args .build_tvos_simulator :
349- self . platforms_to_skip_build .add (
357+ platforms_to_skip_build .add (
350358 StdlibDeploymentTarget .AppleTVSimulator )
351359 if not args .build_watchos_device :
352- self . platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
360+ platforms_to_skip_build .add (StdlibDeploymentTarget .AppleWatch )
353361 if not args .build_watchos_simulator :
354- self . platforms_to_skip_build .add (
362+ platforms_to_skip_build .add (
355363 StdlibDeploymentTarget .AppleWatchSimulator )
356364 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
358367
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 ()
361370 if not args .test_linux :
362- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
371+ platforms_to_skip_test .add (StdlibDeploymentTarget .Linux )
363372 if not args .test_freebsd :
364- self . platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
373+ platforms_to_skip_test .add (StdlibDeploymentTarget .FreeBSD )
365374 if not args .test_cygwin :
366- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
375+ platforms_to_skip_test .add (StdlibDeploymentTarget .Cygwin )
367376 if not args .test_osx :
368- self . platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
377+ platforms_to_skip_test .add (StdlibDeploymentTarget .OSX )
369378 if not args .test_ios_host :
370- self . platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
379+ platforms_to_skip_test .add (StdlibDeploymentTarget .iOS )
371380 else :
372381 exit_rejecting_arguments ("error: iOS device tests are not " +
373382 "supported in open-source Swift." )
374383 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 )
380385 if not args .test_tvos_host :
381- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
386+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTV )
382387 else :
383388 exit_rejecting_arguments ("error: tvOS device tests are not " +
384389 "supported in open-source Swift." )
385390 if not args .test_tvos_simulator :
386- self .platforms_to_skip_test .add (
387- StdlibDeploymentTarget .AppleTVSimulator )
391+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleTVSimulator )
388392 if not args .test_watchos_host :
389- self . platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
393+ platforms_to_skip_test .add (StdlibDeploymentTarget .AppleWatch )
390394 else :
391395 exit_rejecting_arguments ("error: watchOS device tests are not " +
392396 "supported in open-source Swift." )
393397 if not args .test_watchos_simulator :
394- self . platforms_to_skip_test .add (
398+ platforms_to_skip_test .add (
395399 StdlibDeploymentTarget .AppleWatchSimulator )
396400 if not args .test_android :
397- self . platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
401+ platforms_to_skip_test .add (StdlibDeploymentTarget .Android )
398402
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 ()
400414 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 )
403416 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 )
405418 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 )
408420 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
412423
413424 def initialize_runtime_environment (self ):
414425 """Change the program environment for building."""
0 commit comments