From 00d8e5c19ac50dc9d6a6b1789945d0839be50874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 11 Jan 2014 13:05:02 +0100 Subject: [PATCH] Fix gradle build_tools patching --- fdroidserver/build.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 370223b3..fa0250b2 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -377,17 +377,16 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, force): print "Suspending build server" subprocess.call(['vagrant', 'suspend'], cwd='builder') -def adapt_gradle(path): - for root, dirs, files in os.walk(path): - for f in files: - if f == 'build.gradle': - if options.verbose: - print "Adapting build.gradle at %s" % path +def adapt_gradle(build_dir): + for root, dirs, files in os.walk(build_dir): + if 'build.gradle' in files: + path = os.path.join(root, 'build.gradle') + if options.verbose: + print "Adapting build.gradle at %s" % path - subprocess.call(['sed', '-i', - 's@buildToolsVersion[ ]*["\\\'][0-9\.]*["\\\']@buildToolsVersion "' - + config['build_tools'] + '"@g', path]) - break + subprocess.call(['sed', '-i', + 's@buildToolsVersion[ ]*["\\\'][0-9\.]*["\\\']@buildToolsVersion "' + + config['build_tools'] + '"@g', path]) def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, force, onserver):