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

Support generateProjectDependencyGraph in SubProject #134

Conversation

tedliang
Copy link
Contributor

In monorepo, generateProjectDependencyGraph from individual sub project would be more practical.
eg. ./gradlew app:generateProjectDependencyGraph

@tedliang
Copy link
Contributor Author

#125 will be achieved by this merge request as well.

@vanniktech
Copy link
Owner

@tedliang can you show an before and after image of your repository?

@tedliang tedliang force-pushed the supportProjectDependencyGraphInSubProject branch from e54e844 to b3c4157 Compare September 26, 2021 11:47
@tedliang
Copy link
Contributor Author

Screen Shot 2021-09-26 at 9 53 42 pm

@vanniktech
Copy link
Owner

@tedliang thanks! Do you mind adding a test for this new behavior? Then we can merge

@@ -213,7 +216,7 @@ class DependencyGraphGeneratorPluginTest {
.withPluginClasspath()
.withGradleVersion("5.0")
.withProjectDir(testProjectDir.root)
.withArguments("generateDependencyGraph", "generateProjectDependencyGraph")
.withArguments("generateDependencyGraph", "generateProjectDependencyGraph", "app:generateProjectDependencyGraph")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger the task to generate project dependency graph on sub project app.

// We don't want to assert the content of the image, just that it exists.
assertThat(File(testProjectDir.root, "app/build/reports/project-dependency-graph/project-dependency-graph.svg")).exists()

assertThat(File(testProjectDir.root, "app/build/reports/project-dependency-graph/project-dependency-graph.dot")).hasContent(projectDependencyGraph("app"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make sure the graph generated from sub project app is correct. If you rollback the implementation code, this test will be failed, as the original code didn't include the nested dependencies.

@vanniktech vanniktech merged commit 83ec82c into vanniktech:master Sep 27, 2021
@vanniktech
Copy link
Owner

@tedliang thank you very much. If you want to continue working on this project - I have very little time to do PRs - please do!

@tedliang tedliang deleted the supportProjectDependencyGraphInSubProject branch September 27, 2021 12:48
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

Successfully merging this pull request may close these issues.

2 participants