Avoid eagerly evaluating unstrippedNativeLibsOverride during the configuration phase#8205
Avoid eagerly evaluating unstrippedNativeLibsOverride during the configuration phase#8205OOS93 wants to merge 3 commits into
Conversation
…d behaviors at Gradle Configuration Phase. Current approach check (via a lazy provider) at Execution Phase which source of truth to use.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
📝 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. |
Context
When users override the mergeNativeLibs path (from the CrashlyticsExtension configuration block) while working with providers, GenerateSymbolFileTask evaluated this override and caused Configuration issues.
The reason behind the Configuration errors was due to evaluating data that was expected to be available at Execution Phase.
Proposed Solution
This update aims to pass the override (if present) via a lazy provider which will be handled at Execution Phase. If no override is present, the tasks still passes a default provider for the output of Gradle mergeNativeLibs task.
It also introduces a log warning which informs the users about the unnecessary override when aiming for the mergeNativeLibs path.
Previous proposed alternatives
This update tried to verify the overridden paths at execution phase and throwing an Exception if the set up did not meet the right dependencies.
Unfortunately this approach introduced possible false positives and also could not work integrally with Gradle directives like "SkipWhenEmpty".
https://github.com/firebase/firebase-android-sdk/tree/OOS93/gradle_merged_libs_taskThis update tried to validate the overridden path at realization process, right after entering the Execution Phase. While this seems like the ultimate solution, while testing the solution via Gradle ToolKit the "happy path" was not viable.
A couple of approaches were tried simulating the set up and output of the mergeNativeLibs task. This could possibly be an issue with the ToolKit itself, but for the sake of simplicity and to prevent throwing exceptions when the right user configurations exists the solution now focuses on just warning users about the unnecessary override.