chiark / gitweb /
build: fix build/ and .gradle/ removal after cleaning
authorrelan <email@hidden>
Sun, 1 Oct 2017 06:57:32 +0000 (09:57 +0300)
committerrelan <email@hidden>
Sun, 1 Oct 2017 07:11:37 +0000 (10:11 +0300)
An app may not have a top-level build.gradle file, while Gradle still
creates top-level .gradle/ directory. When build.gradle is absent,
fdroidserver will not remove .gradle/, scanner will find binaries in it
and fail the whole build.

Fix this by also checking for settings.gradle file (should always exist
in the top-level directory) in addition to build.gradle.

fdroidserver/build.py

index 0c47ecfb1ef86324aed5125fa07b0cdfc8182214..a4ca67af0acf6be530be30d17253db6892f7d994 100644 (file)
@@ -498,7 +498,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
                 if f in files:
                     os.remove(os.path.join(root, f))
 
-        if 'build.gradle' in files:
+        if any(f in files for f in ['build.gradle', 'settings.gradle']):
             # 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