Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Are there plans to make a kt_android_library rule? #58

Closed
grandstaish opened this issue Apr 30, 2018 · 9 comments
Closed

Are there plans to make a kt_android_library rule? #58

grandstaish opened this issue Apr 30, 2018 · 9 comments

Comments

@grandstaish
Copy link

grandstaish commented Apr 30, 2018

The current rules seem to be limited to the jvm so they can't be used for building an Android lib. Is a kt_android_library rule something you want but haven't done yet, or is this not the right direction at all?

@Paul-McNeice
Copy link

+1

I have a large Android project with 30+ modules which contain mixed Java and Kotlin source. At the moment we build with Gradle but the option to adopt Bazel would be great :)

@hsyed
Copy link
Contributor

hsyed commented Jun 29, 2018

Android should work you will need to write some macros for your project. Basically you build a kotlin jar useing the rules here and you then glue / wrap them into the android rules. In the grand scheme of things writing these macros is a small amount of work in setting up a mono repo with bazel.

I would love to work on this to provide “official” android support but I need support from Google (@davidstanke) on this one as it is a significant amount of time and we don’t use android internally. Google is best placed to design the structure of these rules / macros for the long term.

Integration tests would be required and depending on how the rules are designed some changes might be needed in the android rules in bazel core.

@davidstanke
Copy link
Contributor

Hey hey! I've actually moved to a slightly different role at Google, so IDK if I can do anything "official" here. :) + @jin for thoughts!

@Paul-McNeice
Copy link

@hsyed thanks for your reply - I'll have to do some reading into writing Bazel macros to achieve this, I'm not particularly familiar with Bazel to begin with so we'll see how well that goes :)

We're using kapt as well which I gather is another complication!

@hsyed
Copy link
Contributor

hsyed commented Jun 29, 2018

@Pmcneice kapt is supported and far more consistent than the plugins in Gradle which can stop working randomly between releases and or how the gradle daemon started up. It works reliably and works in mixed mode compiles as well.

See the example app and the tests.

@jin
Copy link
Member

jin commented Jun 29, 2018

@davidstanke thanks for the ping! Let me sync up with the maintainers of https://github.com/bazelbuild/rules_android and see what the plans are for Kotlin Android rules.

@jin
Copy link
Member

jin commented Jun 29, 2018

The rules_android and Bazel maintainers are fully invested into migrating the native Android rules out of the Bazel source tree and into their Skylark implementations, and unfortunately we don't have the free cycles to work on kt_android_library. The good news is that once we have the Android rules in Skylark, extending them would be a lot simpler than it is currently.

@hsyed
Copy link
Contributor

hsyed commented Aug 14, 2018

#117 done.

@hsyed hsyed closed this as completed Aug 14, 2018
@Paul-McNeice
Copy link

I've been following this closely - I'm excited :) Thanks for all the hard work.

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

No branches or pull requests

5 participants