Skip to content

Commit

Permalink
Avoid caching gradle scripts that should not affect completion
Browse files Browse the repository at this point in the history
This change excludes more paths such as src/smokeTest and src/samples
from the script cache.

This allows projects like gradle/gradle that have lots of sample .gradle
files to avoid 'md5: too many arguments' error.

Fixes: #71
  • Loading branch information
eriwen committed Feb 19, 2019
1 parent 01398b2 commit 53ddad6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ __gradle-set-files-checksum() {
__gradle-generate-script-cache() {
# Invalidate cache after 3 weeks by default
local cache_ttl_mins=${$(echo $GRADLE_CACHE_TTL_MINUTES):-30240}
local script_exclude_pattern=${$(echo $GRADLE_COMPLETION_EXCLUDE_PATTERN):-"/(build|integTest|out)/"}
local script_exclude_pattern=${$(echo $GRADLE_COMPLETION_EXCLUDE_PATTERN):-"/(.git|build|integTest|samples|templates|smokeTest|testFixtures|out)/"}
if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then
zle -R "Generating Gradle build script cache"
# Cache all Gradle scripts
Expand Down
2 changes: 1 addition & 1 deletion gradle-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ __gradle-set-files-checksum() {
__gradle-generate-script-cache() {
# Invalidate cache after 3 weeks by default
local cache_ttl_mins=${GRADLE_CACHE_TTL_MINUTES:-30240}
local script_exclude_pattern=${GRADLE_COMPLETION_EXCLUDE_PATTERN:-"/(build|integTest|out)/"}
local script_exclude_pattern=${GRADLE_COMPLETION_EXCLUDE_PATTERN:-"/(.git|build|integTest|samples|templates|smokeTest|testFixtures|out)/"}

if [[ ! $(find "$cache_dir/$cache_name" -mmin "-${cache_ttl_mins}" 2>/dev/null) ]]; then
# Cache all Gradle scripts
Expand Down

0 comments on commit 53ddad6

Please sign in to comment.