https://pantsbuild.org/ logo
e

early-needle-54791

09/17/2019, 8:53 PM
If I subclass Optionable and implement
register_options
, does that function get magically called?
a

aloof-angle-91616

09/17/2019, 8:53 PM
if you make something into an
optionable_rule()
, yes
e

early-needle-54791

09/17/2019, 8:53 PM
thx
w

witty-crayon-22786

09/17/2019, 9:08 PM
optionable_rule may be a bit of a misnomer... i think that it might only work for Subsystems
(because Optionable is abstract, iirc)?
and optionable_rule is the v2 way: if you'd like options in a v1 context, there is another approach.
@early-needle-54791: what are you trying to add?
a

aloof-angle-91616

09/17/2019, 9:09 PM
optionable_rule()
works for any concrete
Optionable
i'm pretty sure, just from looking at the implementation?
w

witty-crayon-22786

09/17/2019, 9:21 PM
yea. but "subclasses of Optionable" today are 1) Subsystems, 2) Tasks, 3) v2 Goals
a

aloof-angle-91616

09/17/2019, 9:21 PM
If I subclass Optionable
?
w

witty-crayon-22786

09/17/2019, 9:21 PM
subclassing it directly is less of a thing... that's all i was getting at
("trying to" get at)
e

early-needle-54791

09/17/2019, 9:41 PM
I want to make a TargetPlatformConstraint class that is a rule that declares an option
w

witty-crayon-22786

09/17/2019, 9:43 PM
hm
a

aloof-angle-91616

09/17/2019, 9:43 PM
we've usually just done subsystems for rule options
see the v2
ListOptions
for example
w

witty-crayon-22786

09/18/2019, 3:09 PM
that's something else now
Goal.Options
a

aloof-angle-91616

09/18/2019, 3:09 PM
oh, i’m sorry. that’s right
thanks!