-
Notifications
You must be signed in to change notification settings - Fork 18
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 source generation #64
Comments
Correct me if I am mistaken, but as of now Android Gradle Plugin generates Nevertheless I agree with you in general. I was thinking about this kind of optimization before and I am rather inclined to implementing a Kotlin compiler plugin. They speak about Kotlin IR (Intermediate representation), which can be used to represent source code independent of any particular source or target languages. It can be used to enhance/generate byte code directly bypassing java or kotlin sources. The idea was to "inject" static factories right in the implementation classes or so. But that's future if there is time for it... |
Well, for my Kotlin-only modules I disabled If interested, this is how it is done:
Thanks for considering! |
Yeah, I had this optimization too, but it stopped working with AGP 3.3.0. If you don't mind, I'm going to close this issue, because there is no plans for supporting kotlin source generation in the near future. |
Fine for me, I'll have a closer look at build times w/ Magnet enabled and report back here if I stumble upon any issues. |
While Magnet itself is written in Kotlin, it outputs Java code, which is totally fine in general and perfectly interoperable with Java and Kotlin projects.
However, for Kotlin-only projects actually executing
javac
only once and even for very few files adds quite a bit time overhead, especially when there are many modules to compile.It would be very cool if Magnet would get a Kotlin code generating processor so that overhead could be avoided.
The text was updated successfully, but these errors were encountered: