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 rules and android. #4535

Closed
hsyed opened this issue Jan 29, 2018 · 4 comments
Closed

kotlin rules and android. #4535

hsyed opened this issue Jan 29, 2018 · 4 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team

Comments

@hsyed
Copy link

hsyed commented Jan 29, 2018

I'm working on new bazel rules for Kotlin and an extension to the intellij plugin. The android rules in 0.8.1 are not accepting jars built from the Kotlin rules. The kotlin_library rule return a JavaInfo provider, and I was expecting the android rules to just accept JavaInfo.

These rules might be upstreamed into the bazelbuild org soon (@davidstanke). I don't do any android development myself so it would be good if someone can take charge of the android facet of the rules.

There is more info here hsyed/rules_kotlin#8.

@meteorcloudy
Copy link
Member

/cc @aj-michael Any idea on this? Thanks!

@aj-michael
Copy link
Contributor

Hi @hsyed. Regarding "I was expecting the android rules to just accept JavaInfo" - unfortunately that is not the case. I believe it should be the case, but noone has done the work to make it so.

As a workaround, you can just wrap your jar in one of the rules that Android does accept. In particular, you could create a java_library with no sources that exports your kotlin_library. And then depend on that from the android_* rules.

If someone were to take charge of the android facet of the kotlin rules, I would be happy to advise. However, I don't think I currently have the bandwidth to do it myself.

@aj-michael aj-michael added category: rules > android P2 We'll consider working on this in future. (Assignee optional) labels Jan 29, 2018
@hsyed
Copy link
Author

hsyed commented Jan 29, 2018

@aj-michael that pattern would work as a work around for now -- pubref/rules_kotlin uses this pattern in a macro layer.

I don't think such a macro layer should be introduced in the new rules. If we added such macros they would need to be integration tested in the Kotlin rules repo and it will also make developing new features more complicated (--e.g., Kapt).

Until JavaInfo is recognised by the Android rules some examples could be added to the Kotlin rules repo illustrating the workaround.

@hsyed
Copy link
Author

hsyed commented Aug 13, 2018

Android support has landed. Closing this.

@hsyed hsyed closed this as completed Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team
Projects
None yet
Development

No branches or pull requests

4 participants