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 support #8

Closed
rciurkot opened this issue Jul 26, 2016 · 4 comments
Closed

Kotlin support #8

rciurkot opened this issue Jul 26, 2016 · 4 comments

Comments

@rciurkot
Copy link

Hi,
I've tried to use this lib within my Kotlin project - to no avail.
Is it / will it be possible to use Blade with Kotlin? (Kotlin uses kapt instead of aapt)

@FrantisekGazo
Copy link
Owner

FrantisekGazo commented Jul 26, 2016

Hi,
no, this library does not support Kotlin classes. I'm planning to look at it. But I don't have time for it currently.

I don't use Kotlin, so it wasn't that important when I started this library.

If there is somebody who knows how to support kapt or about some open-source library that also supports kapt (from which I can inspire) - please leave a comment. thanks

@rciurkot
Copy link
Author

rciurkot commented Aug 4, 2016

It turns out that Blade and Kotlin can play well together :) You just have to enable generating stubs in kapt.
Put this in your build.gradle and everything should work fine.

kapt {
    generateStubs = true
}

Sometimes build is failing (InstantRun + kotlin incremental builds) but then simple clean-build action will make it work again.

Thanks @FrantisekGazo for such an awesome library :)

@FrantisekGazo
Copy link
Owner

@rciurkot that's great news. Thanks for sharing this solution :)

Blade is using kapt or apt based on found plugin - as you can see here: https://github.com/FrantisekGazo/Blade/blob/master/plugin/src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy. That is code I added when I started the library, but I was expecting that I will have to do something more.

@rciurkot did you try it with pure kotlin app or mixed java/kotlin?

@rciurkot
Copy link
Author

rciurkot commented Aug 8, 2016

Fortunately that line of code (selecting kapt or apt) was enough :)

I use it in mixed java/kotlin project with about 75% codebase in java. Blade is generating its classes for both java and kotlin code.

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

No branches or pull requests

2 participants