Fix gradle checkupdates with tags and RM. new settings.

This commit is contained in:
Daniel Martí 2013-08-08 12:55:48 +02:00
parent 7d1f2b68b9
commit d86a68b858
3 changed files with 54 additions and 20 deletions

View file

@ -60,9 +60,12 @@ def check_tags(app, sdk_path):
vcs.gotorevision(None)
flavour = None
if len(app['builds']) > 0:
if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if 'gradle' in app['builds'][-1]:
flavour = app['builds'][-1]['gradle']
hver = None
hcode = "0"
@ -71,10 +74,10 @@ def check_tags(app, sdk_path):
vcs.gotorevision(tag)
# Only process tags where the manifest exists...
path = common.manifest_path(build_dir)
print "Trying manifest at %s" % path
if os.path.exists(path):
version, vercode, package = common.parse_androidmanifest(build_dir)
path = common.manifest_path(build_dir, flavour, gradle,
build_tools, gradle_plugin)
if path is not None and os.path.exists(path):
version, vercode, package = common.parse_androidmanifest(path)
print "Manifest exists. Found version %s" % version
if package and package == app['id'] and version and vercode:
if int(vercode) > int(hcode):
@ -141,11 +144,18 @@ def check_repomanifest(app, sdk_path, branch=None):
if len(app['builds']) > 0:
if 'subdir' in app['builds'][-1]:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if 'gradle' in app['builds'][-1]:
flavour = app['builds'][-1]['gradle']
if not os.path.isdir(build_dir):
return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory")
version, vercode, package = common.parse_androidmanifest(build_dir)
path = common.manifest_path(build_dir, flavour, gradle, build_tools,
gradle_plugin)
if path is None:
return (None, "Gradle flavour not found")
version, vercode, package = common.parse_androidmanifest(path)
if not package:
return (None, "Couldn't find package ID")
if package != app['id']:
@ -213,6 +223,7 @@ def check_market(app):
def main():
#Read configuration...
globals()['gradle'] = "gradle"
execfile('config.py', globals())
# Parse command line...
@ -300,11 +311,11 @@ def main():
if 'subdir' in app['builds'][-1]:
app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])
new_name = common.fetch_real_name(app_dir)
if new_name != app['Auto Name']:
app['Auto Name'] = new_name
if not writeit:
writeit = True
#new_name = common.fetch_real_name(app_dir)
#if new_name != app['Auto Name']:
#app['Auto Name'] = new_name
#if not writeit:
#writeit = True
except Exception:
msg = "Auto Name failed for %s due to exception: %s" % (app['id'], traceback.format_exc())