From: Daniel Martí Date: Wed, 23 Sep 2015 20:02:22 +0000 (-0700) Subject: build: make sure .gradle/ is removed at clean X-Git-Tag: 0.5.0~78 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=80a8a39f6f9ede01cd14c278d67f87b1ccb7b1f8;p=fdroidserver.git build: make sure .gradle/ is removed at clean --- diff --git a/fdroidserver/build.py b/fdroidserver/build.py index b83885e1..82508067 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -543,6 +543,12 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d (app['id'], thisbuild['version']), p.output) for root, dirs, files in os.walk(build_dir): + # Even when running clean, gradle stores task/artifact caches in + # .gradle/ as binary files. To avoid overcomplicating the scanner, + # manually delete them, just like `gradle clean` should have removed + # the build/ dirs. + if '.gradle' in dirs: + shutil.rmtree(os.path.join(root, '.gradle')) # Don't remove possibly necessary 'gradle' dirs if 'gradlew' is not there if 'gradlew' in files: logging.debug("Getting rid of Gradle wrapper stuff in %s" % root)