From: relan Date: Sun, 1 Oct 2017 06:57:32 +0000 (+0300) Subject: build: fix build/ and .gradle/ removal after cleaning X-Git-Tag: 0.9~64^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=aad4bd89d8efd8c495ec73f117371490fd11f7ee;p=fdroidserver.git build: fix build/ and .gradle/ removal after cleaning 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. --- diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 0c47ecfb..a4ca67af 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -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