-
Notifications
You must be signed in to change notification settings - Fork 269
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
Form class instrumentation is not run for Kotlin code #171
Comments
I've taken a closer look at this. The root issue seems to be that
It works when I add a dependency on tasks.classes.dependsOn 'compileKotlin' |
Hi @Minecrell, Thank you for investigation. The fix will appear in Nevertheless, it's not recommended to use form designer with kotlin. It doesn't work properly anyway. Please consider using layout.kt instead. |
Hi @zolotov, Thank you for the fix. It works now, but only if the Kotlin Gradle plugin is applied before This change fixes it for my test project: https://github.com/Minecrell/intellij-test/commit/7539c4be67c2c9492aa7f61ec29b583bef25a89e It doesn't work if it's applied as part of the |
Yes, I noticed this too and I didn't think of something that I can do with this, sorry |
@zolotov Do you really need to check if they are one of the dependencies of the |
Nevermind, I just saw 63f0780 |
@Minecrell I'm not sure about 63f0780. Maybe this fix also breaks that commit. Feel free to investigate this and make a PR. |
Looks like I have to revert the change. Resolving transitive dependencies of compile tasks leads to evaluating nested projects which weren't evaluated yet. And this breaks multi-module projects. So, I'm afraid you have to add |
Not sure how to fix it on the side of
|
@zolotov I've actually run into an error like #77 today so I'm pretty sure this is broken again since #116. (And it's not actually related to the instrumentation of Kotlin classes, it happened for a Java class.) In any case, I'm not sure if there is a simple solution: On the one hand we need to instrument the classes as part of the actual compile task using |
Using gradle-intellij-plugin 0.2.0+ (I've tested 0.2.0 and 0.2.1), the form class instrumentation is not run for Kotlin code for me.
I've created a simple test project where I can reproduce the problem: https://github.com/Minecrell/intellij-test
It has a few Java, Groovy and Kotlin sources and a form component in the Kotlin source set: https://github.com/Minecrell/intellij-test/tree/master/src/main/kotlin/net/minecrell/test
To reproduce this problem I'm running
gradle clean runIdea
:Using gradle-intellij-plugin 0.1.10 everything works correctly, however using 0.2.1 I get an error at runtime (which means that the form class instrumentation has not processed the Kotlin class):
In the Gradle log there is the following warning once for
:compileJava
and once for:compileGroovy
(but not for:compileKotlin
):Running gradle with the info flag suggests that it is not actually run for the Kotlin task:
Compiling forms and instrumenting code with nullability preconditions
appears only twice in the log, after:compileJava
and:compileGroovy
but not after:compileKotlin
.The text was updated successfully, but these errors were encountered: