1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

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.
This commit is contained in:
relan 2017-10-01 09:57:32 +03:00
parent d44d48285b
commit aad4bd89d8

View 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