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: Speed up build configuration time #1451

Merged

Conversation

tasomaniac
Copy link
Contributor

@tasomaniac tasomaniac commented Jul 22, 2019

Problem

When useGlobalApolloCodegen is used, installation is verified in every Gradle run causing slower builds. More info #1203
This 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

Screen Shot 2019-07-24 at 00 41 40

…egen installation

Move Apollo global verification to the beginning of the task to speed up configuration process.

Before, this I/O operation (version check) would run in configuration time and take up to 5sec. This runs in every Gradle execution (even when unrelated to Apollo)

This commit fixes apollographql#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.
Copy link
Contributor

@sav007 sav007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small nit

@tasomaniac tasomaniac changed the title Fix: Speed up build configuration time WIP: Fix: Speed up build configuration time Jul 23, 2019
@tasomaniac tasomaniac changed the title WIP: Fix: Speed up build configuration time Fix: Speed up build configuration time Jul 23, 2019
@tasomaniac
Copy link
Contributor Author

Ready to go! Also updated the PR desc to include the output.

@sav007 sav007 self-requested a review July 23, 2019 23:01
@sav007 sav007 merged commit 347f250 into apollographql:master Jul 24, 2019
@tasomaniac tasomaniac deleted the taso/fix/gradle-early-configuration branch July 26, 2019 20:47
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.

Detection of 'GlobalApolloCodegen' happens too early in Gradle configuration
3 participants