aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-02-01 00:42:25 +0000
committerGravatar Yun Peng <pcloudy@google.com>2017-02-01 08:57:05 +0000
commit06072c557290b97cb2d2e4fd255b647a9208cb5c (patch)
treeafe8662e456bb199d4a0d2d5c26834e92b2076c2 /tools/android
parentfa97703c1edf7a88cadefd6fbaafcfeb74d2f136 (diff)
Make android_sdk_repository discover all system-images directories in the sdk.
This will be used by the upcoming android_device rule that launches emulators. -- PiperOrigin-RevId: 146183077 MOS_MIGRATED_REVID=146183077
Diffstat (limited to 'tools/android')
-rw-r--r--tools/android/android_sdk_repository_template.bzl18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/android/android_sdk_repository_template.bzl b/tools/android/android_sdk_repository_template.bzl
index ec6de6d605..d6a29f8578 100644
--- a/tools/android/android_sdk_repository_template.bzl
+++ b/tools/android/android_sdk_repository_template.bzl
@@ -19,7 +19,7 @@ def create_android_sdk_rules(
build_tools_directory,
api_levels,
default_api_level):
- """Generate the contents of the android_sdk_repository.
+ """Generate android_sdk rules for the API levels in the Android SDK.
Args:
name: string, the name of the repository being generated.
@@ -203,3 +203,19 @@ def create_android_sdk_rules(
name = "dx_jar_import",
jars = [":dx_jar"],
)
+
+def create_android_device_rules(system_image_dirs):
+ """Generate android_device rules for the system images in the Android SDK.
+
+ Args:
+ system_image_dirs: list of strings, the directories containing system image
+ files to be used to create android_device rules.
+ """
+
+ for system_image_dir in system_image_dirs:
+ name = "_".join(system_image_dir.split("/")[1:])
+
+ native.filegroup(
+ name = "%s_files" % name,
+ srcs = native.glob(["%s/**" % system_image_dir]),
+ )