diff --git a/.gitignore b/.gitignore index 17e3b6f81..5254bc9ca 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,7 @@ nomulus.iws !/gradle/wrapper/**/*.jar .gradle/ **/build +cloudbuild-caches/ node_modules/** /repos/ diff --git a/config/presubmits.py b/config/presubmits.py index 4559ea792..f5f6eef7d 100644 --- a/config/presubmits.py +++ b/config/presubmits.py @@ -22,7 +22,7 @@ import sys import re # We should never analyze any generated files -UNIVERSALLY_SKIPPED_PATTERNS = {"/build/", "/out/"} +UNIVERSALLY_SKIPPED_PATTERNS = {"/build/", "cloudbuild-caches", "/out/"} # We can't rely on CI to have the Enum package installed so we do this instead. FORBIDDEN = 1 REQUIRED = 2 diff --git a/java_common.gradle b/java_common.gradle index d77f39b8a..4d6fdd749 100644 --- a/java_common.gradle +++ b/java_common.gradle @@ -115,6 +115,7 @@ spotless { format 'misc', { clearSteps() target '**/*.gradle' + targetExclude '**/cloudbuild-caches/**' trimTrailingWhitespace() indentWithSpaces(2) endWithNewline() diff --git a/release/build_nomulus_for_env.sh b/release/build_nomulus_for_env.sh index 87e778dc6..fc82ef811 100755 --- a/release/build_nomulus_for_env.sh +++ b/release/build_nomulus_for_env.sh @@ -29,6 +29,13 @@ environment="$1" dest="$2" gcs_prefix="storage.googleapis.com/domain-registry-maven-repository" +# Let Gradle put its caches (dependency cache and build cache) in the source +# tree. This allows sharing of the caches between steps in a Cloud Build +# task. (See ./cloudbuild-nomulus.yaml, which calls this script in several +# steps). If left at their default location, the caches will be lost after +# each step. +export GRADLE_USER_HOME="./cloudbuild-caches" + if [ "${environment}" == tool ] then mkdir -p "${dest}"