Commit aad4bd89 authored by relan's avatar relan
Browse files

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.
parent d44d4828
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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