aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/workspace_user.sh
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-03-23 18:40:51 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-24 12:16:55 +0000
commit9b7330fb2ec743f6e36b53e71ca39459a4ab4282 (patch)
tree52803cc03b10ac658603a78e1ab02e71a49dd877 /scripts/workspace_user.sh
parent40bf169dfad2a3285d255c9100450b29be63202c (diff)
Simplify the steps needed to run android_integration_test.
As of Bazel 0.4.5, the android_sdk_for_test and android_ndk_for_test are bound in android.WORKSPACE, so we do not need to include them in the main Bazel WORKSPACE file. I've update the comments to reflect that all that is needed to run the tests is android_sdk_repository and android_ndk_repository and the environment variables that they read. Also, delete scripts/workspace_user.sh. All of its functionality (reading environment variables, detecting api levels, build tools versions) is now part of android_{s,n}dk_repository. Fixes https://github.com/bazelbuild/bazel/issues/2284. -- PiperOrigin-RevId: 151032551 MOS_MIGRATED_REVID=151032551
Diffstat (limited to 'scripts/workspace_user.sh')
-rwxr-xr-xscripts/workspace_user.sh76
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/workspace_user.sh b/scripts/workspace_user.sh
deleted file mode 100755
index 4ad5ab8a79..0000000000
--- a/scripts/workspace_user.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /usr/bin/env bash
-#
-# Copyright 2016 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This script locates the android sdk (via ANDROID_HOME) and ndk
-# (via ANDROID_NDK) on your system, and writes a WORKSPACE.user.bzl
-# that points to them.
-
-set -euo pipefail
-
-while [ ! -f WORKSPACE ]; do
- cd ..
- if [ "/" = $(pwd) ]
- then
- echo "WORKSPACE not found." 1>&2
- exit 1
- fi
-done
-
-function highest_api_level() {
- ls $ANDROID_HOME/platforms | cut -d '-' -f 2 | sort -n | tail -n 1
-}
-
-if [ -n "${ANDROID_HOME:-}" ]; then
- : ${ANDROID_API_LEVEL:=$(highest_api_level)}
- cat <<EOF >WORKSPACE.user.bzl
-def android_sdk():
- native.android_sdk_repository(
- name = "androidsdk",
- path = "${ANDROID_HOME}",
- # Available versions are under /path/to/sdk/platforms/.
- api_level = ${ANDROID_API_LEVEL},
- )
- native.bind(name = "android_sdk_for_testing", actual = "@androidsdk//:files")
-EOF
-else
- cat <<EOF >WORKSPACE.user.bzl
-def android_sdk():
- native.bind(name = "android_sdk_for_testing", actual = "//:dummy")
-EOF
-fi
-
-if [ -n "${ANDROID_NDK:-}" ]; then
- cat <<EOF >>WORKSPACE.user.bzl
-def android_ndk():
- native.android_ndk_repository(
- name = "androidndk",
- path = "${ANDROID_NDK}",
- api_level = ${ANDROID_API_LEVEL},
- )
- native.bind(name = "android_ndk_for_testing", actual = "@androidndk//:files")
-EOF
-else
- cat <<EOF >>WORKSPACE.user.bzl
-def android_ndk():
- native.bind(name = "android_ndk_for_testing", actual = "//:dummy")
-EOF
-fi
-
-cat <<EOF >>WORKSPACE.user.bzl
-def android_repositories():
- android_sdk()
- android_ndk()
-EOF