https://pantsbuild.org/ logo
#general
Title
# general
h

hundreds-breakfast-49010

12/04/2019, 10:30 PM
is there up-to-date documentation on how to add a subsystem in a plugin anywhere?
h

hundreds-father-404

12/04/2019, 10:34 PM
What do you mean?
h

hundreds-breakfast-49010

12/04/2019, 10:35 PM
something like https://www.pantsbuild.org/howto_plugin.html but that talks about subsystems
h

hundreds-father-404

12/04/2019, 10:39 PM
Example to put in a `register.py`:
Copy code
def global_subsystems():
  return python_native_code.PythonNativeCode, subprocess_environment.SubprocessEnvironment
w

witty-crayon-22786

12/04/2019, 10:42 PM
that is for v1... if you'd like to add a subsystem for use by v2, you'd use
optionable_rule
👍 2
h

hundreds-breakfast-49010

12/04/2019, 10:44 PM
where is it defined that we look for a function by that name to import a subystem from a plugin?
w

witty-crayon-22786

12/04/2019, 10:45 PM
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

hundreds-breakfast-49010

12/04/2019, 10:52 PM
@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

witty-crayon-22786

12/04/2019, 10:53 PM
yes
3 Views