blackducksoftware / hub-gradle-plugin

Hub Gradle: Create BOMs, check policies - all from your gradle build.
Apache License 2.0
0 stars 5 forks source link

Handle case where the root project's child projects have subprojects #7

Closed JBirdVegas closed 8 years ago

JBirdVegas commented 8 years ago

Previously the plugin would only evaluate the rootProject's children projects. This works fine if the root's children are the actual projects in the case where the root's children are only a root for rootProjects's children's children, rootProject's grand children, this is not enough.

Now for each child project of root we check for subproject of the children.

If grand children project's are found then add their dependencies to the report

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.5%) to 41.667% when pulling da15c889a29ad2ef8c709ca44ae05780fc845de4 on JBirdVegas:feature/supportGrandChildrenProjects into f7cf7fb98488962cc54f88f9c7b754f1ede856ff on blackducksoftware:master.

stavvy-akamen commented 8 years ago

@psantos1113 lets get this sucker merged into 2.0.8 snap

psantos1113 commented 8 years ago

This solution is along the right lines we need to address the grandchildren but this will only handle grandchildren. Even though this is intended for gradle, we have some examples internally of maven projects that contain great grandchildren of the parent. It is unlikely but possible that a project could potentially be a great, great, grandchild and so on. Therefore to walk the whole project tree we need to do so recursively. The getProjectDependencies most likely needs to call itself recursively in order to walk the tree. So the if statement that was added probably needs to be put into getProjectDependencies so that it calls itself recursively to walk the tree.

JBirdVegas commented 8 years ago

Good point I'll modify the PR. Have to be pretty careful if the build is too big using a recursive method call seems to cause an OOM.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 42.151% when pulling 882976afd66d03b0c44882329934d2aa1b1969d3 on JBirdVegas:feature/supportGrandChildrenProjects into f7cf7fb98488962cc54f88f9c7b754f1ede856ff on blackducksoftware:master.

JBirdVegas commented 8 years ago

@psantos1113, latest PR adds support for infinity projects in a build's reactor. This PR also completely avoids the complexity involved in nested loops and tail-end recursion while searching for all subprojects of subprojects.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+2.2%) to 44.379% when pulling d608bcec4ec696730d846805c78bb2bc4954de98 on JBirdVegas:feature/supportGrandChildrenProjects into f7cf7fb98488962cc54f88f9c7b754f1ede856ff on blackducksoftware:master.

psantos1113 commented 8 years ago

@JBirdVegas the change looks good. I will merge the code change. Thank you for contributing.