Skip to content
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

When init AndroidIDEInfo, parse the manifest to get the java pacakge name if it is null from the proto. #6558

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ivyspirit
Copy link
Contributor

@ivyspirit ivyspirit commented Jul 9, 2024

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: The resource linking is broken in IDE when custom_package is not set

Description of this change

As described in the issue: If the custom_package = "com.myPackage", is not set when defining a kt_android_library, and if the BUILD file is under the root of your project dir, the rules_kotlin or rules_android will pass a null value to init the IntelljiInfo. This will cause the resource link/preview not working in the IDE.

This change parse the packageName defined in the AndroidManifest.xml when the passed over javaPackage name is null. And use it as the resource package.

After the fix the IDE resource preview worked as expected. And when clicking on the resource from Kotlin code it will link to the resource xml definition, instead of the generated Int.
Screenshot 2024-07-10 at 11 12 53 AM

@ivyspirit ivyspirit changed the title parse the manifest to get the java pacakge name when it is null Parse the manifest to get the java pacakge name when it is null Jul 9, 2024
@ivyspirit ivyspirit marked this pull request as ready for review July 10, 2024 18:42
@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Jul 10, 2024
@ivyspirit ivyspirit changed the title Parse the manifest to get the java pacakge name when it is null When init AndroidIDEInfo, parse the manifest to get the java pacakge name if it is null from the proto. Jul 10, 2024
@ilisc2
Copy link
Contributor

ilisc2 commented Jul 15, 2024

@mai93 do you have a chance to take a look this change. Let me know if you have any questions.

@mai93
Copy link
Collaborator

mai93 commented Jul 18, 2024

Thanks @ivyspirit! The change looks good to me, we are currently trying to move the code for the AS plugin outside of this repository and we cannot accept changes to it at the moment. I will try to import this change once the other repository is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Awaiting review from Bazel team on PRs product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants