You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flutter dart foo.dart to run dart foo.dart with FLUTTER_ROOT set #13607
Required to run things like source_gen generators.
#13360 deals with pub run. This is just getting access to the dart command to run things not in the bin directory.
Here's the draft text I've included in json_serializable – which is pretty gnarly.
NOTE: If you're using Flutter, running a Dart script is a bit tricky. You can
find the Dart entry point at $FLUTTER_ROOT/bin/cache/dart-sdk/bin/dart.
You can determine FLUTTER_ROOT by looking at the first few lines of flutter doctor.
> flutter doctor[✓] Flutter (on Mac OS X 10.12.6 16G1114, locale en-US, channel master) • Flutter at YOUR_FLUTTER_ROOT_HERE • Framework revision 235b64ed2f (13 hours ago), 2017-12-14 20:38:39 -0800...
Strawman: flutter cmd <path_to_cli_script> which simply runs the script via the same Dart version that is used in the engine (so the API in docs.flutter.io applies to scripts run via the Flutter cmd line. I don't want "two darts" for Flutter developers, there is one Dart for Flutter developers: the Dart that is documented on docs.flutter.io)
In the meantime, could source_gen ship a generic runner accessible from pub run ?
Would a more idea solution be some way to register (maybe in pubspec.yaml, that flutter should execute some dart "script" during build? Then you wouldn't need to remember to manually run the generators?
Reacted by phrohdoh, Fabio de Matos, Yasuhiro SHIMIZU and SAGAR SURI
On Mon, Dec 18, 2017 at 8:10 AM, Michael Thomsen ***@***.***> wrote:
Would a more idea solution be some way to register (maybe in pubspec.yaml,
that flutter should execute some dart "script" during build? Then you
wouldn't need to remember to manually run the generators?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13607 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCilMzBf-metyvWioaobf2F-clKeQoks5tBo6FgaJpZM4RDynL>
.
changed the title [-]Make it easier to run the `dart` executable[/-][+]`flutter dart foo.dart` to run `dart foo.dart` with FLUTTER_ROOT set[/+]on Jun 12, 2018
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
kevmoo commentedon Dec 15, 2017
CC @sethladd @mit-mit
sethladd commentedon Dec 15, 2017
Strawman:
flutter cmd <path_to_cli_script>which simply runs the script via the same Dart version that is used in the engine (so the API in docs.flutter.io applies to scripts run via the Flutter cmd line. I don't want "two darts" for Flutter developers, there is one Dart for Flutter developers: the Dart that is documented on docs.flutter.io)In the meantime, could source_gen ship a generic runner accessible from
pub run?kevmoo commentedon Dec 15, 2017
SGTM...
Sadly, no. We're working on a solution w/ pkg/build where there will be a common entry point. Hoping to have that nailed down in Q1.
mit-mit commentedon Dec 18, 2017
Would a more idea solution be some way to register (maybe in
pubspec.yaml, that flutter should execute some dart "script" during build? Then you wouldn't need to remember to manually run the generators?kevmoo commentedon Dec 18, 2017
[-]Make it easier to run the `dart` executable[/-][+]`flutter dart foo.dart` to run `dart foo.dart` with FLUTTER_ROOT set[/+]zoechi commentedon Jan 22, 2019
flutter packages pub run tool/build.dartdoes this currently.jonahwilliams commentedon Apr 22, 2019
Closing as pub can run dart scripts, and because we'll likely use a different solution for build_runner integration.
mit-mit commentedon Apr 22, 2019
Also, note that I recently added passthrough for all
pubcommands, so the current shortest way of doing this is:github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.