List of Gradle tasks to be run before the assemble task in a Gradle project
build.
+@item gradleprops=<prop1>[,<prop2>,...]
+List of Gradle properties to pass via the command line to Gradle. A property
+can be of the form @code{foo} or of the form @code{key=value}.
+
+For example: @code{gradleprops=enableFoo,someSetting=bar} will result in
+@code{gradle -PenableFoo -PsomeSetting=bar}.
+
@item antcommands=<target1>[,<target2>,...]
Specify an alternate set of Ant commands (target) instead of the default
'release'. It can't be given any flags, such as the path to a build.xml.
adapt_gradle(libpath)
cmd = [config['gradle']]
+ if thisbuild['gradleprops']:
+ cmd += ['-P'+kv for kv in thisbuild['gradleprops']]
+
for task in gradletasks:
parts = task.split(':')
parts[-1] = 'clean' + capitalize_intact(parts[-1])
with open(os.path.join(root_dir, 'build.gradle'), "a") as f:
f.write("\nandroid { lintOptions { checkReleaseBuilds false } }\n")
- commands = [config['gradle']] + gradletasks
+ cmd = [config['gradle']]
+ if thisbuild['gradleprops']:
+ cmd += ['-P'+kv for kv in thisbuild['gradleprops']]
+
+ cmd += gradletasks
- p = FDroidPopen(commands, cwd=root_dir)
+ p = FDroidPopen(cmd, cwd=root_dir)
elif thisbuild['type'] == 'ant':
logging.info("Building Ant project...")
('buildjni', []),
('ndk', 'r10e'), # defaults to latest
('preassemble', []),
+ ('gradleprops', []),
('antcommands', None),
('novcheck', False),
])
def flagtype(name):
if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni', 'preassemble',
- 'update', 'scanignore', 'scandelete', 'gradle', 'antcommands']:
+ 'update', 'scanignore', 'scandelete', 'gradle', 'antcommands',
+ 'gradleprops']:
return 'list'
if name in ['init', 'prebuild', 'build']:
return 'script'