-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add build filters #18
Conversation
README.md
Outdated
|
||
If you want to generate the `DEPENDENCIES.md` only for a specific folders, you can use `--build-filter` option. For example, to generate the diagram only for the root `lib/` folder, you run following `dart run layerlens --build-filter "lib"`. | ||
|
||
You can specify multiple build filters and you should use [glob](https://pub.dev/packages/glob) syntax. The mechanism is inspired by `--build-filter` in Dart's [`build_runner`](https://github.com/dart-lang/build/blob/master/docs/partial_builds.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add example of multiple filters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
Thank you for putting this together! Can you test cover the new code? |
@polina-c I've added the tests, feel free to re-review it:) |
}); | ||
|
||
test('build root and one subfolder', () async { | ||
final deps = await collectDeps(rootDir: rootDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Can you add test for the case:
lib
lib/subfolder1
lib/subfolder2/**
lib/subfolder2/a
assuming folder structure:
lib
subfolder1
a
b
subfolder2
a
b
Check it generate all subtree for subfolder2, and just subfolder1 for subfolder1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented this test and added a bunch of other tests to really check if it is behaving right and is covered.
README.md
Outdated
|
||
If you want to generate the `DEPENDENCIES.md` only for a specific folders, you can use `--build-filter` option and you should use [glob](https://pub.dev/packages/glob) syntax. For example, to generate the diagram only for the root `lib/` folder, you run following `dart run layerlens --build-filter "lib"`. | ||
|
||
You can specify multiple build filters . The mechanism is inspired by `--build-filter` in Dart's [`build_runner`](https://github.com/dart-lang/build/blob/master/docs/partial_builds.md). For example, to run the layerlens for root `lib/` and it's subfolder `lib/subfolder1` run `layerlens --build-filter "lib" --build-filter "lib/subfolder1"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Can you also add example how to generate diagrams for entire subtrre of one of subfolders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I've updated the readme and added this case to the tests as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, lgtm. Just one minor comment.
Merged. Thank you!!! |
Hi, I've added build filters similar to the ones in
build_runner
.Would you please @polina-c review it?