chiark / gitweb /
build: make sure .gradle/ is removed at clean
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 23 Sep 2015 20:02:22 +0000 (13:02 -0700)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 23 Sep 2015 20:02:22 +0000 (13:02 -0700)
fdroidserver/build.py

index b83885e1922d004cce1f10eb68b27a41507d4be2..82508067b55878b9dc5d441f3c10c594e8fe44ef 100644 (file)
@@ -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)