Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass arguments to dependent tasks? #391

Open
jakemac53 opened this issue Jun 30, 2022 · 0 comments
Open

How to pass arguments to dependent tasks? #391

jakemac53 opened this issue Jun 30, 2022 · 0 comments

Comments

@jakemac53
Copy link

See this serve task as an example, https://github.com/dart-lang/dart-pad/blob/b9a426f73c1b4dff267b7328d3c6fac964b560bd/tool/grind.dart#L28.

This depends on the build task, which accepts a --debug flag.

I want to run the serve task, with --debug set for the nested build task, but I can't figure out how to do it?

I tried grind serve build --debug, grind serve --debug, grind serve --debug build --debug, but none of those options work, they all ultimately end up with an error like this:

Unhandled exception:
GrinderException: Cannot run a task multiple times with different arguments
#0      Grinder._postOrder (package:grinder/src/grinder.dart:88:9)
#1      Grinder._postOrder (package:grinder/src/grinder.dart:78:7)
#2      Grinder.start (package:grinder/src/grinder.dart:168:7)
#3      runTasks (package:grinder/src/cli.dart:69:38)
#4      grind (package:grinder/grinder.dart:45:12)
#5      main (<redacted>/dart-pad/tool/grind.dart:21:28)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

I did some debugging and it looks like the task is trying to run both with empty arguments and with ["--debug"]. So I think the dependency set up by serve is implicitly trying to run it with no arguments, or something like that?

@jakemac53 jakemac53 changed the title How to forward arguments to dependent tasks? How to pass arguments to dependent tasks? Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant