Make the 'update' flag a list too

This commit is contained in:
Daniel Martí 2014-02-17 13:07:13 +01:00
parent f894ac3b29
commit 0ecd5172b1
3 changed files with 12 additions and 12 deletions

View file

@ -852,7 +852,7 @@ possibly sub-projects. This is likely to cause the whole build.xml to be
rewritten, which is fine if it's a 'standard' android file or doesn't already rewritten, which is fine if it's a 'standard' android file or doesn't already
exist, but not a good idea if it's heavily customised. exist, but not a good idea if it's heavily customised.
@item update=xxx @item update=<auto/dirs>
By default, 'android update project' is used to generate or update the By default, 'android update project' is used to generate or update the
project and all its referenced projects. Specifying update=no bypasses that. project and all its referenced projects. Specifying update=no bypasses that.
Note that this only matters in ant build recipes. Note that this only matters in ant build recipes.
@ -860,7 +860,7 @@ Note that this only matters in ant build recipes.
Default value is '@code{auto}', which uses the paths used in the Default value is '@code{auto}', which uses the paths used in the
project.properties file to find out what project paths to update. project.properties file to find out what project paths to update.
Otherwise, value can be a semicolon-separated list of directories in Otherwise, value can be a comma-separated list of directories in
which to run 'android update project' relative to the main which to run 'android update project' relative to the main
application directory (which may include '@code{subdir}' parameter). application directory (which may include '@code{subdir}' parameter).
@ -895,14 +895,14 @@ Multiple files/directories can be specified by separating them with ','.
Directories will be recursively deleted. Directories will be recursively deleted.
@item extlibs=a,b,... @item extlibs=a,b,...
Specifies a list of external libraries (jar files) from the Comma-separated list of external libraries (jar files) from the
@code{build/extlib} library, which will be placed in the @code{libs} directory @code{build/extlib} library, which will be placed in the @code{libs} directory
of the project. Separate items with semicolons. of the project.
@item srclibs=[n:]a@@r,[n:]b@@r1,... @item srclibs=[n:]a@@r,[n:]b@@r1,...
Specifies a list of source libraries or Android projects. Separate items with Comma-separated list of source libraries or Android projects. Each item is of
semicolons, and each item is of the form name@@rev where name is the predefined the form name@@rev where name is the predefined source library name and rev is
source library name and rev is the revision or tag in source control to use. the revision or tag to use in the respective source control.
For ant projects, you can optionally append a number with a colon at the For ant projects, you can optionally append a number with a colon at the
beginning of a srclib item to automatically place it in project.properties as beginning of a srclib item to automatically place it in project.properties as

View file

@ -1055,9 +1055,9 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
raise BuildException("Error running prebuild command for %s:%s" % raise BuildException("Error running prebuild command for %s:%s" %
(app['id'], build['version']), p.stdout) (app['id'], build['version']), p.stdout)
updatemode = build.get('update', 'auto') updatemode = build.get('update', ['auto'])
# Generate (or update) the ant build file, build.xml... # Generate (or update) the ant build file, build.xml...
if updatemode != 'no' and build['type'] == 'ant': if updatemode != ['no'] and build['type'] == 'ant':
parms = [os.path.join(config['sdk_path'], 'tools', 'android'), 'update'] parms = [os.path.join(config['sdk_path'], 'tools', 'android'), 'update']
lparms = parms + ['lib-project'] lparms = parms + ['lib-project']
parms = parms + ['project'] parms = parms + ['project']
@ -1065,10 +1065,10 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
if 'target' in build and build['target']: if 'target' in build and build['target']:
parms += ['-t', build['target']] parms += ['-t', build['target']]
lparms += ['-t', build['target']] lparms += ['-t', build['target']]
if updatemode == 'auto': if updatemode == ['auto']:
update_dirs = ant_subprojects(root_dir) + ['.'] update_dirs = ant_subprojects(root_dir) + ['.']
else: else:
update_dirs = [d.strip() for d in updatemode.split(';')] update_dirs = updatemode
for d in update_dirs: for d in update_dirs:
subdir = os.path.join(root_dir, d) subdir = os.path.join(root_dir, d)

View file

@ -452,7 +452,7 @@ def metafieldtype(name):
def flagtype(name): def flagtype(name):
if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni', if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni',
'scanignore', 'scandelete']: 'update', 'scanignore', 'scandelete']:
return 'list' return 'list'
if name in ['init', 'prebuild', 'build']: if name in ['init', 'prebuild', 'build']:
return 'script' return 'script'