Skip to content

Commit

Permalink
fix(build): Clean .gradle cache before GCB invocation. (#1513)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtk54 committed Mar 27, 2017
1 parent e89f2a8 commit 36cf312
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dev/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import multiprocessing
import multiprocessing.pool
import re
import shutil
import subprocess
import sys
import tempfile
Expand Down Expand Up @@ -228,6 +229,14 @@ def start_container_build(self, name):
"""
gradle_root = self.determine_gradle_root(name)
if self.__options.container_builder == 'gcb':
# Local .gradle dir stomps on GCB's .gradle directory when the gradle
# wrapper is installed, so we need to delete the local one.
# The .gradle dir is transient and will be recreated on the next gradle
# build, so this is OK.
gradle_cache = '{name}/.gradle'.format(name=name)
if os.path.isdir(gradle_cache):
# Tell rmtree to delete the directory even if it's non-empty.
shutil.rmtree(gradle_cache)
return BackgroundProcess.spawn(
'Build/publishing container image for {name} with'
' Google Container Builder...'.format(name=name),
Expand Down

0 comments on commit 36cf312

Please sign in to comment.