loud-lizard-27679
08/24/2023, 4:06 PMfrom pants.engine.goal import Goal, GoalSubsystem, Outputting
from pants.engine.rules import goal_rule, collect_rules
from pants.engine.console import Console
class HelloWorldSubsystem(Outputting, GoalSubsystem):
name = "hello-world"
help = "An example goal."
class HelloWorld(Goal):
subsystem_cls = HelloWorldSubsystem
@goal_rule
async def hello_world(
console: Console, hello_world_subsystem: HelloWorldSubsystem
) -> HelloWorld:
with hello_world_subsystem.output(console) as write_stdout:
write_stdout("Hello world!")
return HelloWorld(exit_code=0)
def rules():
return collect_rules()curved-manchester-66006
08/24/2023, 4:12 PMloud-lizard-27679
08/24/2023, 4:16 PMloud-lizard-27679
08/24/2023, 4:18 PMmain but not in the 2.17.x documentation.loud-lizard-27679
08/24/2023, 4:20 PMcurved-manchester-66006
08/24/2023, 5:56 PMloud-lizard-27679
08/24/2023, 5:56 PM