gradle-nbm-plugin icon indicating copy to clipboard operation
gradle-nbm-plugin copied to clipboard

[Workaround] Annotated Kotlin classes aren't added to generated-layer.xml

Open SerVB opened this issue 5 years ago • 4 comments

I see there are generated .classes from Kotlin files in the generated jar but there is no info about these classes in the generated-layer.xml.

I guess the problem is because the JavaPlugin is used in that method:

https://github.com/radimk/gradle-nbm-plugin/blob/e943560a766d85492f972e199eaee2c131a56ebc/plugin/src/main/groovy/org/gradle/plugins/nbm/NbmPlugin.groovy#L30-L33

Maybe I will find some time to investigate better and send a PR.

Workaround I use for now: monotonously register my classes in the layer.xml 😊

SerVB avatar Apr 28 '19 14:04 SerVB

I miss what is the expected behavior. An example where you can demonstrate what you're doing and what error or lack of functionality you see would help.

radimk avatar Apr 29 '19 06:04 radimk

OK, will provide a repo with the problem demo in two days.

SerVB avatar Apr 29 '19 08:04 SerVB

Managed sooner. Please check it out: https://github.com/SerVB/gradle-nbm-plugin/tree/sample-kotlin/samples/standalone-kotlin.

The sample you provide (sample:standalone): image

My sample is the same, just converted classes to Kotlin (sample:standalone-kotlin): image

So you see annotation version isn't applied. It's because Kotlin annotated classes aren't added to generated-layer.

Expected behavior is the same as for Java sample because the code is literally the same.

SerVB avatar Apr 29 '19 20:04 SerVB

I've deleted my fork. You can create sample:standalone-kotlin by simply converting Java classes to Kotlin (via IDEA, for example), if you want to reproduce.

SerVB avatar May 22 '19 12:05 SerVB