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
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
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] = ''
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...")
'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)