Skip to content

Commit

Permalink
Update android tutorial to clarify android sdk path options
Browse files Browse the repository at this point in the history
The android_sdk_repository path parameter is now optional, and for most setups it is easier to omit it and rely on the `ANDROID_HOME` environment variable. Updated this part of the tutorial to clarify this.

Closes bazelbuild#2632.

--
Reviewed-on: bazelbuild#2632
PiperOrigin-RevId: 149337570
MOS_MIGRATED_REVID=149337570
  • Loading branch information
Iain McGinniss authored and vladmos committed Mar 7, 2017
1 parent 3386651 commit 9bb9001
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Kamal Marhubi <[email protected]>
Damien Martin-Guillerez <[email protected]>
Carl Mastrangelo <[email protected]>
Michajlo Matijkiw <[email protected]>
Iain McGinniss <[email protected]>
Julio Merino <[email protected]>
Adam Michael <[email protected]>
Liam Miller-Cushon <[email protected]>
Expand Down
31 changes: 23 additions & 8 deletions site/versions/master/docs/tutorial/android-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,25 @@ Add the following lines to your `WORKSPACE` file:
```python
android_sdk_repository(
name = "androidsdk",
# Replace with path to Android SDK on your system
path = "/Users/username/Library/Android/sdk",
# Replace with the Android SDK API level
api_level = 23,
# Replace with the version in sdk/build-tools/
build_tools_version="23.0.0"
# Replace with your installed Android SDK API level
api_level = 25
)
```

This will use the Android SDK specified referenced by the `ANDROID_HOME`
environment variable, and automatically detect the latest build tools
version 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:

```python
android_sdk_repository(
name = "androidsdk",
path = "/path/to/Android/sdk",
api_level = 25,
build_tools_version = "25.0.1"
)
```

Expand All @@ -85,8 +98,6 @@ file:
```python
android_ndk_repository(
name = "androidndk",
# Replace with path to Android NDK on your system
path = "/Users/username/Library/Android/ndk",
# Replace with the Android NDK API level
api_level = 21
)
Expand All @@ -98,6 +109,10 @@ 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.

Similar to `android_sdk_repository`, the path to the Android NDK is inferred from
the `ANDROID_NDK_HOME` environment variable by default. The path can also be
explicitly specified with a `path` attribute on `android_ndk_repository`.

## Create a BUILD file

A [`BUILD` file](/docs/build-ref.html#BUILD_files) is a text file that describes
Expand Down

0 comments on commit 9bb9001

Please sign in to comment.