aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar ajmichael <ajmichael@google.com>2017-05-05 05:15:02 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-05-05 15:27:26 +0200
commit71ed1ee7c796b6cc0366ed4d39963b9542ac6e58 (patch)
treee42096edbd6db3fffd9b0e6ed746ef86f4becea1 /src/main/java/com/google/devtools/build
parent14747a8bf2d35846d75ac9058e1b514a89f68f07 (diff)
Improve error message when building Android rules without an SDK.
Fixes https://github.com/bazelbuild/bazel/issues/509. Example output: ``` $ bazel build //:all INFO: Found 1 target... ERROR: /usr/local/google/home/ajmichael/.cache/bazel/_bazel_ajmichael/7fcc7480abc634522e5c0cfe6b85b583/external/bazel_tools/tools/android/BUILD:236:1: Executing genrule @bazel_tools//tools/android:no_android_sdk_repository_error failed: Process exited with status 1 [sandboxed]. This build requires an Android SDK. Please add the android_sdk_repository rule to your WORKSPACE. Use --strategy=Genrule=standalone to disable sandboxing for the failing actions. Target //:lib failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 0.327s, Critical Path: 0.10s ``` RELNOTES: Attempting to build an Android target without setting up android_sdk_repository will now produce a helpful error message. PiperOrigin-RevId: 155158667
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE
index c25c571698..51fdfef483 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE
@@ -1,4 +1,5 @@
-bind(name = "android/sdk")
+bind(name = "android/sdk", actual = "@bazel_tools//tools/android:poison_pill_android_sdk")
+bind(name = "android/dx_jar_import", actual = "@bazel_tools//tools/android:no_android_sdk_repository_error")
bind(name = "android/crosstool", actual = "@bazel_tools//tools/cpp:toolchain")
bind(name = "android_sdk_for_testing", actual = "//:dummy")
bind(name = "android_ndk_for_testing", actual = "//:dummy")