parameters: (ctx)
docstring: Update the bootstrap_tool_param setting in user_settings.options with the platform
      availability settings from the enable_<platform> settings.
      
      :param ctx: Context
docstring_summary: Update the bootstrap_tool_param setting in user_settings.options with the platform
      availability settings from the enable_<platform> settings.
      
      :param ctx: Context
docstring_tokens: Update the bootstrap_tool_param setting in user_settings . options with the platform availability settings from the enable_<platform > settings . : param ctx : Context
function: def update_bootstrap_tool_param(ctx):
      """
      Update the bootstrap_tool_param setting in user_settings.options with the platform
      availability settings from the enable_<platform> settings.
      
      :param ctx: Context
      """
      
      all_platform_settings = LUMBERYARD_SETTINGS.get_all_platform_settings()
      
      # Track the eligible platform's capabilities in 2 different collections based on them being enabled or not
      enabled_platform_capability_set = set()
      disabled_platform_capability_set = set()
      
      for platform_settings in all_platform_settings:
          
          if not platform_settings.enabled:
              # If the platform is permanently disabled, then setup assistant will not affect it
              continue
              
          sa_capabilities = platform_settings.attributes.get('sa_capability')
          dependent_platform = platform_settings.attributes.get('dependent_platform')
          if not sa_capabilities:
              # Platform is not affected by setup assistant, so skip
              continue
          if dependent_platform:
              # If this platform has a dependent platform, then its not a primary capability, so skip
              continue
  
          if not isinstance(sa_capabilities, list):
              sa_capabilities = [sa_capabilities]
  
          for sa_capability in sa_capabilities:
              capability_key = sa_capability.get('key')
              # Place each capability name for the platform in either the enabled or disabled collection
              if LUMBERYARD_SETTINGS.is_platform_enabled(platform_settings.platform):
                  enabled_platform_capability_set.add(capability_key)
              else:
                  disabled_platform_capability_set.add(capability_key)
  
      
      # Filter out the current capabilities and add to the 'filtered' selection capabilities that
      # are not explicitly disabled
  
      # Perform set difference of the enabled capability from the disabled capabilities
      # If a capability is in the enabled set then it cannot be in the disabled set
      disabled_platform_capability_set = disabled_platform_capability_set - enabled_platform_capability_set
      filtered_capabilities = set()
      current_parsed_capabilities = ctx.get_enabled_capabilities()
      if current_parsed_capabilities:
          for capability in current_parsed_capabilities:
              if capability not in disabled_platform_capability_set:
                  filtered_capabilities.add(capability)
  
      # Sort the capabilities just in case to keep a consistent order for better determinism
      sorted_capabilites = list(filtered_capabilities)
      sorted_capabilites.sort(reverse=True)
      
      # Scrub out all of the '--enable-capability <capability>' from the current bootstrap_tool_param line so we can re-inject the
      # validated capabilities
      ctx.parsed_capabilities = sorted_capabilites
      bootstrap_tool_param = ctx.options.bootstrap_tool_param
  
      params = re.sub(r'(--enablecapability\s+\w*)', '', bootstrap_tool_param).split()
      if params and params[-1] == '--enablecapability':
          params.remove('--enablecapability')
      # If there exists a '--none' in the param line, make sure that the capabilities are inject right after it
      insert_index = 0 if '--none' not in params else params.index('--none') + 1
      for enabled_platform_capability in sorted_capabilites:
          params.insert(insert_index, enabled_platform_capability)
          params.insert(insert_index, '--enablecapability')
      new_bootstrap_tool_param = ' '.join(params)
      
      # Update the settings and the options
      ctx.options.bootstrap_tool_param = new_bootstrap_tool_param
      LUMBERYARD_SETTINGS.set_settings_value('bootstrap_tool_param', new_bootstrap_tool_param)
  
      # If there was a change, then update the user_settings.options file
      if bootstrap_tool_param != new_bootstrap_tool_param:
          LUMBERYARD_SETTINGS.update_settings_file(apply_from_command_line=False,
                                                   override_value_map={'bootstrap_tool_param': new_bootstrap_tool_param})
function_tokens: def update_bootstrap_tool_param ( ctx ) : all_platform_settings = LUMBERYARD_SETTINGS . get_all_platform_settings ( ) # Track the eligible platform's capabilities in 2 different collections based on them being enabled or not enabled_platform_capability_set = set ( ) disabled_platform_capability_set = set ( ) for platform_settings in all_platform_settings : if not platform_settings . enabled : # If the platform is permanently disabled, then setup assistant will not affect it continue sa_capabilities = platform_settings . attributes . get ( 'sa_capability' ) dependent_platform = platform_settings . attributes . get ( 'dependent_platform' ) if not sa_capabilities : # Platform is not affected by setup assistant, so skip continue if dependent_platform : # If this platform has a dependent platform, then its not a primary capability, so skip continue if not isinstance ( sa_capabilities , list ) : sa_capabilities = [ sa_capabilities ] for sa_capability in sa_capabilities : capability_key = sa_capability . get ( 'key' ) # Place each capability name for the platform in either the enabled or disabled collection if LUMBERYARD_SETTINGS . is_platform_enabled ( platform_settings . platform ) : enabled_platform_capability_set . add ( capability_key ) else : disabled_platform_capability_set . add ( capability_key ) # Filter out the current capabilities and add to the 'filtered' selection capabilities that # are not explicitly disabled # Perform set difference of the enabled capability from the disabled capabilities # If a capability is in the enabled set then it cannot be in the disabled set disabled_platform_capability_set = disabled_platform_capability_set - enabled_platform_capability_set filtered_capabilities = set ( ) current_parsed_capabilities = ctx . get_enabled_capabilities ( ) if current_parsed_capabilities : for capability in current_parsed_capabilities : if capability not in disabled_platform_capability_set : filtered_capabilities . add ( capability ) # Sort the capabilities just in case to keep a consistent order for better determinism sorted_capabilites = list ( filtered_capabilities ) sorted_capabilites . sort ( reverse = True ) # Scrub out all of the '--enable-capability <capability>' from the current bootstrap_tool_param line so we can re-inject the # validated capabilities ctx . parsed_capabilities = sorted_capabilites bootstrap_tool_param = ctx . options . bootstrap_tool_param params = re . sub ( r'(--enablecapability\s+\w*)' , '' , bootstrap_tool_param ) . split ( ) if params and params [ - 1 ] == '--enablecapability' : params . remove ( '--enablecapability' ) # If there exists a '--none' in the param line, make sure that the capabilities are inject right after it insert_index = 0 if '--none' not in params else params . index ( '--none' ) + 1 for enabled_platform_capability in sorted_capabilites : params . insert ( insert_index , enabled_platform_capability ) params . insert ( insert_index , '--enablecapability' ) new_bootstrap_tool_param = ' ' . join ( params ) # Update the settings and the options ctx . options . bootstrap_tool_param = new_bootstrap_tool_param LUMBERYARD_SETTINGS . set_settings_value ( 'bootstrap_tool_param' , new_bootstrap_tool_param ) # If there was a change, then update the user_settings.options file if bootstrap_tool_param != new_bootstrap_tool_param : LUMBERYARD_SETTINGS . update_settings_file ( apply_from_command_line = False , override_value_map = { 'bootstrap_tool_param' : new_bootstrap_tool_param } )