if 'target' in build:
parms.append('-t')
parms.append(build['target'])
- update_dirs = [d.strip() for d in updatemode.split(';')]
+ update_dirs = None
+ if updatemode == 'auto':
+ update_dirs = ['.']
+ with open(os.path.join(root_dir, 'project.properties')) as f:
+ for line in f.readlines():
+ if not line.startswith('android.library.reference.'):
+ continue
+ path = line.split('=')[1].strip()
+ relpath = os.path.join(root_dir, path)
+ if not os.path.isdir(relpath):
+ continue
- if verbose:
++ if options.verbose:
+ print "Found subproject %s..." % path
+ update_dirs.append(path)
+ else:
+ update_dirs = [d.strip() for d in updatemode.split(';')]
# Force build.xml update if necessary...
if updatemode == 'force' or 'target' in build:
if updatemode == 'force':
if os.path.exists(badpath):
print "Removing '%s'" % badpath
shutil.rmtree(badpath)
- if verbose:
+ dparms = parms + ['-p', d]
- print "Update of '%s': exec '%s' in '%s'"%\
- (d," ".join(parms),cwd)
- p = FDroidPopen(parms, cwd=cwd)
+ if options.verbose:
- p = FDroidPopen(dparms, cwd=root_dir, verbose=verbose)
+ if d == '.':
+ print "Updating main project..."
+ else:
+ print "Updating subproject %s..." % d
++ p = FDroidPopen(dparms, cwd=root_dir)
# check to see whether an error was returned without a proper exit code (this is the case for the 'no target set or target invalid' error)
if p.returncode != 0 or (p.stderr != "" and p.stderr.startswith("Error: ")):
- raise BuildException("Failed to update project at %s" % cwd,
+ raise BuildException("Failed to update project at %s" % d,
p.stdout, p.stderr)
# If the app has ant set up to sign the release, we need to switch