mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
prefer build.gradle with Android Plugin as source of package/version/code
These days, the location that overrides all the others is in the android{}
block of the build.gradle file that loads the com.android.application
plugin. So this should be the preferred place to read these values.
test files GPL licensed: https://github.com/Integreight/1Sheeld-Android-App
This commit is contained in:
parent
d9722f4453
commit
83ffeb855f
17 changed files with 598 additions and 2 deletions
|
|
@ -41,7 +41,6 @@ from .exception import FDroidException
|
|||
|
||||
SETTINGS_GRADLE = re.compile(r'settings\.gradle(?:\.kts)?')
|
||||
GRADLE_SUBPROJECT = re.compile(r'''['"]:([^'"]+)['"]''')
|
||||
ANDROID_PLUGIN = re.compile(r'''\s*(:?apply plugin:|id)\(?\s*['"](android|com\.android\.application)['"]\s*\)?''')
|
||||
|
||||
|
||||
# Get the repo type and address from the given web page. The page is scanned
|
||||
|
|
@ -197,7 +196,7 @@ def get_gradle_subdir(build_dir, paths):
|
|||
line = fp.readline()
|
||||
if not line:
|
||||
break
|
||||
if ANDROID_PLUGIN.match(line):
|
||||
if common.ANDROID_PLUGIN_REGEX.match(line):
|
||||
return os.path.relpath(os.path.dirname(f), build_dir)
|
||||
if first_gradle_dir and first_gradle_dir != '.':
|
||||
return first_gradle_dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue