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

fix: fall back to project root repositories.gradle #1300

Merged
merged 1 commit into from Aug 2, 2021

Conversation

erisu
Copy link
Member

@erisu erisu commented Jul 29, 2021

Motivation and Context

Not all subprojects will have the repositories.gradle so therefore trying to apply repositories.gradle will fail.

Description

This PR updates the logic to check if the repositories.gradle exists and if it does not, fallback and use the repositories.gradle that is in the project root directory.

Testing

  • npm t
  • cordova build android with a plugin that has a subproject.

Checklist

  • I've run the tests to see all new and existing tests pass

@erisu erisu added the bug label Jul 29, 2021
@erisu erisu requested review from dpogue and breautek July 29, 2021 07:19
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2021

Codecov Report

Merging #1300 (c1132b5) into master (1636d70) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1300   +/-   ##
=======================================
  Coverage   73.25%   73.25%           
=======================================
  Files          21       21           
  Lines        1645     1645           
=======================================
  Hits         1205     1205           
  Misses        440      440           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1636d70...c1132b5. Read the comment docs.

@erisu
Copy link
Member Author

erisu commented Jul 29, 2021

@goffioul I saw your #1179 (comment) about an issue that appeared in that PR. The issue was where the repositories.gradle file is missing for subproject.

I went ahead and created this PR that should resolve the issue. I followed based on your comments. If the file is missing, it will fall back to the project's root repositories.gradle.

Sorry for the slow response. Since the comment was in a merged PR, I missed it.

If you have a project where you could test with these changes, that would be great.

This PR's branch is based on the current master branch, which means it contains Cordova-Android 10.x. If your project does not support Cordova-Android 10 yet, you might have to cherry-pick the commit. I am not positive if this fix will be back ported to 9.1.x, but there might be a chance.

@erisu erisu added this to the 10.1.0 milestone Jul 30, 2021
@erisu erisu added this to Review in progress in Release Plan - 10.1.0 Jul 30, 2021
@erisu
Copy link
Member Author

erisu commented Jul 31, 2021

I will merge this in on Monday with or without a review.

The default project build successfully.

I tested with an only plugin that I could find that added a subproject. Without the PR, It showed the repository error, but with this PR, the repository error was fixed/gone. I couldnt fully test the build because the plugin itself was 4+ years old, unmatained, and used libraries that doesnt work anymore with the current Android SDK & Gradle Build.

@erisu erisu merged commit 565ac9c into apache:master Aug 2, 2021
Release Plan - 10.1.0 automation moved this from Review in progress to Done Aug 2, 2021
@erisu erisu deleted the fix/repo-gradle branch August 2, 2021 05:19
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants