1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

Remove @dir support from gradle

This commit is contained in:
Daniel Martí 2014-07-01 19:39:41 +02:00
parent 7be0634a52
commit 76ac2f591c
3 changed files with 8 additions and 30 deletions

View File

@ -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=<flavour>[@@<dir>]
@item gradle=<flavour>
Build with gradle instead of ant, specifying what flavour to assemble.
If <flavour> is 'yes', 'main' or empty, no flavour will be used. Note
If <flavour> 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 @@<dir> is attached to <flavour>, 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=<flavour>@@..'.
@item maven=yes[@@<dir>]
Build with maven instead of ant. Like gradle, an extra @@<dir> tells f-droid
to run maven inside that relative subdirectory.
Build with maven instead of ant. An extra @@<dir> tells f-droid to run maven
inside that relative subdirectory. Sometimes it is needed to use @@.. so that
builds happen correctly.
@item preassemble=<task1> <task2>
Space-separated list of gradle tasks to be run before the assemble task

View File

@ -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...")

View File

@ -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)