Fix: Speed up build configuration time #1451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When
useGlobalApolloCodegen
is used, installation is verified in every Gradle run causing slower builds. More info #1203This PR speeds up build configuration time by lazily verifying apollo-codegen installation.
Considerations
Move Apollo global verification to the beginning of the task to speed up configuration process.
This I/O operation (version check) currently runs in configuration time and take up to 5sec. This runs in every Gradle execution (even when unrelated to Apollo)
This commit fixes #1203 and moves verification to a later stage.
This means that we cannot easily fall-back to local installation that easily. That's why an exception is thrown with an appropriate message. User should disable using this feature if they don't have global installation.
Screenshot