From: Daniel Martí Date: Tue, 1 Jul 2014 17:39:41 +0000 (+0200) Subject: Remove @dir support from gradle X-Git-Tag: 0.2.1~70 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=76ac2f591cb414e72f4c8bee405843288d56b40c;p=fdroidserver.git Remove @dir support from gradle --- diff --git a/docs/fdroid.texi b/docs/fdroid.texi index f0debc4d..e72d3fe3 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -989,19 +989,16 @@ actually not required or used, remove the directory instead (using isn't used nor built will result in an error saying that native libraries were expected in the resulting package. -@item gradle=[@@] +@item gradle= Build with gradle instead of ant, specifying what flavour to assemble. -If is 'yes', 'main' or empty, no flavour will be used. Note +If is 'yes' or 'main', no flavour will be used. Note that this will not work on projects with flavours, since it will build all flavours and there will be no 'main' build. -If @@ is attached to , then the gradle tasks will be run -in that directory. This might be necessary if gradle needs to be run in -the parent directory, in which case one would use -'gradle=@@..'. @item maven=yes[@@] -Build with maven instead of ant. Like gradle, an extra @@ tells f-droid -to run maven inside that relative subdirectory. +Build with maven instead of ant. An extra @@ tells f-droid to run maven +inside that relative subdirectory. Sometimes it is needed to use @@.. so that +builds happen correctly. @item preassemble= Space-separated list of gradle tasks to be run before the assemble task diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 32c6602f..3870d7e3 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -473,17 +473,11 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d logging.info("Cleaning Gradle project...") cmd = [config['gradle'], 'clean'] - if '@' in thisbuild['gradle']: - gradle_dir = os.path.join(root_dir, thisbuild['gradle'].split('@', 1)[1]) - gradle_dir = os.path.normpath(gradle_dir) - else: - gradle_dir = root_dir - adapt_gradle(build_dir) for name, number, libpath in srclibpaths: adapt_gradle(libpath) - p = FDroidPopen(cmd, cwd=gradle_dir) + p = FDroidPopen(cmd, cwd=root_dir) elif thisbuild['type'] == 'kivy': pass @@ -685,13 +679,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d elif thisbuild['type'] == 'gradle': logging.info("Building Gradle project...") - if '@' in thisbuild['gradle']: - flavours = thisbuild['gradle'].split('@')[0].split(',') - gradle_dir = thisbuild['gradle'].split('@')[1] - gradle_dir = os.path.join(root_dir, gradle_dir) - else: - flavours = thisbuild['gradle'].split(',') - gradle_dir = root_dir + flavours = thisbuild['gradle'].split(',') if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']: flavours[0] = '' @@ -711,7 +699,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d if LooseVersion('0.8') <= thisbuild['gradlepluginver'] < LooseVersion('0.11'): commands += ['-x', 'lintVital' + flavours_cmd + 'Release'] - p = FDroidPopen(commands, cwd=gradle_dir) + p = FDroidPopen(commands, cwd=root_dir) elif thisbuild['type'] == 'ant': logging.info("Building Ant project...") diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 0636915c..e80613d1 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1196,13 +1196,6 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= 's@compileSdkVersion *[0-9]*@compileSdkVersion ' + n + '@g', 'build.gradle'], cwd=root_dir) - if '@' in build['gradle']: - gradle_dir = os.path.join(root_dir, build['gradle'].split('@', 1)[1]) - gradle_dir = os.path.normpath(gradle_dir) - FDroidPopen(['sed', '-i', - 's@compileSdkVersion *[0-9]*@compileSdkVersion ' + n + '@g', - 'build.gradle'], - cwd=gradle_dir) # Remove forced debuggable flags remove_debuggable_flags(root_dir)