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

Kotlin annotation Processing #15

Open
lswith opened this issue May 25, 2017 · 9 comments
Open

Kotlin annotation Processing #15

lswith opened this issue May 25, 2017 · 9 comments

Comments

@lswith
Copy link

lswith commented May 25, 2017

Is there any support for something similar to the java_plugin rule? I would like to use kotlin with dagger2 and require that the kotlin rules plug in to the kapt functionality.

@pcj
Copy link
Contributor

pcj commented May 25, 2017

Not at the moment, but great idea. Can you provide an example with gradle or similar how you are using it?

@lswith
Copy link
Author

lswith commented May 26, 2017

here is an example of how they are using it with Dagger2 and java.

https://github.com/simonhorlick/bazel-dagger-example/

@plumpy
Copy link
Contributor

plumpy commented Jun 6, 2017

I'm working on this, but it'll require a patch to Bazel (and then a Bazel release). Right now you can't access the exported_plugins of a java_library from skylark.

@lswith
Copy link
Author

lswith commented Jul 12, 2017

@plumpy any updates?

@plumpy
Copy link
Contributor

plumpy commented Jul 14, 2017

I believe bazelbuild/bazel@c00ec98 adds the info needed to make this work. I'll see if I can carve out some time to figure out how to apply that to the kotlin rules. You won't really be able to use it until that commit ships in (presumably) Bazel 0.6.0.

@jgavris
Copy link

jgavris commented Jul 11, 2018

Has anyone thought about this recently? I've yet to try but am spinning up a bazel kotlin project right now.

@plumpy
Copy link
Contributor

plumpy commented Jul 11, 2018

jgarvis: Bazel has official Kotlin rules now: https://github.com/bazelbuild/rules_kotlin

I haven't used them personally, but I believe they support annotation processors.

@jgavris
Copy link

jgavris commented Jul 11, 2018

I was reading this and assuming I'd have to do a fair amount of legwork to use those rules on android.

bazelbuild/rules_kotlin#58 (comment)

@Paul-McNeice
Copy link

Paul-McNeice commented Jul 29, 2018

@jgavris I'm in the same spot as you are right now.

This issue bazelbuild/bazel#5691 was raised by one of the guys that maintains the offical rules_kotlin repo so it sounds like they're working on it at the moment.

I'm just hanging tight for a while to see what happens. By the time I've figured out how to write the macros needed they'll probably already be available...

I think part of the delay is that they're migrating the native android rules out of core Bazel repo into this one (as skylark rules) https://github.com/bazelbuild/rules_android

I guess once that's done the android_binary rule will be easier to extend to accept kotlin code as a dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants