-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add Android data binding support #2694
Comments
Update: we're making internal progress on this change and can start exposing further hooks in Bazel likely over the next week. This still won't be functional though without having the data binding libraries checked into appropriate places in your repo. Anyone interested in experimenting with this earlier, and willing to play around with checking in the data binding libraries themselves, report here and we're glad to work through the process with you. |
…ary. Before this change Bazel was adding this implicitly. But that wasn't working properly with --incremental_dexing. And that implementation is a lot messier and bug-prone vs. just including it as a standard dependency. Issue: #2694 PiperOrigin-RevId: 152956638
The logic is already in Bazel but wasn't available to build rules. This change makes it available, but still requires data binding's {build|run}time libraries to be checked into appropriate depot spots for everything to work. Followup changes will make those libraries easily available. Issue: #2694 PiperOrigin-RevId: 153359861
Update: After a discussion with @gregestren we've determined that we need to update the |
#2694 Change-Id: I33e1c1a6c1f1c4b31227eb26b0deed09525a7ec7
Also, add a fake databinding processor target. Bazel users will need to do something like this: # WORKSPACE local_repository( name = "databinding", path = "./databinding", ) bind( name = "databinding_annotation_processor", actual = "@databinding//:annotation_processor", ) # databinding/BUILD java_plugin( name = "annotation_processor", ... ) ... #2694 RELNOTES: None PiperOrigin-RevId: 175975110
It looks like there has been various commits in relation to this issue since the last comment - just wondering how close we are to having databinding support up and running? |
Paul, As Jin referenced above, @ahumesky is the current point of contact for data binding support. He's working through a number of technical issues about it at the moment and can give you the clearest expectations. |
We're working to upgrade databinding in bazel to the latest version to support androidx / jetpack, as well as make depending on databinding easier. We've also found some bugs with databinding + android_instrumentation_test. We hope to have these issues sorted out in the next couple of weeks. |
Hey @ahumesky, any update on the status of this? |
This was interrupted by a few little urgent issues, but those are done and we're back to work on this. I hope to have v2 working this week, then I plan to make getting the databinding dependencies working with the android rules easier (today you have to manually wire up the databinding dependencies). |
Hey, I am trying to convert a project to Bazel using databindings. Is there any progress on this? Even a hacky workaround would help me a lot until it's officially working. |
There has been significant progress, I have databinding v2 working, and I'm in the process of getting all the code reviewed and submitted. Should be in in the next couple of days. You're seeing an NPE probably because the databinding dependencies need to be added to the rules with databinding enabled (it shouldn't give an NPE for that though, that's a bug in itself). I'm also working to make getting the databinding dependencies easier. The main problem right now is that our gmaven repo for android dependencies is incomplete (databinding depends on things that are hosted outside gmaven). It would be better to use something like bazel-deps to generate the rules for these dependencies, but bazel-deps does not support AARs. |
Thanks for the update. That sounds good! I tried adding
As a dependency but it had no effect. Probably it's wrong anyway. Do you have a sample on how to add the dependency correctly? I could adapt that to my local installation. Right now I don't even know which library is the correct one. And the only one I found is the one in the SDK. |
This is the NPE when setting
I tried setting |
@ahumesky Hi |
The current state of things is:
|
#2694 RELNOTES: None PiperOrigin-RevId: 309327526
1. Updates databinding to v3.4.0 2. Updates gson to 2.8.0 3. All other libraries are added Necessary for #2694. Partial commit for third_party/*, see #11629. Signed-off-by: Philipp Wollermann <[email protected]>
Hi all,
The |
One correction: the |
For those who are trying the workaround above, instead of building
|
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
I believe the major issues here are addressed in the latest databinding support. If there are still issues here, the native Android rules have been deleted and migrated to Starlark in https://github.com/bazelbuild/rules_android, so please feel free to open an issue there. |
Bazel already has internal support for Android data binding (e.g. here). But hooks haven't been exposed to link this to the SDK support libraries or toggle the feature on for android_binary / android_library rules.
This bug tracks the effort to make data binding end-user usable.
The text was updated successfully, but these errors were encountered: