Unexpected results from KAnnotator


#1

Hi Gents!

I’m currently using KAnnotator for a Gradle plugin.  I used it to generate annotations for the core api library containing project and the like.  The problem is that my Plugin apply() method was still accepting a Project? parameter (nullable type).  The I noticed with the Kotlin gradle plugin the apply method accepts Project (not a nullable type).  The following annotation allows this:

<item name="org.gradle.api.Plugin void apply(T)">
  <annotation name="jet.runtime.typeinfo.KotlinSignature">
  <val name="value" val="&quot;fun apply(p0 : T) : Unit&quot;" />
  </annotation>
  </item>
This comes from:

https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plugin-core/kotlinAnnotation/org/gradle/api/annotations.xml

But in my generated annotations, this annotation does not exist.  Am I doing something wrong?

Thanks!

-Steve


#2

Okay I'm seeing that idea allows you to add custom Kotlin signatures one at a time to the annotations.  This gave me the result I was looking for.  But it also seems like Kannotator has the option but it won't allow you to select it.  Is there something I'm missing?

-Steve


#3

Inferring @KotlinSignature annotations is not supported by KAnnotator yet