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

Changes to address issues with Gradle multi-project builds #23

Merged
merged 2 commits into from
Mar 5, 2019

Conversation

b-behan
Copy link
Contributor

@b-behan b-behan commented Mar 2, 2019

Hi,

Thanks for providing this very useful plugin. :) This PR contains changes to address issues that were encountered when using the plugin on Gradle multi-project builds. There are two issues that were encountered:

  1. The plugin may not make the correct version updates if sub-projects use different Component Selection rules with the Gradle Versions plugin. For example, one sub-project might use a component selection rule to limit updates to a certain dependency, but another project may not impose any rules and uses the latest version of the dependency. In that case the dependency version is unexpectedly updated on the sub-project with the component selection rules because the useLatestVersions task uses the merged dependency updates report created on the root project.
  2. If useLatestVersions task is run on a single sub-project (i.e. gradlew :subproject-a:useLatestVersions), then the task will fail because Gradle versions plugin won't create the merged report on the root project.

The following changes were made in this PR resolve these issues:

  • Updated the tasks to use the dependency update reports generated for the specific project rather than the merged report generated at the root project
  • When updating dependency versions, avoid updating build configuration that exists in sub-projects

Unfortunately no unit tests have been provided since it wasn't clear how to make the test cases use multi-project configuration.

Please let me know if there are better ways to address these issues, or if any changes or additional information need to be provided.

Thanks,
Brendan

* Updated the tasks to use the dependency update reports generated for
the specific project rather than the merged report generated at the
root project
* When updating dependency versions, avoid updating build configuration
that exists in sub-projects
@patrikerdes
Copy link
Owner

patrikerdes commented Mar 3, 2019

That's great, thanks a lot.

The unit tests are failing on your branch, and were failing on the master branch as well. I have fixed that on the master branch now. Could you rebase on the master branch and push that, so that the unit tests can run on TravisCI on your branch again as well?

@b-behan
Copy link
Contributor Author

b-behan commented Mar 3, 2019

Thanks Patrik. I've updated the branch with your fixes.

@patrikerdes patrikerdes merged commit 2c4602d into patrikerdes:master Mar 5, 2019
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