Skip to content

Adds a check to pub tool to see if a root is a Flutter project. #114

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

Closed
wants to merge 2 commits into from

Conversation

gspencergoog
Copy link

@gspencergoog gspencergoog commented May 6, 2025

Description

This adds a check in the pub tool that checks to see if a project is a Flutter project before it calls the pub tool. If it is, then it automatically runs 'flutter pub' instead of 'dart pub'.

This required that tests write to the filesystem, so I added a FileSystemSupport mixin so that the test harness could provide a MemoryFileSystem instead of using a local (real) filesystem.

FileSystemSupport can't override out-of-process tests, of course, but it's useful for in-process tests.

Related Issues

Tests

  • Added a test to make sure it conditionally runs flutter.

Copy link

github-actions bot commented May 6, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

@jakemac53
Copy link
Contributor

I also did add this in #113 🤣 - I guess we need to get better at actually assigning issues to ourselves.

We might ultimately want some merged version of these two approaches? They aren't all that different.

@gspencergoog
Copy link
Author

I also did add this in #113 🤣 - I guess we need to get better at actually assigning issues to ourselves.

LOL! Yeah, I guess so...

We might ultimately want some merged version of these two approaches? They aren't all that different.

Yes, let's merge them! I like your use of the pubspec parser instead of my generic YAML, and I think we still should have my FileSystemSupport mixin: it opens the door for more comprehensive in-process tests.

I went with a builder that built the entire command line instead of just the initial command, in case there were ever different options needed for a command based on the contents of the root.

Do you want to merge, or shall I (I'm fine with either one).

@jakemac53
Copy link
Contributor

I can merge stuff from yours in (primarily the file system stuff), since mine also adds a new tool it is probably easier that way.

@gspencergoog
Copy link
Author

Works for me.

@jakemac53
Copy link
Contributor

Merged it in here c07112b

@gspencergoog
Copy link
Author

Closing this PR, since it is superseded by #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants