aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-02-01 18:15:45 +0000
committerGravatar Yun Peng <pcloudy@google.com>2017-02-02 09:59:30 +0000
commitee9a3001d9a453fcd4cf6938fa61a8bbaa267aef (patch)
tree3295754585815ec7b280ab8f4fe33c5abb6fad93 /tools/android
parent893bf08b5c21b4427df1d619cb33741c4b2dc76a (diff)
*** Reason for rollback *** Rollforward with fixes and a test. Previously AndroidSdkRepository required that system-images/ directory exist in the Android SDK. However, it does not exist until you download the first system image. *** Original change description *** Automated [] rollback of commit 06072c557290b97cb2d2e4fd255b647a9208cb5c. *** Reason for rollback *** Broke andriod_sdk_repository on ci.bazel.io See https://github.com/bazelbuild/bazel/issues/2465 *** Original change description *** 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: 146258003 MOS_MIGRATED_REVID=146258003
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]),
+ )