is there up-to-date documentation on how to add a ...
# general
h
is there up-to-date documentation on how to add a subsystem in a plugin anywhere?
h
What do you mean?
h
something like https://www.pantsbuild.org/howto_plugin.html but that talks about subsystems
h
Example to put in a `register.py`:
Copy code
def global_subsystems():
  return python_native_code.PythonNativeCode, subprocess_environment.SubprocessEnvironment
w
that is for v1... if you'd like to add a subsystem for use by v2, you'd use
optionable_rule
👍 2
h
where is it defined that we look for a function by that name to import a subystem from a plugin?
w
from a documentation perspective? it doesn't look like it is. https://www.pantsbuild.org/howto_plugin.html
moving forward, so far all you need for a v2 plugin is a
def rules
definition
(...oh. and whatever we come up with from a target/BUILD file symbol perspective. cc @happy-kitchen-89482)
h
@many-postman-30316 so, create a file called
register.py
with a method called
rules
that returns an iterable containing
optionable_rule(MySubsystem)
?
and that should get that Subsystem hooked up to the global subsystem list?
w
yes