1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

Only notify of those gradle/ant files that were stripped of signing keys

This commit is contained in:
Daniel Martí 2013-11-15 12:42:39 +01:00
parent 67b6106a55
commit d7906fe07b

View File

@ -1936,9 +1936,10 @@ def remove_signing_keys(build_dir):
for root, dirs, files in os.walk(build_dir):
if 'build.gradle' in files:
path = os.path.join(root, 'build.gradle')
changed = False
if options.verbose:
print "Cleaning build.gradle of keysigning configs at %s" % path
print "Cleaned build.gradle of keysigning configs at %s" % path
with open(path, "r") as o:
lines = o.readlines()
@ -1948,27 +1949,35 @@ def remove_signing_keys(build_dir):
for line in lines:
if 'signingConfigs ' in line:
opened = 1
changed = True
elif opened > 0:
if '{' in line:
opened += 1
elif '}' in line:
opened -=1
elif not any(s in line for s in (
elif any(s in line for s in (
' signingConfig ',
'android.signingConfigs.',
'variant.outputFile = ')):
changed = True
else:
o.write(line)
for propfile in ('build.properties', 'default.properties', 'ant.properties'):
if propfile in files:
if options.verbose:
print "Cleaning %s of keysigning configs at %s" % (propfile,path)
path = os.path.join(root, propfile)
changed = False
with open(path, "w") as o:
for line in lines:
if not line.startswith('key.store'):
if line.startswith('key.store'):
changed = True
else:
o.write(line)
if changed and options.verbose:
print "Cleaned %s of keysigning configs at %s" % (propfile,path)
def replace_config_vars(cmd):
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
cmd = cmd.replace('$$NDK$$', config['ndk_path'])