Releases: itsTyrion/PluginAnnotationProcessor
1.4 - just touchups but breaking
This update renames cleans up a few things:
- The annotations were moved into their own package (
bukkit
,bungee
,velocity
). @Plugin
got renamed to@BukkitPlugin
to reflect the name prefix ofBungeePlugin
andVelocityPlugin
.- The
version
property was removed from the annotations to avoid confusion - providing one via build system is required anyway. - The readme was cleaned up and mostly moved into wiki with long overdue updates.
As usual, it's already up on jitpack
1.3 - Velocity support
Yes, I know Velocity already uses an annotation and annotation processor to generate it's plugin meta file, I added support to conveniently have the version in there without resorting to hacks, manually changing it or setting up templating for a single string. Also wooo new feature.
Sooo, just add @VelocityPlugin
and specify depencendies with @Dependency
(warning, different import!) as usual.
1.2 - commands support
commands are now supported, just add @CommandInfo to them and register them as usual (getCommand..
)
1.1.2 - tiny bugfix
Fixed annotations being allowed on elements that aren't classes.
1.1.1
1.1
Added support for the libraries
property so the SpigotLibraryLoader can be used on Spigot-based servers (Spigot/Paper/Pufferfish/Purpur).
KEEP IN MIND THIS FEATURE WAS ADDED IN 1.17.1 SO IT DOES NOT WORK ON OLDER VERSIONS!
My testing was also NOT extensive, the "smoke test" passed, though.
To use it, create a new dependency config like so:
configurations {
spigotLib
compileOnly { extendsFrom spigotLib }
}
(The name is up to you, I used spigotLib
here)
change the dependency you want to load this way from implementation
(or compileOnly
, if you used a different method before) to the config name of your choice like so:
spigotLib 'com.google.inject:guice:7.0.0' // example dependency
and pass dependencies of that config to this processor:
// Kotlin example
kapt.arguments {
// Add other annotation processor arguments as/if needed - this example includes what I personally use for the version.
arg 'mcPluginVersion', version.contains("SNAPSHOT") ? (version + new Date().format('yyyyMMdd_HHmm')) : version
arg 'spigotLibraries', configurations.spigotLib.dependencies.collect { "$it.group:$it.name:$it.version" }.join(';')
}
// Java example
tasks.withType(JavaCompile).configureEach {
// Add other annotation processor arguments as/if needed - this example includes what I personally use for the version.
def versionString = version.contains("SNAPSHOT") ? (version + new Date().format('yyyyMMdd_HHmm')) : version
options.compilerArgs += ('-Aproject.version=' + versionString)
options.compilerArgs += '-AspigotLibraries=' + configurations.spigotLib.dependencies.collect { "$it.group:$it.name:$it.version" }.join(';')
}