From a11c3db45e213cc65e13ee8b0e546a8ab4a2cf1d Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Tue, 26 May 2020 14:09:27 -0700 Subject: [PATCH] [components] Closes https://github.com/mozilla-mobile/android-components/issues/7117: Enable local Gradle Build Cache --- mobile/android/android-components/.gitignore | 1 + mobile/android/android-components/buildSrc/settings.gradle | 10 ++++++++++ mobile/android/android-components/docs/changelog.md | 3 +++ mobile/android/android-components/gradle.properties | 3 +++ mobile/android/android-components/settings.gradle | 7 +++++++ 5 files changed, 24 insertions(+) create mode 100644 mobile/android/android-components/buildSrc/settings.gradle diff --git a/mobile/android/android-components/.gitignore b/mobile/android/android-components/.gitignore index fd5ab7fb5e3c..ee954fd65666 100644 --- a/mobile/android/android-components/.gitignore +++ b/mobile/android/android-components/.gitignore @@ -17,6 +17,7 @@ out/ .gradle/ build/ !taskcluster/ci/build/ +.build-cache/ # Local configuration file (sdk path, etc) local.properties diff --git a/mobile/android/android-components/buildSrc/settings.gradle b/mobile/android/android-components/buildSrc/settings.gradle new file mode 100644 index 000000000000..c31ad3840d51 --- /dev/null +++ b/mobile/android/android-components/buildSrc/settings.gradle @@ -0,0 +1,10 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +buildCache { + local { + directory = new File(rootDir, '../.build-cache') + removeUnusedEntriesAfterDays = 30 + } +} \ No newline at end of file diff --git a/mobile/android/android-components/docs/changelog.md b/mobile/android/android-components/docs/changelog.md index fd4d31ce2645..c14510efed45 100644 --- a/mobile/android/android-components/docs/changelog.md +++ b/mobile/android/android-components/docs/changelog.md @@ -25,6 +25,9 @@ permalink: /changelog/ * Added `getTopFrecentSites` to `PlacesHistoryStorage`, which returns a list of the top frecent site infos sorted by most to least frecent. +* **local development** + * Enable local Gradle Build Cache to speed-up local builds. Build cache is located in `.build-cache/`, clear it if you run into strange problems and please file an issue. + # 44.0.0 * [Commits](https://github.com/mozilla-mobile/android-components/compare/v43.0.0...v44.0.0) diff --git a/mobile/android/android-components/gradle.properties b/mobile/android/android-components/gradle.properties index 67a35bfa5d1b..dd2a6c2c4cf4 100644 --- a/mobile/android/android-components/gradle.properties +++ b/mobile/android/android-components/gradle.properties @@ -17,6 +17,9 @@ org.gradle.jvmargs=-Xmx4096m # XXX Deactivated because of broken releases? org.gradle.parallel=false +# Build cache - further configured in settings.gradle +org.gradle.caching=true + libRepositoryName=Mozilla-Mobile libUrl=https://github.com/mozilla-mobile/android-components libVcsUrl=https://github.com/mozilla-mobile/android-components.git diff --git a/mobile/android/android-components/settings.gradle b/mobile/android/android-components/settings.gradle index 05da65f2f49e..4623828e948b 100644 --- a/mobile/android/android-components/settings.gradle +++ b/mobile/android/android-components/settings.gradle @@ -14,6 +14,13 @@ buildscript { } } +buildCache { + local { + directory = new File(rootDir, '.build-cache') + removeUnusedEntriesAfterDays = 30 + } +} + def setupProject(name, path, description) { settings.include(":$name") -- 2.11.4.GIT