chiark / gitweb /
build: clean up only known subdirectories in build/*
authorrelan <email@hidden>
Wed, 10 Jan 2018 18:06:32 +0000 (21:06 +0300)
committerrelan <email@hidden>
Wed, 10 Jan 2018 18:45:26 +0000 (21:45 +0300)
We remove the whole "build" directory while cleaning source code tree
because Gradle can leave there files even after "gradle clean". But some
projects (Mozilla Fennec) actually have useful stuff checked into VCS
under the "build" directory.

Remove only those subdirectories that we known for sure are leftovers
from Gradle.

Fixes fdroid/fdroidserver#438.

fdroidserver/build.py

index 83cb18ab1e559caa7a8d7142fc8d56385364db9e..39bde47b16c8fe8a96bed54d16fd739f3a4439c2 100644 (file)
@@ -518,8 +518,14 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
             # 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.
-            del_dirs(['build', '.gradle'])
+            # the build/* dirs.
+            del_dirs([os.path.join('build', 'android-profile'),
+                      os.path.join('build', 'generated'),
+                      os.path.join('build', 'intermediates'),
+                      os.path.join('build', 'outputs'),
+                      os.path.join('build', 'reports'),
+                      os.path.join('build', 'tmp'),
+                      '.gradle'])
             del_files(['gradlew', 'gradlew.bat'])
 
         if 'pom.xml' in files: