-
Notifications
You must be signed in to change notification settings - Fork 624
Restructure library group logic in buildSrc #5297
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
Conversation
Library groups are now compute at the plugin, rather than being a singleton class using registrars. This fixes the previous bug that caused duplicate entries to be generated for the release generator because the singleton class was kept alive by the gradle daemon. Additionally, it simplifies the verification of missing libraries due to library groups. Now, the build **will fail** if the release.json file does not include all the libraries in the library group.
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Coverage Report 1Affected Products
Test Logs |
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.
Left some comments on stuff that could be cleaned up- but nothing that should really prevent merging.
tbh, I very much dislike this way of fetching library groups, and would rather there be a more straightforward way instead of passing a function with the root project. although, this is something I don't think we could really solve until we get to migrating FirebaseLibraryExtension
to Kotlin. and furthermore, we have more pressing matters- so deff a backlog issue.
All in all though, looking good!!
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/UpdatePinnedDependenciesTask.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/LibraryGroups.kt
Show resolved
Hide resolved
Hey Daymon, curious to hear more about your ideas. When redesigning where the global library groups information should be, I discarted the I could have go with encapsulating "LibraryGroups" as a class, but wasn't fully convinced. |
I agree. My main gripe here is the lack of global memoization (while also keeping things lazy)- something we could accomplish with a deferred property in |
I still don't think that this info belongs to |
Actually, about half of our LG usage happens at the subproject level. For example, both |
I could be wrong, but I see tasks in two groups:
|
Size Report 1Affected ProductsNo changes between base commit (c5a894c) and merge commit (eecf3ec).Test Logs |
Yeah that's a good point. Maybe just an easier way of fetching the data relevant to a given group then? Ideally, I think something like this would be the cleanest and most straightforward: // straightforward, easy identification of point of truths; but a bit verbose
LibraryGroups.projectsForGroup(library.libraryGroup) or library.findSiblings() // a list of libraries in the same group ("sibling" projects) wdyt? |
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.
Left some comments regarding alignment with other task designs and documentation, but otherwise looks good to me!
e: Also, make sure the smoke test failure isn't legit
buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt
Show resolved
Hide resolved
buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt
Show resolved
Hide resolved
Generated by 🚫 Danger |
Addressess pending comments from PR #5297
Addressess pending comments from PR #5297 --------- Co-authored-by: Daymon <[email protected]>
Library groups are now compute at the plugin, rather than being a singleton class using registrars. This fixes the previous bug that caused duplicate entries to be generated for the release generator because the singleton class was kept alive by the gradle daemon.
Additionally, it simplifies the verification of missing libraries due to library groups. Now, the build will fail if the release.json file does not include all the libraries in the library group.