Don't run gradle during checkudpates. Use whatever can be found.

This commit is contained in:
Daniel Martí 2013-08-09 17:15:27 +02:00
parent 1d046790bb
commit 1e7bfc9864
2 changed files with 20 additions and 22 deletions

View file

@ -74,9 +74,8 @@ def check_tags(app, sdk_path):
vcs.gotorevision(tag) vcs.gotorevision(tag)
# Only process tags where the manifest exists... # Only process tags where the manifest exists...
path = common.manifest_path(build_dir, flavour, gradle, path = common.manifest_path(build_dir, flavour)
build_tools, gradle_plugin) if path is not None:
if path is not None and os.path.exists(path):
version, vercode, package = common.parse_androidmanifest(path) version, vercode, package = common.parse_androidmanifest(path)
print "Manifest exists. Found version %s" % version print "Manifest exists. Found version %s" % version
if package and package == app['id'] and version and vercode: if package and package == app['id'] and version and vercode:
@ -150,10 +149,9 @@ def check_repomanifest(app, sdk_path, branch=None):
if not os.path.isdir(build_dir): if not os.path.isdir(build_dir):
return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory") return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory")
path = common.manifest_path(build_dir, flavour, gradle, build_tools, path = common.manifest_path(build_dir, flavour)
gradle_plugin)
if path is None: if path is None:
return (None, "Gradle flavour not found") return (None, "No manifest could be found")
version, vercode, package = common.parse_androidmanifest(path) version, vercode, package = common.parse_androidmanifest(path)
if not package: if not package:

View file

@ -875,26 +875,26 @@ def retrieve_string(app_dir, string_id):
return s.replace("\\'","'") return s.replace("\\'","'")
return '' return ''
# Find the AM.xml - try the new gradle method first. # Find the AM.xml - try to use new gradle manifest paths
def manifest_path(app_dir, flavour, gradle, build_tools, gradle_plugin): # TODO: Gradle can use multiple manifests. Return a list of the existing ones
# and later iterate through them to find the highest vercode.
def manifest_path(app_dir, flavour):
if flavour is None: root_manifest = os.path.join(app_dir, 'AndroidManifest.xml')
return os.path.join(app_dir, 'AndroidManifest.xml') if flavour is not None:
flavour_manifest = os.path.join(app_dir, 'src', flavour, 'AndroidManifest.xml')
if os.path.isfile(flavour_manifest):
return flavour_manifest
if not os.path.exists(os.path.join(app_dir, 'src', flavour)): main_manifest = os.path.join(app_dir, 'src', 'main', 'AndroidManifest.xml')
return None print main_manifest
if os.path.isfile(main_manifest):
return main_manifest
for line in fileinput.input(os.path.join(app_dir, 'build.gradle'), inplace=True): if os.path.isfile(root_manifest):
if 'buildToolsVersion' in line: return root_manifest
print 'buildToolsVersion "%s"' % build_tools,
elif 'com.android.tools.build:gradle:' in line:
print "classpath 'com.android.tools.build:gradle:%s'" % gradle_plugin,
else:
print line,
subprocess.Popen([gradle, 'process'+flavour+'ReleaseManifest'], cwd=app_dir).communicate() return None
return os.path.join(app_dir, 'build', 'manifests', flavour, 'release', 'AndroidManifest.xml')
# Retrieve the package name # Retrieve the package name