Example #1
0
    def _register_options(self, subsystems, options):
        """Registers global options."""
        # Standalone global options.
        GlobalOptionsRegistrar.register_options_on_scope(options)

        # Options for subsystems.
        for subsystem in subsystems:
            subsystem.register_options_on_scope(options)

        # TODO(benjy): Should Goals or the entire goal-running mechanism be a Subsystem?
        for goal in Goal.all():
            # Register task options.
            goal.register_options(options)
Example #2
0
    def _register_options(self, subsystems, options):
        """Registers global options."""
        # Standalone global options.
        GlobalOptionsRegistrar.register_options_on_scope(options)

        # Options for subsystems.
        for subsystem in subsystems:
            subsystem.register_options_on_scope(options)

        # TODO(benjy): Should Goals or the entire goal-running mechanism be a Subsystem?
        for goal in Goal.all():
            # Register task options.
            goal.register_options(options)
Example #3
0
  def register_options(self, subsystems):
    # Standalone global options.
    GlobalOptionsRegistrar.register_options_on_scope(self.options)

    # Options for subsystems.
    for subsystem in subsystems:
      subsystem.register_options_on_scope(self.options)

    # TODO(benjy): Should Goals be subsystems? Or should the entire goal-running mechanism
    # be a subsystem?
    for goal in Goal.all():
      # Register task options.
      goal.register_options(self.options)
Example #4
0
  def _options(self):
    # NB: The PluginResolver runs very early in the pants startup sequence before the standard
    # Subsystem facility is wired up.  As a result PluginResolver is not itself a Subsystem with
    # PythonRepos as a dependency.  Instead it does the minimum possible work to hand-roll
    # bootstrapping of the Subsystem it needs.
    subsystems = Subsystem.closure([PythonRepos])
    known_scope_infos = [subsystem.get_scope_info() for subsystem in subsystems]
    options = self._options_bootstrapper.get_full_options(known_scope_infos)

    # Ignore command line flags since we'd blow up on any we don't understand (most of them).
    # If someone wants to bootstrap plugins in a one-off custom way they'll need to use env vars
    # or a --pants-config-files pointing to a custom pants.ini snippet.
    defaulted_only_options = options.drop_flag_values()

    GlobalOptionsRegistrar.register_options_on_scope(defaulted_only_options)
    for subsystem in subsystems:
      subsystem.register_options_on_scope(defaulted_only_options)
    return defaulted_only_options
Example #5
0
  def _options(self):
    # NB: The PluginResolver runs very early in the pants startup sequence before the standard
    # Subsystem facility is wired up.  As a result PluginResolver is not itself a Subsystem with
    # (PythonRepos, PythonSetup) returned as `dependencies()`.  Instead it does the minimum possible
    # work to hand-roll bootstrapping of the Subsystems it needs.
    subsystems = Subsystem.closure([PythonRepos, PythonSetup])
    known_scope_infos = [subsystem.get_scope_info() for subsystem in subsystems]
    options = self._options_bootstrapper.get_full_options(known_scope_infos)

    # Ignore command line flags since we'd blow up on any we don't understand (most of them).
    # If someone wants to bootstrap plugins in a one-off custom way they'll need to use env vars
    # or a --config-override pointing to a custom pants.ini snippet.
    defaulted_only_options = options.drop_flag_values()

    GlobalOptionsRegistrar.register_options_on_scope(defaulted_only_options)
    for subsystem in subsystems:
      subsystem.register_options_on_scope(defaulted_only_options)
    return defaulted_only_options
Example #6
0
    def _options(self):
        # NB: The PluginResolver runs very early in the pants startup sequence before the standard
        # Subsystem facility is wired up.  As a result PluginResolver is not itself a Subsystem with
        # PythonRepos as a dependency.  Instead it does the minimum possible work to hand-roll
        # bootstrapping of the Subsystems it needs.
        known_scope_infos = PythonRepos.known_scope_infos()
        options = self._options_bootstrapper.get_full_options(
            known_scope_infos)

        # Ignore command line flags since we'd blow up on any we don't understand (most of them).
        # If someone wants to bootstrap plugins in a one-off custom way they'll need to use env vars
        # or a --pants-config-files pointing to a custom pants.ini snippet.
        defaulted_only_options = options.drop_flag_values()

        GlobalOptionsRegistrar.register_options_on_scope(
            defaulted_only_options)
        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(defaulted_only_options)
        return defaulted_only_options