Sonar-Kotlin-Plugin: some slang-api classes are missing in the built jar file, while they are there in the slang-api.jar

Dear All,

I found there are some missing classes in the packaged sonar-koltin-plugin.jar, but they are there in the slang-api.jar, same code base.

In the published mvn repo one (Nov 2020), sonar-kotlin-plugin-1.8.1.1804.jar, go to sonar-kotlin-plugin-1.8.1.1804.jar\org\sonarsource\slang\impl\, you will not find the file FunctionInvocationTreeImpl.class which is created on 2019-08 as shown from the git history. There are also other classes missing like the MemberSelectTreeImpl etc.

I pulled the latest slang source codes, and build on my local, and I can see these missing classes are compiled in the slang-api.jar itself, but not in the compiled sonar-kotlin-plugin.jar.

Silly I couldn’t figure out why, could someone help check here?

Hi @testmynamelist,

Thanks for your message. This could happen due to minimize { } section in shadowJar command because mentioned classes are not used in the plugin. We’re doing this to make our plugins as small as possible.

Regards,
Margarita

Hi @Margarita_Nedzelska,

Yes you are right! I can see the missing classes after commented the minimize line, though the size is really large now. Anyway I know the cause now, thank you very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.