Skip to content

Commit

Permalink
android: update bazel flag config (#684)
Browse files Browse the repository at this point in the history
Description: #9767 introduced the bazel option and #663 brought it into envoy mobile. This PR changes the bazel config for android to turn on the logger by default when building on android. It also updates a couple other stale flags and docs.
Risk Level: low
Testing: tested locally and saw logs

Fixes #34

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
junr03 authored and jpsim committed Nov 28, 2022
1 parent a66ea6d commit 749d5bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion mobile/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build --javabase=@bazel_tools//tools/jdk:jdk
build:ios --define=manual_stamp=manual_stamp

# Default flags for builds targeting Android
build:android --fat_apk_cpu=x86_64
build:android --define logger=android

# Common flags for release builds
# TODO: Enable `--copt -ggdb3`. Issues were encountered previously with this:
Expand All @@ -42,4 +42,5 @@ build:release-ios --config=release-common
build:release-ios --copt=-fembed-bitcode

# Flags for release builds targeting Android or the JVM
build:release-android --config=android
build:release-android --config=release-common
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ a process listening to traffic sent over this connection.

Getting the build:

1. Build the library using ``bazel build android_dist --config=android``
1. Build the library using ``bazel build android_dist --config=android --fat_apk_cpu=armeabi-v7a``
2. Control: ``bazel mobile-install //examples/kotlin/control:hello_control_kt``
3. Envoy: ``bazel mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=armeabi-v7a``

Expand Down
4 changes: 2 additions & 2 deletions mobile/docs/root/start/building/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Android AAR
Envoy Mobile can be compiled into an ``.aar`` file for use with Android apps.
This command is defined in the main :repo:`BUILD <BUILD>` file of the repo, and may be run locally:

``bazel build android_dist --config=android``
``bazel build android_dist --config=android --fat_apk_cpu=<arch1,arch2>``

Upon completion of the build, you'll see an ``envoy.aar`` file at :repo:`dist/envoy.aar <dist>`.

Expand All @@ -63,7 +63,7 @@ an example of how this artifact may be used.
**When building the artifact for release** (usage outside of development), be sure to include the
``--config=release-android`` option, along with the architectures for which the artifact is being built:

``bazel build android_dist --config=release-android --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a``
``bazel build android_dist --config=release-android --fat_apk_cpu=x86,armeabi-v7a,arm64-v8a``

For a demo of a working app using this artifact, see the :ref:`hello_world` example.

Expand Down
4 changes: 2 additions & 2 deletions mobile/docs/root/start/examples/hello_world.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Next, make sure you have an Android simulator running.

Run the :repo:`sample app <examples/java/hello_world>` using the following Bazel build rule:

``bazel mobile-install //examples/java/hello_world:hello_envoy --fat_apk_cpu=x86``
``bazel mobile-install //examples/java/hello_world:hello_envoy --fat_apk_cpu=<arch1,arch2>``

You should see a new app installed on your simulator called ``Hello Envoy``.
Open it up, and requests will start flowing!
Expand All @@ -38,7 +38,7 @@ Next, make sure you have an Android simulator running.

Run the :repo:`sample app <examples/kotlin/hello_world>` using the following Bazel build rule:

``bazel mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=x86``
``bazel mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=<arch1,arch2>``

You should see a new app installed on your simulator called ``Hello Envoy Kotlin``.
Open it up, and requests will start flowing!
Expand Down

0 comments on commit 749d5bb

Please sign in to comment.