mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
Better gradle signingConfig patching
This fixes the building of impeller 0.8.7
This commit is contained in:
parent
5cd47137dd
commit
6cd34a1d21
1 changed files with 8 additions and 7 deletions
|
|
@ -1403,9 +1403,15 @@ def FDroidPopen(commands, cwd=None, shell=False):
|
||||||
|
|
||||||
def remove_signing_keys(build_dir):
|
def remove_signing_keys(build_dir):
|
||||||
comment = re.compile(r'[ ]*//')
|
comment = re.compile(r'[ ]*//')
|
||||||
signing_configs = re.compile(r'[\t ]*signingConfigs[ \t]*{[ \t]*$')
|
signing_configs = re.compile(r'^[\t ]*signingConfigs[ \t]*{[ \t]*$')
|
||||||
r_open = re.compile(r'.*{[\t ]*$')
|
r_open = re.compile(r'.*{[\t ]*$')
|
||||||
r_close = re.compile(r'.*}[\t ]*$')
|
r_close = re.compile(r'.*}[\t ]*$')
|
||||||
|
line_matches = [
|
||||||
|
re.compile(r'^[\t ]*signingConfig [^ ]*$'),
|
||||||
|
re.compile(r'android.signingConfigs.'),
|
||||||
|
re.compile(r'variant.outputFile = '),
|
||||||
|
re.compile(r'.readLine\('),
|
||||||
|
]
|
||||||
for root, dirs, files in os.walk(build_dir):
|
for root, dirs, files in os.walk(build_dir):
|
||||||
if 'build.gradle' in files:
|
if 'build.gradle' in files:
|
||||||
path = os.path.join(root, 'build.gradle')
|
path = os.path.join(root, 'build.gradle')
|
||||||
|
|
@ -1427,12 +1433,7 @@ def remove_signing_keys(build_dir):
|
||||||
opened += 1
|
opened += 1
|
||||||
elif r_close.match(line):
|
elif r_close.match(line):
|
||||||
opened -= 1
|
opened -= 1
|
||||||
elif any(s in line for s in (
|
elif any(s.match(line) for s in line_matches):
|
||||||
' signingConfig ',
|
|
||||||
'android.signingConfigs.',
|
|
||||||
'variant.outputFile = ',
|
|
||||||
'.readLine(',
|
|
||||||
)):
|
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
o.write(line)
|
o.write(line)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue