Metainfo generation

I use Spongestart to setup my test server but I think this info is irrelevant. I just want to automatically get the meta info file generated. I use the build task of gradle to build the plugin jar. The plugin has the @Plugin annotation. How do I generate the meta info file?
The docs don’t help me, or I am misunderstanding something.
The plugin main class: here

Thanks for your help! :slight_smile:

Then it shouldn’t require any configuring… SpongeGradle is included by default in the most recent API releases, and should handle this for you. Would you mind uploading the log/output of running the build task?

Oh, you say the latest releases. That will be the problem. I’ll test this tomorrow. The plugin still uses api v4.0.3 to support older server builds for Pixelmon.
I’ll accept your answer when it works.

Thanks!

Latest release as far as i know, I thought it was also in 4.0.3, but I’m unsure.

So far making plugins for Sponge I haven’t made a single .mcinfo file. It should be supported out of the box.

It is but only in the latest release.

he said recent releases, not latest release. Its been part of the system for quite a number of months now…

Yes, okay.
But my point was that this IS supported “out of the box”.

Metadata generation is also available in 4.0.3.

The metadata will be generated by an annotation processor which was designed for Java source code. I’m not sure whether it works for Kotlin and additionally you may need to enable it manually.

SpongeGradle is not directly responsible for metadata generation which is why it works out of the box without specifically applying it in the Gradle build script. However, SpongeGradle can be used to automatically apply the version of the Gradle project to the generated metadata file which allows you to update the version only in one place (the Gradle build script).

Thanks for your response!

I tried doing the critical thing in Java here. It is a new branch in the repo. I even updated to api v4.1 but that doesn’t work either.
The docs don’t tell me how to enable the meta data generation, only how to override it.

This is because both major build systems (Maven and Gradle) have annotation processing enabled by default, you need to specifically disable it if you don’t want to use it. Therefore the Docs assume it is enabled or otherwise the user knows how to enable it again (because he had to disable it before).

However, using the Kotlin Gradle plugin likely skips all normal Java options or sets them up in a different way so you would need to check how you can enable annotation processing with your Kotlin compiler.

I fixed it for you in the pull request below. You need to explicitely tell Kotlin which dependencies to scan for annotation processors. From what I can tell, there is no need to convert your main class to Java.

1 Like

Wow! Thanks a lot! :grinning: :ok_hand:

1 Like