scanner: fix gradle command match

When there is other flavors inserted before the command it should also
match. Before this change only other flavors appended after the command
is matched
This commit is contained in:
linsui
2025-12-23 01:58:01 +08:00
parent 1884d85e7e
commit a43efb1469
3 changed files with 4 additions and 3 deletions

View File

@@ -20,8 +20,8 @@ import itertools
import json
import logging
import os
import stat
import re
import stat
import sys
import traceback
import urllib.parse
@@ -284,7 +284,7 @@ def get_gradle_compile_commands_without_catalog(build):
def get_gradle_compile_commands_with_catalog(build, prefix):
return [
re.compile(rf'\s*{c}.*\s*\(?{prefix}\.([a-z0-9.]+)', re.IGNORECASE)
re.compile(rf"""\s*\S*{c}\S*\s*\(?{prefix}\.([a-z0-9.]+)""", re.IGNORECASE)
for c in get_gradle_compile_commands(build)
]

View File

@@ -6,4 +6,5 @@ plugins {
dependencies {
implementation(libs.plugins.androidApplication.asLibraryDependency)
"playImplementation"(libs.firebase.core)
}

View File

@@ -124,7 +124,7 @@ class ScannerTest(SetUpTearDownMixin, unittest.TestCase):
'se.manyver': 3,
'lockfile.test': 1,
'com.lolo.io.onelist': 6,
'catalog.test': 22,
'catalog.test': 23,
}
for d in (basedir / 'source-files').iterdir():
build = fdroidserver.metadata.Build()