From 502ccb2d91bec6e3c3badeee334371a7f4a80c72 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 1 Dec 2021 10:24:17 -0800 Subject: [PATCH] bazel: add bazelw wrapper (#1935) This wrapper allows developers to quickly get off the ground without having to install bazel or bazelisk manually. Signed-off-by: Keith Smiley --- .github/workflows/android_build.yml | 10 ++--- .github/workflows/android_tests.yml | 6 +-- .github/workflows/artifacts.yml | 4 +- .github/workflows/asan.yml | 2 +- .github/workflows/cc_tests.yml | 2 +- .github/workflows/core.yml | 2 +- .github/workflows/format.yml | 4 +- .github/workflows/ios_build.yml | 16 ++++---- .github/workflows/ios_tests.yml | 2 +- .github/workflows/python_tests.yml | 2 +- .github/workflows/tsan.yml | 2 +- bazelw | 38 +++++++++++++++++++ .../development/debugging/android_local.rst | 2 +- .../development/performance/binary_size.rst | 2 +- .../performance/cpu_battery_impact.rst | 6 +-- .../performance/device_connectivity.rst | 2 +- docs/root/development/testing/testing.rst | 8 ++-- docs/root/development/tools/intellij.rst | 7 ++-- docs/root/development/tools/tulsi.rst | 2 +- docs/root/start/building/building.rst | 15 ++++---- docs/root/start/examples/hello_world.rst | 8 ++-- 21 files changed, 90 insertions(+), 52 deletions(-) create mode 100755 bazelw diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index bcf21186ca..edfadb63c2 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -38,7 +38,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazelisk build \ + ./bazelw build \ --config=remote-ci-macos \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ --fat_apk_cpu=x86 \ @@ -70,13 +70,13 @@ jobs: - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: - # bazelisk mobile-install --fat_apk_cpu=x86 --start_app //examples/java/hello_world:hello_envoy + # ./bazelw mobile-install --fat_apk_cpu=x86 --start_app //examples/java/hello_world:hello_envoy # When https://github.com/lyft/envoy-mobile/issues/853 is fixed. - name: 'Start java app' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazelisk build \ + ./bazelw build \ --config=remote-ci-macos \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ --fat_apk_cpu=x86 \ @@ -113,13 +113,13 @@ jobs: - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: - # bazelisk mobile-install --fat_apk_cpu=x86 --start_app //examples/kotlin/hello_world:hello_envoy_kt + # ./bazelw mobile-install --fat_apk_cpu=x86 --start_app //examples/kotlin/hello_world:hello_envoy_kt # When https://github.com/lyft/envoy-mobile/issues/853 is fixed. - name: 'Start kotlin app' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazelisk build \ + ./bazelw build \ --config=remote-ci-macos \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ --fat_apk_cpu=x86 \ diff --git a/.github/workflows/android_tests.yml b/.github/workflows/android_tests.yml index 7bef820774..6b16e0e5af 100644 --- a/.github/workflows/android_tests.yml +++ b/.github/workflows/android_tests.yml @@ -42,7 +42,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazel test \ + ./bazelw test \ --test_output=all \ --build_tests_only \ --config=remote-ci-macos \ @@ -81,7 +81,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazel test \ + ./bazelw test \ --test_output=all \ --build_tests_only \ --config=remote-ci-macos \ @@ -125,7 +125,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazel test \ + ./bazelw test \ --test_output=all \ --build_tests_only \ --config=remote-ci-linux-clang \ diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 15a34932cd..c402b338d3 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -26,7 +26,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | current_release_version=$(git describe --tag --abbrev=0) - bazelisk build \ + ./bazelw build \ --config=release-android \ --fat_apk_cpu=x86 \ --define=pom_version=$current_release_version \ @@ -114,7 +114,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazelisk build \ + ./bazelw build \ --config=release-ios \ --ios_multi_cpus=i386,x86_64,armv7,arm64 \ --config=remote-ci-macos \ diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 67dca42db6..417a0ee86e 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: steps.check_context.outputs.run_tests == 'true' run: | - bazel test --test_output=all \ + ./bazelw test --test_output=all \ --test_env=ENVOY_IP_TEST_VERSIONS=v4only \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ --config=remote-ci-linux-asan \ diff --git a/.github/workflows/cc_tests.yml b/.github/workflows/cc_tests.yml index 214506078b..76f4318675 100644 --- a/.github/workflows/cc_tests.yml +++ b/.github/workflows/cc_tests.yml @@ -20,4 +20,4 @@ jobs: - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} name: 'Run tests' - run: bazel test --action_env=LD_LIBRARY_PATH --test_output=all --config=remote-ci-linux --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/cc/... + run: ./bazelw test --action_env=LD_LIBRARY_PATH --test_output=all --config=remote-ci-linux --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/cc/... diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index f8adc66b5d..ae4dfe384a 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -20,4 +20,4 @@ jobs: - name: 'Run tests' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk test --test_output=all --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/common/... + run: ./bazelw test --test_output=all --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/common/... diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 123d4ef465..f23f31eec8 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -63,10 +63,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazel build \ + ./bazelw build \ --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ //library/kotlin/io/envoyproxy/envoymobile:envoy_lib_lint \ //examples/kotlin/hello_world:hello_envoy_kt_lint - name: 'Run Kotlin Formatter (ktlint)' run: | - bazel build kotlin_format + ./bazelw build kotlin_format diff --git a/.github/workflows/ios_build.yml b/.github/workflows/ios_build.yml index 212667eff3..5ec62bb7d4 100644 --- a/.github/workflows/ios_build.yml +++ b/.github/workflows/ios_build.yml @@ -30,8 +30,8 @@ jobs: - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazelisk shutdown - bazelisk build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //:ios_dist + ./bazelw shutdown + ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //:ios_dist if: steps.check-cache.outputs.cache-hit != 'true' name: 'Build Envoy.framework distributable' swifthelloworld: @@ -56,12 +56,12 @@ jobs: name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app + run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app name: 'Build swift app' # Run the app in the background and redirect logs. - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app &> /tmp/envoy.log & + run: ./bazelw run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app &> /tmp/envoy.log & name: 'Run swift app' - run: sed '/received headers with status 200/q' <(touch /tmp/envoy.log && tail -F /tmp/envoy.log) name: 'Check connectivity' @@ -90,12 +90,12 @@ jobs: name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/async_await:app + run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/async_await:app name: 'Build swift app' # Run the app in the background and redirect logs. - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/async_await:app &> /tmp/envoy.log & + run: ./bazelw run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/async_await:app &> /tmp/envoy.log & name: 'Run swift app' - run: sed '/\[2\] Uploaded 7 MB of data/q' <(touch /tmp/envoy.log && tail -F /tmp/envoy.log) name: 'Check upload succeeded' @@ -124,12 +124,12 @@ jobs: name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/objective-c/hello_world:app + run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/objective-c/hello_world:app name: 'Build objective-c app' # Run the app in the background and redirect logs. - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/objective-c/hello_world:app &> /tmp/envoy.log & + run: ./bazelw run --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/objective-c/hello_world:app &> /tmp/envoy.log & name: 'Run objective-c app' - run: sed '/received headers with status 200/q' <(touch /tmp/envoy.log && tail -F /tmp/envoy.log) name: 'Check connectivity' diff --git a/.github/workflows/ios_tests.yml b/.github/workflows/ios_tests.yml index 1930cf27c3..d13aaba7a5 100644 --- a/.github/workflows/ios_tests.yml +++ b/.github/workflows/ios_tests.yml @@ -31,4 +31,4 @@ jobs: if: steps.check_context.outputs.run_tests == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bazelisk test --test_output=all --config=ios --build_tests_only --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/swift/... + run: ./bazelw test --test_output=all --config=ios --build_tests_only --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/swift/... diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 9c2b09380e..1c7ce932db 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -32,7 +32,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - bazel test \ + ./bazelw test \ --action_env=LD_LIBRARY_PATH \ --test_output=all \ --config=remote-ci-linux \ diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml index c7d1a75e78..d305c7801b 100644 --- a/.github/workflows/tsan.yml +++ b/.github/workflows/tsan.yml @@ -41,7 +41,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: steps.check_context.outputs.run_tests == 'true' run: | - bazel test --test_output=all \ + ./bazelw test --test_output=all \ --test_env=ENVOY_IP_TEST_VERSIONS=v4only \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ --config=remote-ci-linux-tsan \ diff --git a/bazelw b/bazelw new file mode 100755 index 0000000000..e9e44c76fd --- /dev/null +++ b/bazelw @@ -0,0 +1,38 @@ +#!/bin/bash + +set -euo pipefail + +readonly bazelisk_version="1.10.1" +if [[ $OSTYPE == darwin* ]]; then + # TODO: Support M1 once https://github.com/envoyproxy/envoy/issues/16482 + readonly bazel_platform="darwin-amd64" + readonly bazel_version_sha="e485bbf84532d02a60b0eb23c702610b5408df3a199087a4f2b5e0995bbf2d5a" +else + readonly bazel_platform="linux-amd64" + readonly bazel_version_sha="4cb534c52cdd47a6223d4596d530e7c9c785438ab3b0a49ff347e991c210b2cd" +fi + +readonly bazel_version_url="https://github.com/bazelbuild/bazelisk/releases/download/v$bazelisk_version/bazelisk-$bazel_platform" +script_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +readonly bazelisk="$script_root/tmp/bazel/versions/bazelisk-$bazelisk_version-$bazel_platform" + +if [[ ! -x "$bazelisk" ]]; then + echo "Installing bazelisk..." >&2 + mkdir -p "$(dirname "$bazelisk")" + + download_bazelisk() { + curl --fail -L --retry 5 --retry-connrefused --silent --progress-bar \ + --output "$bazelisk" "$bazel_version_url" + } + + download_bazelisk || download_bazelisk + if echo "$bazel_version_sha $bazelisk" | shasum --check --status; then + chmod +x "$bazelisk" + else + echo "Bazelisk sha mismatch" >&2 + rm -f "$bazelisk" + exit 1 + fi +fi + +exec "$bazelisk" "$@" diff --git a/docs/root/development/debugging/android_local.rst b/docs/root/development/debugging/android_local.rst index eba4e59507..061e2b593f 100644 --- a/docs/root/development/debugging/android_local.rst +++ b/docs/root/development/debugging/android_local.rst @@ -56,7 +56,7 @@ With the project ready, you can now start debugging with Android Studio. For example: :: - $ bazelisk build android_dist --config=android --fat_apk_cpu=x86 -c dbg + $ ./bazelw build android_dist --config=android --fat_apk_cpu=x86 -c dbg Android supported archs are `arm64_v8a`, `armeabi-v7a`, `x86`, `x86_64`. diff --git a/docs/root/development/performance/binary_size.rst b/docs/root/development/performance/binary_size.rst index 204bfb66c0..c509422d7d 100644 --- a/docs/root/development/performance/binary_size.rst +++ b/docs/root/development/performance/binary_size.rst @@ -63,7 +63,7 @@ necessary tools:: The binary being compiled is ``//test/performance:test_binary_size``. The binary is getting built with the following build command:: - bazelisk build //test/performance:test_binary_size --config=sizeopt --copt=-ggdb3 --linkopt=-fuse-ld=lld + ./bazelw build //test/performance:test_binary_size --config=sizeopt --copt=-ggdb3 --linkopt=-fuse-ld=lld Thus the binary is compiled with the following flags pertinent to reducing binary size: diff --git a/docs/root/development/performance/cpu_battery_impact.rst b/docs/root/development/performance/cpu_battery_impact.rst index 322354ed04..9989a9ed32 100644 --- a/docs/root/development/performance/cpu_battery_impact.rst +++ b/docs/root/development/performance/cpu_battery_impact.rst @@ -86,9 +86,9 @@ Modified versions of the "hello world" example apps were used to run these exper Getting the build: -1. Build the library using ``bazelisk 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`` +1. Build the library using ``./bazelw build android_dist --config=android --fat_apk_cpu=armeabi-v7a`` +2. Control: ``./bazelw mobile-install //examples/kotlin/control:hello_control_kt`` +3. Envoy: ``./bazelw mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=armeabi-v7a`` Battery usage experiment steps: diff --git a/docs/root/development/performance/device_connectivity.rst b/docs/root/development/performance/device_connectivity.rst index 27771963cc..4875eb6370 100644 --- a/docs/root/development/performance/device_connectivity.rst +++ b/docs/root/development/performance/device_connectivity.rst @@ -72,7 +72,7 @@ Android configuration 2. Build and run the example app: -``bazelisk mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=armeabi-v7a`` +``./bazelw mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=armeabi-v7a`` ~~~~~~~~~~~ Open issues diff --git a/docs/root/development/testing/testing.rst b/docs/root/development/testing/testing.rst index ac7b7bfc6f..be3cae5c20 100644 --- a/docs/root/development/testing/testing.rst +++ b/docs/root/development/testing/testing.rst @@ -23,7 +23,7 @@ Common (C/C++) tests To run the entire C/C++ test suite locally, use the following Bazel command: -``bazelisk test --test_output=all //test/common/...`` +``./bazelw test --test_output=all //test/common/...`` ---------- Java tests @@ -31,7 +31,7 @@ Java tests To run the entire Java unit test suite locally, use the following Bazel command: -``bazelisk test --test_output=all --build_tests_only //test/java/...`` +``./bazelw test --test_output=all --build_tests_only //test/java/...`` ------------ Kotlin tests @@ -39,7 +39,7 @@ Kotlin tests To run the entire Kotlin unit test suite locally, use the following Bazel command: -``bazelisk test --test_output=all --build_tests_only //test/kotlin/...`` +``./bazelw test --test_output=all --build_tests_only //test/kotlin/...`` ----------- Swift tests @@ -47,7 +47,7 @@ Swift tests To run the entire Swift unit test suite locally, use the following Bazel command: -``bazelisk test --config=ios --test_output=all --build_tests_only //test/swift/...`` +``./bazelw test --config=ios --test_output=all --build_tests_only //test/swift/...`` -------- Coverage diff --git a/docs/root/development/tools/intellij.rst b/docs/root/development/tools/intellij.rst index 47dd69de00..16ad06be76 100644 --- a/docs/root/development/tools/intellij.rst +++ b/docs/root/development/tools/intellij.rst @@ -10,10 +10,9 @@ Using IntelliJ with Envoy Mobile To get started using IntelliJ with Envoy Mobile: -1. Locally install `Bazel `_ -2. Download a supported `IntelliJ version `_ supported by the Bazel plugin -3. Apply local hacks to make IntelliJ work using the branch `hack-for-intellij `_ -4. Open up the Envoy Mobile project using the Bazel import project wizard +1. Download a supported `IntelliJ version `_ supported by the Bazel plugin +2. Apply local hacks to make IntelliJ work using the branch `hack-for-intellij `_ +3. Open up the Envoy Mobile project using the Bazel import project wizard Known issues diff --git a/docs/root/development/tools/tulsi.rst b/docs/root/development/tools/tulsi.rst index f9dc8c7173..b90b045e35 100644 --- a/docs/root/development/tools/tulsi.rst +++ b/docs/root/development/tools/tulsi.rst @@ -19,7 +19,7 @@ To get started using Tulsi with Envoy Mobile: 1. Download and `install Tulsi `_ 2. Open the :repo:`envoy-mobile.tulsiproj ` file -3. From the ``Packages`` tab, click ``Bazel..`` and select the ``bazelw`` binary from at the root of the Envoy Mobile directory (to ensure you're building with the local version of Bazel) +3. From the ``Packages`` tab, click ``Bazel..`` and select the ``bazelw`` binary from at the root of the Envoy Mobile directory (to ensure you're building with the correct version of Bazel) 4. Click on the ``Configs`` tab in Tulsi, and click ``Generate`` 5. Open up the Xcode project, and build diff --git a/docs/root/start/building/building.rst b/docs/root/start/building/building.rst index 164df6bf32..2bf9d8faf1 100644 --- a/docs/root/start/building/building.rst +++ b/docs/root/start/building/building.rst @@ -24,8 +24,9 @@ Bazel requirements Envoy Mobile is compiled using the version of Bazel specified in the :repo:`.bazelversion <.bazelversion>` file. -To simplify build consistency across environments, bazelisk is used. -Follow `these Envoy instructions `_ to install bazelisk as bazel. +To simplify build consistency across environments, the `./bazelw` script manages +using the correct version. Instead of using `bazel build ...` use `./bazelw build ...` +for all bazel commands. -------------------- Java requirements @@ -67,7 +68,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 ` file of the repo, and may be run locally: -``bazelisk build android_dist --config=android --fat_apk_cpu=`` +``./bazelw build android_dist --config=android --fat_apk_cpu=`` Upon completion of the build, you'll see an ``envoy.aar`` file at :repo:`dist/envoy.aar `. @@ -80,7 +81,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: -``bazelisk build android_dist --config=release-android --fat_apk_cpu=x86,armeabi-v7a,arm64-v8a`` +``./bazelw 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. @@ -93,7 +94,7 @@ iOS static framework Envoy Mobile supports being compiled into a ``.framework`` for consumption by iOS apps. This command is defined in the main :repo:`BUILD ` file of the repo, and may be run locally: -``bazelisk build ios_dist --config=ios`` +``./bazelw build ios_dist --config=ios`` Upon completion of the build, you'll see a ``Envoy.framework`` directory at :repo:`dist/Envoy.framework `. @@ -107,7 +108,7 @@ 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-ios`` option, along with the architectures for which the artifact is being built: -``bazelisk build ios_dist --config=release-ios --ios_multi_cpus=i386,x86_64,armv7,arm64`` +``./bazelw build ios_dist --config=release-ios --ios_multi_cpus=i386,x86_64,armv7,arm64`` For a demo of a working app using this artifact, see the :ref:`hello_world` example. @@ -171,7 +172,7 @@ Android To deploy Envoy Mobile's aar to your local maven repository, run the following commands:: # To build Envoy Mobile. --fat_apk_cpu takes in a list of architectures: [x86|armeabi-v7a|arm64-v8a]. - bazelisk build android_dist --config=android --fat_apk_cpu=x86 + ./bazelw build android_dist --config=android --fat_apk_cpu=x86 # To publish to local maven. dist/sonatype_nexus_upload.py --files dist/envoy.aar dist/envoy-pom.xml --local diff --git a/docs/root/start/examples/hello_world.rst b/docs/root/start/examples/hello_world.rst index ad5c9996f7..3ec06d4e5c 100644 --- a/docs/root/start/examples/hello_world.rst +++ b/docs/root/start/examples/hello_world.rst @@ -23,7 +23,7 @@ Next, make sure you have an Android simulator running. Run the :repo:`sample app ` using the following Bazel build rule: -``bazelisk mobile-install //examples/java/hello_world:hello_envoy --fat_apk_cpu=`` +``./bazelw mobile-install //examples/java/hello_world:hello_envoy --fat_apk_cpu=`` You should see a new app installed on your simulator called ``Hello Envoy``. Open it up, and requests will start flowing! @@ -38,7 +38,7 @@ Next, make sure you have an Android simulator running. Run the :repo:`sample app ` using the following Bazel build rule: -``bazelisk mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=`` +``./bazelw mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=`` You should see a new app installed on your simulator called ``Hello Envoy Kotlin``. Open it up, and requests will start flowing! @@ -51,7 +51,7 @@ First, build the :ref:`ios_framework` artifact. Next, run the :repo:`sample app ` using the following Bazel build rule: -``bazelisk run //examples/objective-c/hello_world:app --config=ios`` +``./bazelw run //examples/objective-c/hello_world:app --config=ios`` This will start a simulator and open a new app. You should see requests start flowing! @@ -63,6 +63,6 @@ First, build the :ref:`ios_framework` artifact. Next, run the :repo:`sample app ` using the following Bazel build rule: -``bazelisk run //examples/swift/hello_world:app --config=ios`` +``./bazelw run //examples/swift/hello_world:app --config=ios`` This will start a simulator and open a new app. You should see requests start flowing!