aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/tutorial
diff options
context:
space:
mode:
authorGravatar dannark <dannark@google.com>2017-09-06 02:29:30 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-09-06 10:10:24 +0200
commit5eb684ff92caefc540a7efeace324416213adbf3 (patch)
treeae1789c515848cea60346335a2efa01dd4654f6c /site/docs/tutorial
parent0b6b5df7cf5d790ad45f6c4e6c28e9ec85978dc1 (diff)
Update Bazel android tutorial to reflect more possible usages of android_sdk_repository and android_ndk_repository without api_level.
RELNOTES: None PiperOrigin-RevId: 167655738
Diffstat (limited to 'site/docs/tutorial')
-rw-r--r--site/docs/tutorial/android-app.md23
1 files changed, 11 insertions, 12 deletions
diff --git a/site/docs/tutorial/android-app.md b/site/docs/tutorial/android-app.md
index f42ce86fc5..a049f22035 100644
--- a/site/docs/tutorial/android-app.md
+++ b/site/docs/tutorial/android-app.md
@@ -125,26 +125,25 @@ Add the following lines to your `WORKSPACE` file:
```python
android_sdk_repository(
- name = "androidsdk",
- # Replace with your installed Android SDK API level
- api_level = 25
+ name = "androidsdk"
)
```
This will use the Android SDK referenced by the `ANDROID_HOME` environment
-variable, and automatically detect the latest build tools version installed
-within that location.
+variable, and automatically detect the highest API level and the latest version
+of build tools installed within that location.
Alternatively, you can explicitly specify the location of the Android
-SDK and build tools version to use by including the `path` and
-`build_tools_version` attributes:
+SDK, the API level, and the version of build tools to use by including the
+`path`,`api_level`, and `build_tools_version` attributes. You can specify any
+subset of these attributes:
```python
android_sdk_repository(
name = "androidsdk",
path = "/path/to/Android/sdk",
api_level = 25,
- build_tools_version = "25.0.1"
+ build_tools_version = "26.0.1"
)
```
@@ -156,14 +155,14 @@ file:
```python
android_ndk_repository(
- name = "androidndk",
- # Replace with the Android NDK API level
- api_level = 23
+ name = "androidndk"
)
```
`api_level` is the version of the Android API the SDK and the NDK target
-(for example, 23 for Android 6.0 and 25 for Android 7.1). It's not necessary to
+(for example, 23 for Android 6.0 and 25 for Android 7.1). If not explicitly
+set, `api_level` will default to the highest available API level for
+`android_sdk_repository` and `android_ndk_repository`. It's not necessary to
set the API levels to the same value for the SDK and NDK.
[This web page](https://developer.android.com/ndk/guides/stable_apis.html)
contains a map from Android releases to NDK-supported API levels.