コード例 #1
0
  def _construct_options(options_bootstrapper, build_configuration):
    """Parse and register options.

    :returns: An Options object representing the full set of runtime options.
    """
    # Now that plugins and backends are loaded, we can gather the known scopes.

    # Gather the optionables that are not scoped to any other.  All known scopes are reachable
    # via these optionables' known_scope_infos() methods.
    top_level_optionables = (
      {GlobalOptionsRegistrar} |
      GlobalSubsystems.get() |
      build_configuration.subsystems() |
      set(Goal.get_optionables())
    )

    known_scope_infos = sorted({
      si for optionable in top_level_optionables for si in optionable.known_scope_infos()
    })

    # Now that we have the known scopes we can get the full options.
    options = options_bootstrapper.get_full_options(known_scope_infos)

    distinct_optionable_classes = sorted({si.optionable_cls for si in known_scope_infos},
                                         key=lambda o: o.options_scope)
    for optionable_cls in distinct_optionable_classes:
      optionable_cls.register_options_on_scope(options)

    return options
コード例 #2
0
ファイル: options_initializer.py プロジェクト: tglstory/pants
    def _construct_options(options_bootstrapper, build_configuration):
        """Parse and register options.

    :returns: An Options object representing the full set of runtime options.
    """
        # Now that plugins and backends are loaded, we can gather the known scopes.

        # Gather the optionables that are not scoped to any other.  All known scopes are reachable
        # via these optionables' known_scope_infos() methods.
        top_level_optionables = ({GlobalOptionsRegistrar}
                                 | GlobalSubsystems.get()
                                 | build_configuration.subsystems()
                                 | set(Goal.get_optionables()))

        known_scope_infos = sorted({
            si
            for optionable in top_level_optionables
            for si in optionable.known_scope_infos()
        })

        # Now that we have the known scopes we can get the full options.
        options = options_bootstrapper.get_full_options(known_scope_infos)

        distinct_optionable_classes = sorted(
            {si.optionable_cls
             for si in known_scope_infos},
            key=lambda o: o.options_scope)
        for optionable_cls in distinct_optionable_classes:
            optionable_cls.register_options_on_scope(options)

        return options
コード例 #3
0
    def _construct_options(options_bootstrapper, build_configuration):
        """Parse and register options.

        :returns: An Options object representing the full set of runtime options.
        """
        optionables = {
            GlobalOptions, *GlobalSubsystems.get(),
            *build_configuration.optionables
        }
        known_scope_infos = [
            si for optionable in optionables
            for si in optionable.known_scope_infos()
        ]
        return options_bootstrapper.get_full_options(known_scope_infos)
コード例 #4
0
ファイル: options_initializer.py プロジェクト: pyranja/pants
    def _construct_options(options_bootstrapper, build_configuration):
        """Parse and register options.

        :returns: An Options object representing the full set of runtime options.
        """
        # Now that plugins and backends are loaded, we can gather the known scopes.

        # Gather the optionables that are not scoped to any other.  All known scopes are reachable
        # via these optionables' known_scope_infos() methods.
        top_level_optionables = ({GlobalOptions}
                                 | GlobalSubsystems.get()
                                 | build_configuration.optionables()
                                 | set(Goal.get_optionables()))

        # Now that we have the known scopes we can get the full options. `get_full_options` will
        # sort and de-duplicate these for us.
        known_scope_infos = [
            si for optionable in top_level_optionables
            for si in optionable.known_scope_infos()
        ]
        return options_bootstrapper.get_full_options(known_scope_infos)
コード例 #5
0
  def _construct_options(options_bootstrapper, build_configuration):
    """Parse and register options.

    :returns: An Options object representing the full set of runtime options.
    """
    # Now that plugins and backends are loaded, we can gather the known scopes.

    # Gather the optionables that are not scoped to any other.  All known scopes are reachable
    # via these optionables' known_scope_infos() methods.
    top_level_optionables = (
      {GlobalOptionsRegistrar} |
      GlobalSubsystems.get() |
      build_configuration.optionables() |
      set(Goal.get_optionables())
    )

    # Now that we have the known scopes we can get the full options. `get_full_options` will
    # sort and de-duplicate these for us.
    known_scope_infos = [si
                         for optionable in top_level_optionables
                         for si in optionable.known_scope_infos()]
    return options_bootstrapper.get_full_options(known_scope_infos)