@@ -904,35 +904,18 @@ class BuildScriptInvocation(object):
904
904
"""Execute the invocation with the configured arguments."""
905
905
906
906
# Convert to a build-script-impl invocation.
907
- (impl_env , impl_args ) = self .convert_to_impl_arguments ()
907
+ (self . impl_env , self . impl_args ) = self .convert_to_impl_arguments ()
908
908
909
909
# If using the legacy implementation, delegate all behavior to
910
910
# `build-script-impl`.
911
911
if self .args .legacy_impl :
912
912
# Execute the underlying build script implementation.
913
- shell .call_without_sleeping ([build_script_impl ] + impl_args ,
914
- env = impl_env , echo = True )
913
+ shell .call_without_sleeping ([build_script_impl ] + self . impl_args ,
914
+ env = self . impl_env , echo = True )
915
915
return
916
916
917
917
# Otherwise, we compute and execute the individual actions ourselves.
918
918
919
- def execute_one_impl_action (host = None , product_class = None , name = None ):
920
- if host is None :
921
- assert (product_class is None and
922
- name == "merged-hosts-lipo" ), "invalid action"
923
- action_name = name
924
- elif product_class is None :
925
- assert name in ("package" , "extractsymbols" ), "invalid action"
926
- action_name = "{}-{}" .format (host .name , name )
927
- else :
928
- assert name is not None , "invalid action"
929
- action_name = "{}-{}-{}" .format (
930
- host .name , product_class .product_name (), name )
931
- shell .call_without_sleeping (
932
- [build_script_impl ] + impl_args + [
933
- "--only-execute" , action_name ],
934
- env = impl_env , echo = self .args .verbose_build )
935
-
936
919
# Compute the list of hosts to operate on.
937
920
all_host_names = [
938
921
self .args .host_target ] + self .args .cross_compile_hosts
@@ -965,17 +948,17 @@ class BuildScriptInvocation(object):
965
948
" " .join (config .swift_benchmark_run_targets )))
966
949
967
950
for product_class in impl_product_classes :
968
- execute_one_impl_action (host_target , product_class , "build" )
951
+ self . _execute_build_action (host_target , product_class )
969
952
970
953
# Test...
971
954
for host_target in all_hosts :
972
955
for product_class in impl_product_classes :
973
- execute_one_impl_action (host_target , product_class , "test" )
956
+ self . _execute_test_action (host_target , product_class )
974
957
975
958
# Install...
976
959
for host_target in all_hosts :
977
960
for product_class in impl_product_classes :
978
- execute_one_impl_action (host_target , product_class , "install" )
961
+ self . _execute_install_action (host_target , product_class )
979
962
980
963
# Non-build-script-impl products...
981
964
# Note: currently only supports building for the host.
@@ -996,14 +979,46 @@ class BuildScriptInvocation(object):
996
979
997
980
# Extract symbols...
998
981
for host_target in all_hosts :
999
- execute_one_impl_action (host_target , name = "extractsymbols" )
982
+ self . _execute_extract_symbols_action (host_target )
1000
983
1001
984
# Package...
1002
985
for host_target in all_hosts :
1003
- execute_one_impl_action (host_target , name = "package" )
986
+ self . _execute_package_action (host_target )
1004
987
1005
988
# Lipo...
1006
- execute_one_impl_action (name = "merged-hosts-lipo" )
989
+ self ._execute_merged_host_lipo_action ()
990
+
991
+ def _execute_build_action (self , host_target , product_class ):
992
+ action_name = "{}-{}-build" .format (host_target .name ,
993
+ product_class .product_name ())
994
+ self ._execute_action (action_name )
995
+
996
+ def _execute_test_action (self , host_target , product_class ):
997
+ action_name = "{}-{}-test" .format (host_target .name ,
998
+ product_class .product_name ())
999
+ self ._execute_action (action_name )
1000
+
1001
+ def _execute_install_action (self , host_target , product_class ):
1002
+ action_name = "{}-{}-install" .format (host_target .name ,
1003
+ product_class .product_name ())
1004
+ self ._execute_action (action_name )
1005
+
1006
+ def _execute_extract_symbols_action (self , host_target ):
1007
+ action_name = "{}-extractsymbols" .format (host_target .name )
1008
+ self ._execute_action (action_name )
1009
+
1010
+ def _execute_package_action (self , host_target ):
1011
+ action_name = "{}-package" .format (host_target .name )
1012
+ self ._execute_action (action_name )
1013
+
1014
+ def _execute_merged_host_lipo_action (self ):
1015
+ self ._execute_action ("merged-hosts-lipo" )
1016
+
1017
+ def _execute_action (self , action_name ):
1018
+ shell .call_without_sleeping (
1019
+ [build_script_impl ] + self .impl_args +
1020
+ ["--only-execute" , action_name ],
1021
+ env = self .impl_env , echo = self .args .verbose_build )
1007
1022
1008
1023
1009
1024
# Provide a short delay so accidentally invoked clean builds can be canceled.
0 commit comments