-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compose Preview Support #6315
Open
idanakav
wants to merge
11
commits into
bazelbuild:google
Choose a base branch
from
idanakav:idanakav/compose-preview
base: google
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Compose Preview Support #6315
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add DefaultMavenArtifactLocator - Update BlazeClassJarProvider to return all of the external libraries in the workspace module case We now read all of the dependencies in the workspace module case
Android assets are expected to be routed to Android Studio through `NamedIdeaSourceProvider::withAssetsDirectoryUrls` in order to be loaded later on by `StudioAssetFileOpener` which is used by Compose Preview.
RenderErrorContributor.Provider has moved to the designer plugin in: https://cs.android.com/android-studio/platform/tools/adt/idea/+/828c198fe850b7d2d6a7696bd095360a0c5c070d
A new `ClassFileFinder` inspired by `RenderJarClassFileFinder`. This finder uses binary target dependencies to locate the class file and is better optimized for large projects.
Also related: #6086 |
sgowroji
added
type: feature request
product: Android Studio
Android Studio plugin
awaiting-maintainer
Awaiting review from Bazel team on issues
labels
Mar 23, 2024
sgowroji
added
awaiting-user-response
Awaiting response from author on PRs
and removed
awaiting-maintainer
Awaiting review from Bazel team on issues
labels
Mar 28, 2024
@idanakav Could you please take a look at the failing checks? |
Summary: The new logic will improve the fqcn lookups when no binary targets are listed in the project view. For example, previously, we only checked for the package name cache for binary targets. Test Plan: 1. ``` bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-oss-latest-stable INFO: Found 1 target... Target //aswb:aswb_bazel_zip up-to-date: bazel-bin/aswb/aswb_bazel.zip INFO: Elapsed time: 45.834s, Critical Path: 16.35s INFO: 15 processes: 1 internal, 9 darwin-sandbox, 5 worker. INFO: Build completed successfully, 15 total actions ``` 2. Verify the Compose preview works with no binary targets are added in the project view, previously they would timeout Reviewers: #ldap_go-code-admin, #ldap_ide-team, #ldap_java-devx, #ldap_mobile-platform-android, oliviern Reviewed By: #ldap_mobile-platform-android, oliviern Revert Plan: Revert diff JIRA Issues: MOBDROID-5587 Differential Revision: https://code.uberinternal.com/D13499555
Summary: In the last lookup, we need to iterate all of the jars/target keys. Test Plan: bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-oss-latest-stable Reviewers: #ldap_go-code-admin, #ldap_ide-team, #ldap_java-devx, #ldap_mobile-platform-android, oliviern Reviewed By: #ldap_mobile-platform-android, oliviern Revert Plan: Revert diff JIRA Issues: MOBDROID-5587 Differential Revision: https://code.uberinternal.com/D13569575
any updates on this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting-user-response
Awaiting response from author on PRs
product: Android Studio
Android Studio plugin
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2765
Add support for Compose Preview in Android Studio, main changes are:
ClassFileFinder
, optimized for faster class lookupsTested with the latest stable version, Iguana (23.2), it scales well even for our larger apps, I also did a sanity test and got the preview working in the compose sample in rules kotlin.
Known gaps:
Possible future improvements:
BinaryTargetClassFileFinder
, perhaps storing a map of package name -> target keys during sync could help