tree: 0cd5636810da29c928f0438ae6eb99ab728cf2fe [path history] [tgz]
  1. codesign/
  2. ijverifier/
  3. searchable-options/
  4. tests/
  5. BUILD
  6. check_plugin.py
  7. OWNERS
  8. README.md
  9. stamper.py
  10. studio.bzl
  11. studio.iml
  12. tools_test.py
  13. update_sdk.py
studio/README.md

Opening Android Studio in the IDE

  • Open the project in //tools/adt/idea
  • Set a Path Variable named SDK_PLATFORM for the platform to use:
    • Linux: linux/android-studio
    • Mac: darwin/android-studio/Contents
    • Windows: windows/android-studio
Please note that in order for this Path Variable to take full effect, you need to close and reopen the project

If you are using IntelliJ 2020.2 or earlier, create a template JUnit configuration as described in Running tests using IntelliJ

Updating the platform prebuilts

From go/ab

The official way of updating prebuilts that can be commited to prebuilts/studio/intellij-sdk is to get them from the go/ab target here.

First identify the <bid> you want to update to. If you want to know what is the current build checked in into prebuilts you can look at the METADATA file.

Then you can run the following command:

./tools/adt/idea/studio/update_sdk.py --download <bid>

which will update tools/adt/idea and prebuilts/studio/intellij-sdk with the new prebuilts. Note that if there jars are the same and there are no major version changes, tools/adt/idea won't need to be updated. At this point you are ready to upload the changes for review.

From a locally built platform

In order to locally try changes to the platform, the prebuilts can be rebuilt as follows:

cd $SRC/tools/idea
./build_studio.sh

which will generate a set of artifacts in tools/idea/out/studio/dist. To update the prebuilts with these, run:

$SRC/tools/adt/idea/studio/update_sdk.py --path $SRC/tools/idea/out/studio/dist

Isolated builds

Note that in go/ab the prebuilts are built on a separate checkout to ensure that the ant build only has access to a few git repos. If you want to have an isolated check out to build prebuilts you can checkout a separate repo like this:

repo init -u sso://googleplex-android.git.corp.google.com/platform/manifest -b studio-master-dev -m studio-sdk.xml
repo sync -j10

And execute update_sdk.py from the main repo with the path pointing to this isolated checkout.

Building Android Studio

To build Android Studio run

bazel build //tools/adt/idea/studio:android-studio

Searchable Options

IntelliJ has a post-build process to generate an index for things that can be searched in the UI. They perform this operation by running the IDE headless with a “traverseUI” argument. All these generated files are stored in searchable-options and we ensure its consistency via tests.

The test //tools/adt/idea/studio:searchable_options_test ensures that the bundled xmls are up-to-date. If this test fails, its outputs.zip file contains the new .xmls that need to be updated.

Alternatively, running

bazel run //tools/adt/idea/studio:update_searchable_options

Will build the studio bundle, and update the source files with the latest index.

Optimized builds

In order to build all dependencies with c++ optimized builds, stripped binaries, full zip compression, please use

bazel build //tools/adt/idea/studio:android-studio --config=release

Or our remote configuration which also implies release

bazel build //tools/adt/idea/studio:android-studio --config=remote