tree: b73ef2a70a4c5e17d58efee7193d48468fdbb382 [path history] [tgz]
  1. aspect/
  2. aswb/
  3. base/
  4. build_defs/
  5. codeinsight/
  6. common/
  7. cpp/
  8. dart/
  9. java/
  10. kotlin/
  11. plugin_api/
  12. proto/
  13. python/
  14. querysync/
  15. shared/
  16. skylark/
  17. terminal/
  18. testing/
  19. third_party/
  20. tools/
  21. vcs/
  22. .gitignore
  23. android.bzl
  24. BUILD
  25. build-visibility.bzl
  26. CHANGELOG
  27. LICENSE
  28. OWNERS
  29. platforms.bzl.OSS
  30. README.md
  31. version.bzl
aswb/README.md

Android Studio Plugin for Bazel Projects

An open-sourced Android Studio plugin for Bazel projects useful to import, develop and run Bazel projects within Android Studio.

Detailed usage instructions are available here.

Plugin Releases

The Android Studio with Bazel (ASwB) Plugin is uploaded to JetBrains Marketplace. Users can download it from there and manually install it or directly get it from the IDE by going to Settings -> Plugins -> Marketplace, and searching for Bazel.

Note: Starting from Android Studio 2024.2, Android Studio with Bazel plugin will be released from this project instead of https://github.com/bazelbuild/intellij/tree/google

Plugins compatible with Stable versions of Android Studio are released to the Stable channel. The Beta channel is for plugins compatible with Canary and Beta versions of Android Studio are released to the. Ways to install from the Beta channel:

  • download and install them manually from the Beta channel page on JetBrains Marketplace.

  • add the Beta channel to the IDE by navigating to Settings -> Plugins -> Gear Icon -> Manage Plugin repositories and adding https://plugins.jetbrains.com/plugins/beta/9185.

Compatibility with Android Studio

The version of the Android Studio with Bazel (ASwB) plugin will be the same as the build number of the Android Studio build it supports. For example, ASwB plugin version 12480590 is built for Android Studio AI-242.23339.11.2422.12480590.

Build Plugin From Source

Building the ASwB plugin from this project requires some changes to the cloned repository because some of its dependencies are not publically available on AOSP.

  1. Clone the repository:

    repo init --partial-clone -b studio-main -u https://android.googlesource.com/platform/manifest
    repo sync -c -j8
    
  2. Checkout the branch/tag of the Android Studio release for which you want to build the plugin. List of branches/tags can be found here.

    repo forall -c git checkout {{release_branch}}
    
  3. Modify tools/adt/idea/aswb/platforms.bzl.OSS to download the required version of Android Studio platform.

  4. Copy tools/adt/idea/aswb/platforms.bzl.OSS to tools/base/intellij-bazel/platforms.bzl to be picked up by the WORKSPACE.

  5. Create directory tools/vendor/google/aswb/plugin_api and copy tools/adt/idea/aswb/plugin_api/BUILD.OSS to tools/vendor/google/aswb/plugin_api/BUILD to set up the plugin API targets that the ASwB plugin depends on.

  6. You can now build the Android Studio with Bazel plugin via

    bazel build //tools/adt/idea/aswb/aswb:aswb_bazel_zip --config=without_vendor --@//tools/base/intellij-bazel:intellij_platform=my_android_studio
    

    This will create a plugin zip file at bazel-bin/tools/adt/idea/aswb/aswb/aswb_bazel.zip, which can be installed directly to the IDE.