Commit 69fa141b authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Add ndk path for generate_gradle.py

This way Android Studio makes use of our existing android ndk rather
than having to download a whole new ndk in third_party/android_tools.

Bug: 840542
Change-Id: Idcf06675f5e5f74cd860570102c38ae20dd97807
Reviewed-on: https://chromium-review.googlesource.com/1054439Reviewed-by: default avataragrieve <agrieve@chromium.org>
Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558305}
parent c6977c05
......@@ -56,6 +56,8 @@ if (enable_java_templates) {
_data +=
"android_sdk_root=" + rebase_path(android_sdk_root, root_build_dir) + CR
_data += "android_sdk_version=$android_sdk_version$CR"
_data +=
"android_ndk_root=" + rebase_path(android_ndk_root, root_build_dir) + CR
_data += "android_tool_prefix=" +
rebase_path(android_tool_prefix, root_build_dir) + CR
write_file(android_build_vars, _data)
......
......@@ -535,10 +535,11 @@ def _CreateJniLibsDir(output_dir, entry_output_dir, so_files):
return []
def _GenerateLocalProperties(sdk_dir):
def _GenerateLocalProperties(sdk_dir, ndk_dir):
"""Returns the data for project.properties as a string."""
return '\n'.join([
'# Generated by //build/android/gradle/generate_gradle.py',
'ndk.dir=%s' % ndk_dir,
'sdk.dir=%s' % sdk_dir,
''])
......@@ -941,8 +942,9 @@ def main():
sdk_path = os.path.expanduser('~/Android/Sdk')
else:
sdk_path = _RebasePath(build_vars['android_sdk_root'])
ndk_path = _RebasePath(build_vars['android_ndk_root'])
_WriteFile(os.path.join(generator.project_dir, 'local.properties'),
_GenerateLocalProperties(sdk_path))
_GenerateLocalProperties(sdk_path, ndk_path))
if args.full:
zip_tuples = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment