Add Kotlin Android support
Created by: dsyang
Vanilla kotlin library support was added in https://github.com/facebook/buck/pull/810. the next big step would be to add android support.
From @bkase's comment on https://github.com/facebook/buck/pull/810#issuecomment-238069818 it looks like the problem is we need the equivalent of android_library()
for kotlin. I think that could be pretty straight-forward.
We would need create a new AndroidKotlinLibraryDescription
that behaves almost exactly like AndroidLibraryDescription
excepts it compiles with kotlinc instead of javac.
A quick look through the source code suggests we'd need to do the following:
-
Refactor AndroidLibrary
to take in aBaseCompileToJarStepFactory
(it currently defaults to javac) -
Copy AndroidLibraryDescription
into aAndroidKotlinLibraryDescription
. Basically doing the same thing except passing inKotlincToJarStepFactory
to theAndroidLibrary
-
Refactor the common stuff out of the two android library descriptions.
I'm not sure when I'll have time to tackle this yet. If someone else wants to take a shot go for it!