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

Improve build performance #298

Merged
merged 16 commits into from
Feb 10, 2017
Merged

Improve build performance #298

merged 16 commits into from
Feb 10, 2017

Conversation

ecgreb
Copy link
Collaborator

@ecgreb ecgreb commented Feb 8, 2017

Overview

Improves build performance on Circle CI. Reduces build time by 1-2 min for dev builds and 4-5 min for full master builds (includes sample apps). Prevents OOM errors on Circle CI container.

Proposed Changes

  • Updates Gradle options to limit memory use and dump heap on OOM error.
  • Runs unit tests against debug build only and reduces console output.
  • Upgrades Gradle to version 3.3 and gradle-android-maven-plugin to version 1.5.
  • Adds --configure-on-demand and -PdisablePreDex options to circle.yml.
  • Runs tests for each module in parallel using 3 Circle CI containers instead of 1.
  • Archives sample app APKs on Circle CI and deploys to AWS on release build only.
  • Publishes documentation to Mapzen website on release build only.
  • Installs core module to local .m2 repo before resolving dependencies.
  • Disables Javadoc tasks for all modules. May need to be re-enabled for production AARs.

Fixes #297

@ecgreb ecgreb changed the title [WIP] Improve build performance Improve build performance Feb 8, 2017
@tallytalwar
Copy link
Member

Starting reviewing this now.

Copy link
Member

@tallytalwar tallytalwar left a comment

Choose a reason for hiding this comment

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

Looks good to go. 👍 Happy master builds now!

circle.yml Outdated
@@ -19,7 +19,7 @@ dependencies:

test:
override:
- ./gradlew clean :core:install :core:verify :mapzen-android-sdk:verify :mapzen-places-api:verify
- ./gradlew clean :core:install :core:verify :mapzen-android-sdk:verify :mapzen-places-api:verify --configure-on-demand
Copy link
Member

Choose a reason for hiding this comment

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

👍 Nicely documented in gradle docs (which sometimes are very convoluted, at least for me): https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:configuration_on_demand

circle.yml Outdated
@@ -19,7 +19,7 @@ dependencies:

test:
override:
- ./gradlew clean :core:install :core:verify :mapzen-android-sdk:verify :mapzen-places-api:verify --configure-on-demand
- ./gradlew clean :core:install :core:verify :mapzen-android-sdk:verify :mapzen-places-api:verify --configure-on-demand -PdisablePreDex
Copy link
Member

Choose a reason for hiding this comment

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

The only information I found for this is its recommended to use -PdisablePreDex when doing a one time build (typical with CI env.). But no finer details behind the reasoning. Can you point me to a reference/explain? Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using -PdisablePreDex was recommended in this Circle CI issue.

#
# Triggers mapzen docs build to publish to https://mapzen.com/documentation/.

if [[ ${PERFORM_RELEASE} ]]
Copy link
Member

Choose a reason for hiding this comment

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

naive question ... when does PERFORM_RELEASE get set?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Haha it does not yet! :) I will be adding a script to perform the release using Circle's API similar to this one we use for Eraser Map as part of #279.

@ecgreb ecgreb merged commit 7ca6f4f into master Feb 10, 2017
@ecgreb ecgreb deleted the 297-build-performance branch February 10, 2017 18:11
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.

2 participants